-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStorage.lua
More file actions
34 lines (30 loc) · 886 Bytes
/
Copy pathStorage.lua
File metadata and controls
34 lines (30 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
local commande = {};
require 'Storage/BgBonusStorage';
function commande.info (event, player, command)
if (command == "storage") then
local pGuid = player:GetGUIDLow();
local bonus = usercarac[pGuid];
if(bonus == nil)then
usercarac = {};
i = 0;
f = io.input ("/home/crusade/dev/bin/lua_scripts/UF/Storage/BgBonusStorage.lua", 'r')
for line in f:lines () do
table.insert(usercarac, line)
i = i + 1;
end
io.close(f)
indexline = i - 1;
usercarac[i] = ' ['..pGuid..'] = "AP",\n}'
file = io.open("/home/crusade/dev/bin/lua_scripts/UF/Storage/BgBonusStorage.lua", 'w')
for index, value in ipairs(usercarac) do
file:write(value..'\n')
end
file:flush()
file:close()
end
end
end
RegisterPlayerEvent(42, commande.info);
-- ListFile
local console = debug.getinfo (1, "S").short_src;
print("- "..console);