28.03.2018, 18:25
Your code should be causing lots of compilation errors.
See if this works.
Place this at the top of your gamemode
This will be used to determine if you have reached the end of your maps and if you should start from the beginning again.
Here are the timers:
Place this in OnGameModeInit()
Keep the OnPlayerSpawn() code like you did in your initial post.
See if this works.
Place this at the top of your gamemode
PHP код:
#define MapCount 2 //change this number to the amount of maps you have in your gamemode
static MapChange = 0;
Here are the timers:
PHP код:
forward MapTimer();
public MapTimer()
{
MapChange++;
if ( MapChange == MapCount )
MapChange = 0;
GameTextForAll("~y~LOADING NEW MAP", 4000, 6);
SetTimer("StartNewMap", 4000, false);
return 1;
}
forward StartNewMap();
public StartNewMap()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SpawnPlayer(i);
SendClientMessage(i, -1, "{FF0000}[SERVER]: The map has been changed, You can start playing now.");
}
return 1;
}
PHP код:
SetTimer("MapTimer",180000,true);