Timer - 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: Timer (
/showthread.php?tid=76443)
Timer -
Packer5 - 04.05.2009
Hey all, I did the timer how It said in the wiki.
then I did this for the timer functions:
Код:
public outofhospital()
{
SetPlayerPos(playerid, 1179.1493,-1322.9857,14.1552);
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid, COLOR_GREEN, "You are out of hospital");
}
All seemed ok untill it said that the 1st 2nd and 3rd function was giving error: undefined symbol "playerid".
So I tried removing playerid and I got an error saying: Number of arguments dont match the definition?
could someone help?
thanks
Re: Timer -
Rks25 - 04.05.2009
public outofhospital(playerid)
and use SetTimerEx instead of SetTimer.
Re: Timer -
Packer5 - 04.05.2009
Quote:
Originally Posted by RKS_
public outofhospital(playerid)
|
thanks :P
Quote:
and use SetTimerEx instead of SetTimer.
|
whats the difference?
Re: Timer -
Joe Staff - 04.05.2009
SetTimerEx allows you to define the variables of the function, in this case 'playerid'
example:
SetTimerEx("outofhospital",30000,0,"i",playerid); the "i" mean that the variable is an integer, check the wiki for more uses
Re: Timer -
Packer5 - 04.05.2009
Quote:
Originally Posted by SA:MP Wiki
format[] Special format indicating the types of the variables following
{Float,_}:... Indefinite number of arguments to pass
|
I dont really understand that, guess I should just continue using SetTimer?
Re: Timer -
Rks25 - 04.05.2009
if you will do that, it will only work for id 0. If you want to use SetTimer, make sure you make a loop in the function than.
Re: Timer -
Packer5 - 04.05.2009
Код:
public outofhospital(playerid)
Quote:
C:\samp02Xserver.win32\gamemodes\script.pwn(1813) : error 025: function heading differs from prototype
|

please help
Re: Timer -
Rks25 - 04.05.2009
you had forward outofhospital();
make it outofhospital(playerid);