map doesnt change
#9

Your code should be causing lots of compilation errors.
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
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:
PHP код:
forward MapTimer();
public 
MapTimer()
{
    
MapChange++;
    if ( 
MapChange == MapCount )
        
MapChange 0;
    
    
GameTextForAll("~y~LOADING NEW MAP"40006);
    
SetTimer("StartNewMap"4000false);
    return 
1;
}
forward StartNewMap();
public 
StartNewMap()
{
   for(new 
0MAX_PLAYERSi++) 
   {
        
SpawnPlayer(i);
        
SendClientMessage(i, -1"{FF0000}[SERVER]: The map has been changed, You can start playing now.");
  }
  return 
1;

Place this in OnGameModeInit()
PHP код:
SetTimer("MapTimer",180000,true); 
Keep the OnPlayerSpawn() code like you did in your initial post.
Reply


Messages In This Thread
map doesnt change - by ivndosos - 27.03.2018, 14:56
Re: map doesnt change - by ForCop - 27.03.2018, 15:00
Re: map doesnt change - by ivndosos - 27.03.2018, 15:03
Re: map doesnt change - by ForCop - 27.03.2018, 15:16
Re: map doesnt change - by ivndosos - 28.03.2018, 17:17
Re: map doesnt change - by IceBilizard - 28.03.2018, 17:30
Re: map doesnt change - by AdamsLT - 28.03.2018, 17:38
Re: map doesnt change - by ivndosos - 28.03.2018, 17:45
Re: map doesnt change - by AdamsLT - 28.03.2018, 18:25
Re: map doesnt change - by ivndosos - 29.03.2018, 10:58

Forum Jump:


Users browsing this thread: 2 Guest(s)