LucasFerraz
Systems Analyst
I didn't made this function, you can find author and post here.
All credits to CyberM.
How to use?^_^
Adjust frag storage to your storage (create a storage to frag)
Remember, it will get this storage(6776) as example. Not the kills, perfect to Hardcore/War Servers
All credits to CyberM.
Lua:
local FRAG_STORAGE = 6776
frag = {
add = function(cid, amount)
return doCreatureSetStorage(cid, FRAG_STORAGE, math.max(amount,getCreatureStorage(cid,FRAG_STORAGE)+amount))
end,
get = function(cid)
return math.max(0,getCreatureStorage(cid,FRAG_STORAGE))
end,
remove = function(cid, amount)
return getCreatureStorage(cid,FRAG_STORAGE) < amount and false or doCreatureSetStorage(cid,getCreatureStorage(cid,FRAG_STORAGE)-amount)
end,
reset = function(cid)
return doCreatureSetStorage(cid, FRAG_STORAGE, -1)
end
}
How to use?^_^
Lua:
frag.add(cid, amount)
frag.get(cid)
frag.remove(cid, amount)
frag.reset(cid)
Lua:
local FRAG_STORAGE = 6776
Remember, it will get this storage(6776) as example. Not the kills, perfect to Hardcore/War Servers
Last edited: