viniciusturko
New Member
Hello,
I'm creating an action that the player just can use the item 1 time between 10 minutes. I'm using Addevent, something like this :
It is working very well, but just if the player stay onLine
. If the player log out and after log in again, he can use the item again
.
How can I do it to this time stay saved in the Player GUID?
My second doubt I think is easyer than the first x_x.
In this same script, I'm using so many addEvents. But I'm using them like a function, and in the end of the script, I want to use "stopEvent", but it is not working =/...
Here is an example of my doubt :
I'm using the Add and Stop event same in this example script, but the event is not stoping, it is continueing and it just stop when I clase the server or log out.
Some one can help me?
I'm creating an action that the player just can use the item 1 time between 10 minutes. I'm using Addevent, something like this :
Code:
Function onUse(...)
if getPlayerStorageValue(cid,2222) == -1 then
setPlayerStorageValue(cid, 2222, 1)
addEvent(function()
setPlayerStorageValue(cid, 2222, -1)
end, 10 * 60 * 1000)
else
doPlayerSendTextMessage(cid, 22, "You cannot use the item again")
end
It is working very well, but just if the player stay onLine
How can I do it to this time stay saved in the Player GUID?
My second doubt I think is easyer than the first x_x.
In this same script, I'm using so many addEvents. But I'm using them like a function, and in the end of the script, I want to use "stopEvent", but it is not working =/...
Here is an example of my doubt :
Code:
function kickall(clean, save)
do....
do....
end
function onUse(...)
addEvent(kickall, 5000)
do....
do....
do....
stopEvent(kickall)
end
I'm using the Add and Stop event same in this example script, but the event is not stoping, it is continueing and it just stop when I clase the server or log out.
Some one can help me?
Last edited: