Hello, i would like to present my very simple lua function.
ifOnlyOnce(cid, storage)
Ive made many quests, so that function is very useful to me, if someone need this, feel free to use
EX:
ifOnlyOnce(cid, storage)
Lua:
function ifOnlyOnce(cid,storage)
if getPlayerStorageValue(cid, storage) >= 0 then
return FALSE
else
setPlayerStorageValue(cid, storage, 1)
return TRUE
end
end
Ive made many quests, so that function is very useful to me, if someone need this, feel free to use
EX:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if ifOnlyOnce(cid, 65432) then
doPlayerAddItem(cid,2152,79)
doPlayerAddItem(cid,2160,1)
else
doPlayerSendCancel(cid, "Nothing usefull here")
end
return TRUE
end
Last edited: