Come on.... Please help me :=0
#1

Quote:

for(new i = 0; i < MAX_PLAYERS; i++)
{
SetTimerEx("shops",720000,false,"d",i);//shop
SetTimerEx("ChangeSpawn",34000,false,"d",i);
SetTimerEx("respawner",35000,false,"d",i);
SetTimerEx("animations",30000,false,"d",i);
}

how can I repeat this all but with a brake of 5 seconds, so like: 0-5 seconds it will work. 5-10 it has a brake, 10-15 it works again, 15-20 seconds a brake etc... if I make a SetTimerEx in the SetTimerEx of changespawn, to repeat it, then it will crash.

Greetz, me.
Reply
#2

Make a timer inside a timer.
Reply
#3

I did, but I failed, my server crashed :S + I used the boulean false and it did repeat:
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.
}

then there is left:

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;
}

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.
Reply
#4

bump..........
Please help, omg <.< >.>, I can't script further, waiting like hours for an answer <,<
Reply
#5

First of all i ask you to read this

https://sampforum.blast.hk/showthread.php?tid=199560
Reply
#6

... I am not a newb anymore Ricardo... Ofcourse I know that, but read my first message.. <.<
What you sent is just like I have, only this 'quote' doesnt give you tabs >.>
Reply
#7

bump..........
someone..?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)