What's wrong with this part of my script? - 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)
+--- Thread: What's wrong with this part of my script? (
/showthread.php?tid=282646)
What's wrong with this part of my script? -
rangerxxll - 12.09.2011
When I drive to the checkpoint, it freezes me and says "Unloading..." But it never unfreezes me, what's wrong with it? Thanks for your help.
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
TogglePlayerControllable(playerid, 0);
SetTimer("Unloading...", 5000, false);
GameTextForPlayer(playerid, "~g~Unloading...", 5000, 5);
GivePlayerMoney(playerid, 7500); //You can edit this
SendClientMessage(playerid, blue, "Congratulations, you have earned 7500"); //You can edit this
DisablePlayerCheckpoint(playerid);
return 1;
}
forward Unloading(playerid);
public Unloading(playerid)
{
TogglePlayerControllable(playerid, 1);
return 1;
}
Re: What's wrong with this part of my script? -
Dr - 12.09.2011
Instead of settimer use:
pawn Код:
SetTimerEx("Unloading", 5000, 0, "i", playerid);
Re: What's wrong with this part of my script? -
PrawkC - 12.09.2011
You have "SetTimer("Unloading...", 5000, false);"
and your function is
forward Unloading(playerid);
public Unloading(playerid)
{
TogglePlayerControllable(playerid, 1);
return 1;
}
.. Please tell me you understand what you did wrong.
Re: What's wrong with this part of my script? -
AceFlyer - 12.09.2011
Quote:
Originally Posted by Dr
Instead of settimer use:
pawn Код:
SetTimerEx("Unloading", 5000, 0, "i", playerid);
|
The SetTimerEx Stores a variable when you create it in this case the variable is the player id
Well if you want a better explaination
https://sampwiki.blast.hk/wiki/SetTimerEx
+ Rep if this helped
Re: What's wrong with this part of my script? -
[MG]Dimi - 12.09.2011
Quote:
Originally Posted by AceFlyer
|
Variables? You mean params as said on wiki.