SA-MP Forums Archive
Come on.... Please help me :=0 - 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: Come on.... Please help me :=0 (/showthread.php?tid=199815)



Come on.... Please help me :=0 - Baboon - 16.12.2010

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.


Re: Come on.... Please help me :=0 - WillyP - 16.12.2010

Make a timer inside a timer.


Re: Come on.... Please help me :=0 - Baboon - 16.12.2010

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.


Re: Come on.... Please help me :=0 - Baboon - 16.12.2010

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


Re: Come on.... Please help me :=0 - Ricardo187 - 16.12.2010

First of all i ask you to read this

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


Re: Come on.... Please help me :=0 - Baboon - 16.12.2010

... 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 >.>


Re: Come on.... Please help me :=0 - Baboon - 17.12.2010

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