13.05.2011, 14:37
pawn Код:
new CurrentMap = 0;
public OnGameModeInit()
{
SetTimer("MapChanger", 300000, true)
return 1;
}
forward MapChanger();
public MapChanger()
{
switch(CurrentMap)
{
case 0: CurrentMap ++, KillEveryone(), SendRconCommand("mapname MAP_NAME");
case 1: CurrentMap ++, KillEveryone(), SendRconCommand("mapname MAP_NAME");
case 2: CurrentMap ++, KillEveryone(), SendRconCommand("mapname MAP_NAME");
case 3: CurrentMap ++, KillEveryone(), SendRconCommand("mapname MAP_NAME");
case 4: CurrentMap ++, KillEveryone(), SendRconCommand("mapname MAP_NAME");
case 5: CurrentMap ++, KillEveryone(), SendRconCommand("mapname MAP_NAME");
default: CurrentMap = 0, KillEveryone(), SendRconCommand("mapname MAP_NAME");
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(CurrentMap == 1)
{
//SetPlayerPos: Map 1 spawn
}
else if(CurrentMap == 2)
{
//SetPlayerPos: Map 1 spawn
}
else if(CurrentMap == 3)
{
//SetPlayerPos: Map 1 spawn
}
else if(CurrentMap == 4)
{
//SetPlayerPos: Map 1 spawn
}
else if(CurrentMap == 5)
{
//SetPlayerPos: Map 1 spawn
}
return 1;
}
stock KillEveryone()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetPlayerHealth(i, 0.0);
}
}