Timer Problem - 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 Problem (
/showthread.php?tid=199574)
Timer Problem -
ShawnMiller1337 - 15.12.2010
This only works correctly for ID 0 for some reason if ID 1 does /enter it sets ID 1 inside 177.4720,1894.8317,1149.6217
but dosn't unfreeze him only unfreezes id 0 what is causing this...
Код:
if(strcmp(cmd, "/enter", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (IsPlayerInRangeOfPoint(playerid,1.0,201.5866,1869.4396,13.1406))
{
SetPlayerPos(playerid,177.4720,1894.8317,1149.6217);
TogglePlayerControllable(playerid, 0);
SetTimer("DeMorganFreeze",2 * 1000,false);
}
Код:
forward DeMorganFreeze(playerid);
Код:
public DeMorganFreeze(playerid)
{
if(IsPlayerConnected(playerid))
{
TogglePlayerControllable(playerid, 1);
}
return 1;
}
Re: Timer Problem -
blackwave - 15.12.2010
pawn Код:
SetTimeExr("DeMorganFreeze",2 * 1000,false ,"i");
Instead:
pawn Код:
SetTimer("DeMorganFreeze",2 * 1000,false);
Re: Timer Problem -
ShawnMiller1337 - 15.12.2010
C:\Documents and Settings\Owner\Desktop\SA-MP Optical\gamemodes\OGv67.pwn(20401) : error 017: undefined symbol "SetTimeExr"
Re: Timer Problem -
ShawnMiller1337 - 15.12.2010
Nvm fixed that you made a typo anyway I replaced it with
SetTimerEx("DeMorganFreeze",2 * 1000,false ,"i");
now... it dosn't unfreeze NO ONE when they do /enter
Re: Timer Problem -
blackwave - 15.12.2010
Quote:
Originally Posted by ShawnMiller1337
Nvm fixed that you made a typo anyway I replaced it with
SetTimerEx("DeMorganFreeze",2 * 1000,false ,"i");
now... it dosn't unfreeze NO ONE when they do /enter
|
Remove the condition: IsPlayerConnected(playerid)
If it's not working, it's a bug somewhere else. Because that "must" unfreeze, according I see on the code
Re: Timer Problem -
ShawnMiller1337 - 15.12.2010
I removed IsPlayerConnected(playerid) under public DeMorganFreeze(playerid)
Still not unfreezing...
Re: Timer Problem -
blackwave - 15.12.2010
Last attempt:
pawn Код:
SetTimerEx("DeMorganFreeze", 2000, false, "i");
And:
If it's not working, it due some bug, because I had this same problem before, of time not working. For confirm if it's working add on the public of the function which will be set to: printf("working");. If shows, it's working. Otherwise, no.
Re: Timer Problem -
ShawnMiller1337 - 15.12.2010
I added in printf("working"); on the public... it says "working" but for some reason its not unfreezing..
Re: Timer Problem -
xxmitsu - 15.12.2010
You must pass the playerid parameter
pawn Код:
SetTimerEx("DeMorganFreeze", 2000, false, "d", playerid);