Problem with SetTimer - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Problem with SetTimer (
/showthread.php?tid=304317)
Problem with SetTimer -
BosS_BondS - 17.12.2011
Ok I want to do something as a CS server on the SAMP, but I have a problem with the command settimer... look
Код:
public reborn1(playerid)
{
SetPlayerPos(playerid, 208,1869,13);
return 1;
}
I added the forward, and the player's death
Код:
if (PlayerDied [playerid] == 1)
{
SetTimerEx("reborn1", 15000, 0);
}
Warning & Error Message:
Код:
warning 202: number of arguments does not match definition
error 025: function heading differs from prototype
Re: Problem with SetTimer -
Calgon - 17.12.2011
pawn Код:
forward reborn1(playerid);
You need to insert the playerid parameter in your forward, this fixes your 'function heading differs from prototype' problem.
pawn Код:
SetTimerEx("reborn1", 15000, false, "d", playerid);
You were not using SetTimerEx correctly,
the wiki clearly states the correct format.
The code I have created above for you will work, it will call in 15 seconds with the playerid parameter. You need to direct the function to the playerid parameter, so it knows what it's supposed to be dealing with.
Next time, post in the Scripting Discussion section.
Re: Problem with SetTimer -
BosS_BondS - 18.12.2011
Thank you very much, I'm new in scripting and on forum .... so tnx
Quote:
Originally Posted by Calgon
Next time, post in the Scripting Discussion section.
|
Sorry
I would give you rep+ but already am