16.12.2010, 17:37
I did, but I failed, my server crashed :S + I used the boulean false and it did repeat:
here is the code.
under OnGameModeInit()
then there is left:
The timer should start at public animations ---> (5000 ms)---> going to public ChangeSpawn --->800ms---> respawner --->720000ms---> back to animations etc. I used timers, but somehow it kept repeating, though I used false in the timer.
In the OnGameModeInit it is 720000, because then the animation will start and takes it over later on.
here is the code.
under OnGameModeInit()
Quote:
for(new i = 0; i < MAX_PLAYERS; i++) { SetTimerEx("animations",720000,true,"d",i); SetTimerEx("shops",720000,true,"d",i);//shop SetTimerEx("ChangeSpawn",724000,true,"d",i); //4 seconds after the animation SetTimerEx("respawner",725000,true,"d",i); // 5 seconds after the animation, cus of lag it is a 1s dif. } |
Quote:
public ChangeSpawn( ) { Spawn = random(MAX_SPAWN_MAPS); Scoreusa = 637; Scorevietnam = 637; Standusa = 0; Standvietnam = 0; return 1; } public respawner(playerid) { SpawnPlayer(playerid); TogglePlayerControllable(playerid, 1); return 1; } public animations(playerid) { TogglePlayerControllable(playerid, 0); if(Scoreusa > Scorevietnam) { if(GetPlayerTeam(playerid) == TEAM1) { ApplyAnimation(playerid,"DANCING","dance_loop",4.1 ,0,0,0,1,5000); } if(GetPlayerTeam(playerid) == TEAM2) { ApplyAnimation(playerid,"WUZI","CS_Dead_Guy",4.1,1 ,1,1,1,5000); } } else { if(GetPlayerTeam(playerid) == TEAM1) { ApplyAnimation(playerid,"WUZI","CS_Dead_Guy",4.1,1 ,1,1,1,5000); } if(GetPlayerTeam(playerid) == TEAM2) { ApplyAnimation(playerid,"DANCING","dance_loop",4.1 ,1,1,1,1,5000); } } return 1; } |
In the OnGameModeInit it is 720000, because then the animation will start and takes it over later on.