PVar with SetTimerEx - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: PVar with SetTimerEx (
/showthread.php?tid=265241)
PVar with SetTimerEx -
clavador - 30.06.2011
Hi.
I wanted to ask if there's a problem (or maybe is that way) with PVar's and SetTImerEx, because I create a Pvar like:
pawn Код:
SetPVarInt(playerid,"timer1",SetTimerEx("TIMER",1000,true,"i",playerid));
But the timer never starts.
Are PVars and timers incompatible or am I doing something wrong?
EDIT:
I think I've found the error. Im creating the PVar calling a function that is in another script.
How can I initiate a timer inside another Filterscript?
The solution im using now is calling a remote function from the filterscript to the gamemode and this function creating the timer, like:
Inside Filterscript:
pawn Код:
CallRemoteFunction("function","i",playerid);
Inside Gamemode:
pawn Код:
forward function(playerid);
public function(playerid)
{
timer[playerid] = SetTimerEx("timer",1000,true,"i",playerid);
return 1;
}
Re: PVar with SetTimerEx -
PrawkC - 30.06.2011
Pretty sure its because for the time you put 10 00
Respuesta: Re: PVar with SetTimerEx -
clavador - 30.06.2011
Quote:
Originally Posted by PrawkC
Pretty sure its because for the time you put 10 00
|
No, that is a sentence I wrote for the forum and is the page that shows the number wrong. I've tried to edit the sentence but in the edit section looks good, and when I submit the post it shows like "10 00" but it says "1000".
EDIT: I had to put the sentence inside the "PAWN" tag because it showed the number wrong.
Re: PVar with SetTimerEx -
PrawkC - 30.06.2011
show me the function "TIMER"
Respuesta: PVar with SetTimerEx -
clavador - 30.06.2011
The code im showing you is the same code i have inside my script, but with the variable names.
The problem is not the functions or the variables... im just asking if anyone knows a better way to call a timer from another script without doing what im doing here.