08.12.2009, 07:45
Guys i need some help with timers,i make when player enter the Checkpoint and type /rob it will start countdown 7,6,5,4,3,2,1,winer ...
but how i can make if player leave this CP1 this timer wont countdown anymore if he leave the CP
i make under GamemodeInit ...
sure before this timer i have , new timer1; , new timer2; etc etc
than i have Command
this command its not tested yet if its right but i get no errors for now , i must just test those strings etc
so when player will write in CP1 /rob it will start countdown
but how i can make if player leave this CP1 it will cancle the count down i try with that
CODE:
but it wont stop the countdown when i exit the CP1
any help please ?
but how i can make if player leave this CP1 this timer wont countdown anymore if he leave the CP
i make under GamemodeInit ...
Code:
timer1 = SetTimer("Seven", 1000, 0); timer2 = SetTimer("Six", 2000, 0); timer3 = SetTimer("Five", 3000, 0); timer4 = SetTimer("Four", 4000, 0); timer5 = SetTimer("Three", 5000, 0); timer6 = SetTimer("Two", 6000, 0); timer7 = SetTimer("One", 7000, 0); timer8 = SetTimer("Winner", 8000, 0);
than i have Command
Code:
if (strcmp("/rob", cmdtext, true, 10) == 0) { if(gTeam[playerid] != TEAM_GROVE) { SendClientMessage(playerid,0x33CCFFAA,"You Must Be In Grove Team To Rob Jefferson Motel!"); return 1; } if(IsPlayerInCheckpoint(playerid)) { SetTimer("Seven", 1000, 0); SetTimer("Six", 2000, 0); SetTimer("Five", 3000, 0); SetTimer("Four", 4000, 0); SetTimer("Three", 5000, 0); SetTimer("Two", 6000, 0); SetTimer("One", 7000, 0); SetTimer("Winner", 8000, 0); format(string, sizeof(string), "%s(%d) Is Robbing Jefferson It Will Take 8 Seconds To Complete Robbery!",pname,giveplayerid); SendClientMessage(TEAM_COP,0xFFFF00AA,string); return 1; } else { SendClientMessage(playerid,0xFF0000AA,"You Must Be In Checkpoint To Rob!"); } return 1; } return 0; }
so when player will write in CP1 /rob it will start countdown
but how i can make if player leave this CP1 it will cancle the count down i try with that
CODE:
Code:
public OnPlayerLeaveCheckpoint(playerid) { if (IsPlayerInCheckpoint(playerid) == CP1) { KillTimer(timer1); KillTimer(timer2); KillTimer(timer3); KillTimer(timer4); KillTimer(timer5); KillTimer(timer6); KillTimer(timer7); KillTimer(timer8); } return 1; }
any help please ?