depot.lua

main 49 lines · 1.4 KB Raw
Alex Alex Commit Server upload 18/10/2026 23:38
1function onSay(player, words, param)
2 local split = param:splitTrimmed(" ")
3 if split[01] then
4 if _DEBUG_MODE then
5 local _TYPE = {
6 ["00"] = 'Atualizando Depot',
7 ["01"] = 'Adicionando Itens ao Depot',
8 ["02"] = 'Retirando Itens no Depot',
9 }
10
11 if _TYPE[split[01]] then
12 print("[TALK - DEPOT] " ..player:getName().. " - " .._TYPE[split[01]])
13 else
14 print("[TALK - DEPOT] " ..player:getName().. " - " ..split[01])
15 end
16 end
17 if split[01] == "00" then -- ATUALIZANDO DEPOT
18 onDepot(player, 00, 01)
19 doBackpack(player, 00, 03, 00, 01)
20 return false
21 end
22 if split[01] == "01" then -- ADICIONANDO ITENS NO DEPOT
23 local slot = tonumber(split[02]) or nil
24 local ext = tonumber(split[03]) or nil
25 local pos = tonumber(split[04]) or nil
26 local qnt = tonumber(split[05]) or nil
27
28 if slot == nil or ext == nil or pos == nil or qnt == nil then
29 return false
30 end
31 onDepot(player, 01, 01, 00, slot, ext, pos, qnt)
32 return false
33 end
34 if split[01] == "02" then --RETIRANDO ITENS NO DEPOT
35 local slot = tonumber(split[02]) or nil
36 local ext = tonumber(split[03]) or nil
37 local pos = tonumber(split[04]) or nil
38 local qnt = tonumber(split[05]) or nil
39
40 if slot == nil or ext == nil or pos == nil or qnt == nil then
41 return false
42 end
43 onDepot(player, 02, 01, pos, slot, ext, 00, qnt)
44 return false
45 end
46 end
47 return false
48end
49
Top