SA-MP Forums Archive
Timers screwed up - 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: Timers screwed up (/showthread.php?tid=107518)



Timers screwed up - [XST]O_x - 10.11.2009

Hey.
I'm having a problem with my timers.
Once they worked perfectly,But then i left my server,Came back today,And suddenly,All the timers screwed up.
I Mean,I've made some SendClientMessage's and GameTextForPlayer.. and more,So instead of sending a 1 client message in a minute,It sends 3 messages,
And stops working.I didn't change something from yesterday,But anyway i'll show you the codes:
top:
pawn Код:
forward VgodMsg(playerid);
forward Cheater(playerid);
forward RandomMsg(playerid);
OnPlayerConnect:
pawn Код:
SetTimer("RandomMsg",100000,0);
    SetTimer("VgodMsg",150000,0);
    SetTimer("Cheater",400000,0);
bottom:
pawn Код:
public RandomMsg(playerid)
{
    SendClientMessage(playerid,0xFFFFBFFF,"Forgot the commands? Check /Commands!");
    SendClientMessage(playerid,0xAAAA00FF,"Tired of standing in the same place?! Check our /Teles!");
    GameTextForAll("~R~/Commands,~G~/teles!",2000,5);
}
public VgodMsg(playerid)
{
    GameTextForAll("~y~Use /vgod on to get an ~n~invincible vehicle!",3000,5);
}
public Cheater(playerid)
{
    SendClientMessageToAll(0xFFFF80FF,"Think You've Spotted A Cheater?Use /Report to Alarm The admins that are online!");
    GameTextForAll("~r~/Report !",2567,5);
}
Does anyone knows the problem?
Thanks in advance.


Re: Timers screwed up - pagie1111 - 10.11.2009

To keep them looping (i think thats what you want?) put repeating to true

pawn Код:
SetTimer("RandomMsg",100000,true);
SetTimer("VgodMsg",150000,true);
SetTimer("Cheater",400000,true);

EDIT: These timers only work for ID 0
This is if you want it to show for everyone.
pawn Код:
public RandomMsg(playerid)
{
SendClientMessageToAll(0xFFFFBFFF,"Forgot the commands? Check /Commands!");
SendClientMessageToAll(0xAAAA00FF,"Tired of standing in the same place?! Check our /Teles!");
GameTextForAll("~R~/Commands,~G~/teles!",2000,5);
}
public VgodMsg(playerid)
{
GameTextForAll("~y~Use /vgod on to get an ~n~invincible vehicle!",3000,5);
}
public Cheater(playerid)
{
SendClientMessageToAll(0xFFFF80FF,"Think You've Spotted A Cheater?Use /Report to Alarm The admins that are online!");
GameTextForAll("~r~/Report !",2567,5);
}



Re: Timers screwed up - [XST]O_x - 10.11.2009

Quote:
Originally Posted by Awaran[Enemy-Plus
; ]
To keep them looping (i think thats what you want?) put repeating to true

pawn Код:
SetTimer("RandomMsg",100000,true);
SetTimer("VgodMsg",150000,true);
SetTimer("Cheater",400000,true);
Ok i'll try thanks.