Need help with settimer.
#1

Heey all,
I want to make a timer for backup for police.
So if you use the command for backup your colour will be setted to purple for 3 mins and after 3 mins it will be blue again.
How can i do this because i am not good with timers.

Thanks admigo
Reply
#2

https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#3

Already readed that,i dont understand it.
This code dont works:
Код:
//top of script
forward backuptimer(playerid);
//onkidnapcommand 
SetTimer("backuptimer",10000,0);//i setted so low for test

public backuptimer(playerid)
{
	SetPlayerColor(playerid,COLOR_BLUE);
    return 1;
}
How can i fix it?
Reply
#4

pawn Код:
new PlayerTimer[MAX_PLAYERS];

forward Timer(playerid);

PlayerTimer[playerid] = SetTimerEx("Timer", 1000*180, 0, "d", playerid);

public Timer(playerid)
{
SetPlayerColor(playerid, COLOR_BLUE);
KillTimer(PlayerTimer[playerid]);
}
At least this works

1000*180 = 180000 milliseconds = 180 seconds = 180 seconds / 60 = 3 minutes

Hope this helps you and you can build the another timer
Reply
#5

OMG,Thank you so much.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)