+rep Server Crash if i tape /stopbreach -
Eymeric69 - 29.05.2016
when i tape /breach it is doing the command normally but when i do /stopbreach it's crashing my server there is the code
PHP код:
CMD:breach(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
if (GetPVarInt(playerid, "BREACH") == 1) return SendClientMessage(playerid, 0xAA3333AA, "[ERREUR]Il y a dйjа une brиche en cours!");
SendClientMessage(playerid, 0x0000BBAA, "Vous avez bien lancez une brиche /stopbreach pour l'arrиter.");
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, "http://vignette2.wikia.nocookie.net/containmentbreach/images/c/cb/Intro3.ogg/revision/latest?cb=20130914185619");
halte(17);
PlayAudioStreamForPlayer(i, "http://vignette4.wikia.nocookie.net/containmentbreach/images/2/22/Alarm2.ogg/revision/latest?cb=20130914185645");
halte(7);
PlayAudioStreamForPlayer(i, "https://hydra-media.cursecdn.com/scpcb.gamepedia.com/f/f3/HCZ_Background.ogg");
halte(46);
StopAudioStreamForPlayer(i);
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA,"[ERREUR]Vous devez кtre administrateur.");
return 1;
}
return 1;
}
CMD:stopbreach(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
if (GetPVarInt(playerid, "BREACH") == 0) return SendClientMessage(playerid, 0xAA3333AA, "[ERREUR]Vous n'avez pas dйmarer de brиche !");
SendClientMessage(playerid, 0x0000BBAA, "Vous avez bien arreter la brиche.");
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, "http://k003.kiwi6.com/hotlink/khpcjp7zmg/682battle.ogg");
halte(54);
PlayAudioStreamForPlayer(i, "http://k003.kiwi6.com/hotlink/0k00bwkd58/Alarm3.ogg");
halte(5);
PlayAudioStreamForPlayer(i, "http://k003.kiwi6.com/hotlink/jygnbu8r2i/nuke1.ogg");
halte(7);
StopAudioStreamForPlayer(i);
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA,"[ERREUR]Vous devez кtre administrateur.");
return 1;
}
return 1;
}
and that it's the same :
PHP код:
CMD:scp106(playerid, params[])
{
if (GetPVarInt(playerid, "SCP106") == 1) return SendClientMessage(playerid, 0xAA3333AA, "[ERREUR]Tu est dйjа en SCP 106!");
// later SetPlayerPos(playerid, 0.0, 0.0, 0.0);
SetPlayerSkin(playerid, 160);
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, "http://k003.kiwi6.com/hotlink/pea0l5s90k/SCP_Containment_Breach_-_SCP-106_Theme_Bump_In_The_Night.ogg");
halte(123);
PlayAudioStreamForPlayer(i, "http://k003.kiwi6.com/hotlink/pea0l5s90k/SCP_Containment_Breach_-_SCP-106_Theme_Bump_In_The_Night.ogg");
halte(123);
StopAudioStreamForPlayer(i);
}
return 1;
}
CMD:stopscp106(playerid, params[])
{
if (GetPVarInt(playerid, "SCP106") == 0) return SendClientMessage(playerid, 0xAA3333AA, "[ERREUR]Tu n'est pas en SCP 106!");
for(new i = 0; i < MAX_PLAYERS; i++)
{
StopAudioStreamForPlayer(i);
}
return 1;
}
+rep if you see the what does it crash
edit : oh i have forget that :
PHP код:
halte(seconds)
{
new _nouveauTemps[4], _ancienTemps[4];
gettime(_ancienTemps[0], _ancienTemps[1],_ancienTemps[2]);
_ancienTemps[3] = _ancienTemps[2] + (_ancienTemps[1] * 60) + (_ancienTemps[0] * 600);
while(_nouveauTemps[3] != (_ancienTemps[3] + seconds))
{
gettime(_nouveauTemps[0], _nouveauTemps[1], _nouveauTemps[2]);
_nouveauTemps[3] = _nouveauTemps[2] + (_nouveauTemps[1] * 60) + (_nouveauTemps[0] * 600);
}
}
Re: +rep Server Crash if i tape /stopbreach -
Konstantinos - 29.05.2016
Do you know what "halte" meant to do? It's like "sleep" function that halts the server and when executing the command, the main thread stops for 2 minutes and 3 seconds. That means that the server MUST wait that long without updating anything. Remove it as soon as possible from your scripts.
Re: +rep Server Crash if i tape /stopbreach -
Eymeric69 - 29.05.2016
yeah how replace it ?
Re: +rep Server Crash if i tape /stopbreach -
Konstantinos - 29.05.2016
Is it about changing the audio after those 2 minutes? Just set a timer (not repeated to be called) and in its callback, loop through the players and play the next song or whatever it is. Then do the same for stopping the audio stream.
Re: +rep Server Crash if i tape /stopbreach -
Eymeric69 - 30.05.2016
i have set timer but it didn't work at all
PHP код:
CMD:breach(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
if (GetPVarInt(playerid, "BREACH") == 1) return SendClientMessage(playerid, 0xAA3333AA, "[ERREUR]Il y a dйjа une brиche en cours!");
SendClientMessage(playerid, 0x0000BBAA, "Vous avez bien lancez une brиche /stopbreach pour l'arrиter.");
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, "http://vignette2.wikia.nocookie.net/containmentbreach/images/c/cb/Intro3.ogg/revision/latest?cb=20130914185619");
SetTimer("audio", 17000, false);
PlayAudioStreamForPlayer(i, "http://vignette4.wikia.nocookie.net/containmentbreach/images/2/22/Alarm2.ogg/revision/latest?cb=20130914185645");
PlayAudioStreamForPlayer(i, "https://hydra-media.cursecdn.com/scpcb.gamepedia.com/f/f3/HCZ_Background.ogg");
StopAudioStreamForPlayer(i);
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA,"[ERREUR]Vous devez кtre administrateur.");
return 1;
}
return 1;
}
Re: +rep Server Crash if i tape /stopbreach -
jlalt - 30.05.2016
You can do it by this way:
PHP код:
SetTimerEx("Aduioz", 17000, 0, "di", playerid, 0); // set the timer for player with audio id 0
PHP код:
forward public Aduioz(playerid, audioz);
public Aduioz(playerid, audioz) {
switch(audioz) { // switch audio idz
case 0: { // check if id is 0
PlayAudioStreamForPlayer(playerid, "http://vignette4.wikia.nocookie.net/containmentbreach/images/2/22/Alarm2.ogg/revision/latest?cb=20130914185645"); // player song 1
SetTimerEx("Aduioz", 17000, 0, "di", playerid, 1); // set timer to play song 2
}
case 1: { // check if song id is 1
PlayAudioStreamForPlayer(playerid, "https://hydra-media.cursecdn.com/scpcb.gamepedia.com/f/f3/HCZ_Background.ogg"); // player song 2
SetTimerEx("Aduioz", 17000, 0, "di", playerid, 175566); // set timer to stop song
}
case 175566,default: // check if id match with stop audio id
StopAudioStreamForPlayer(playerid); // stop song for player
}
}
}
Re: +rep Server Crash if i tape /stopbreach -
Eymeric69 - 30.05.2016
i want do it in the /breach
Re: +rep Server Crash if i tape /stopbreach -
Eymeric69 - 30.05.2016
anyone please ?
Re: +rep Server Crash if i tape /stopbreach -
Noris - 30.05.2016
Its impossible to tape that command and will never be.