SA-MP Forums Archive
Game mode restart and with music? Please Help! - 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: Game mode restart and with music? Please Help! (/showthread.php?tid=101960)



Game mode restart and with music? Please Help! - DeltaAirlines12 - 13.10.2009

Alright, to start off, I have searched, and I know this is a stupid question...........
How do I make it so my server/ game mode restarts every 15 minutes?
And music id 1183 plays, and I want the music to stop when it returns to player class selection?
To stop the music is music id 1184. Thanks!


Re: Game mode restart and with music? Please Help! - Peter_Corneile - 13.10.2009

pawn Code:
forward Restart();

public OnGameModeInIt()
{
SetTimer("Restart",900000,false);
return 1;
}

public Restart()
{
GameModeExit();
}
This will restart the server every 15 minutes


Re: Game mode restart and with music? Please Help! - .•[XpoweR]•. - 13.10.2009

Here is your music code


Put that after OnPlayerConnect
Code:
PlayerPlaySound(playerid,1183,418.1829,2533.8340,16.5637);//to play the sound
And that after OnPlayerSpawn
Code:
PlayerPlaySound(playerid,1183,418.1829,2533.8340,16.5637);//to stop the sound
Have fun ! ^^


Re: Game mode restart and with music? Please Help! - virspector - 13.10.2009

Sound:

pawn Code:
OnPlayerSpawn(playerid)
{
PlayerPlaySound(playerid, 1184, 0, 0, 0) //Sound will be played when player spawned
}

OnPlayerDeath(playerid, killerid, reason)
{
PlayerPlaySound(playerid, 1183, 0, 0, 0) //Stop sound when player is death. But, it will be played again when the player re-spawn
}