How to change maps
#2

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);
    }
}
Reply


Messages In This Thread
How to change maps - by Sid_Alexander - 13.05.2011, 14:24
Re: How to change maps - by Laronic - 13.05.2011, 14:37
Re: How to change maps - by Biesmen - 13.05.2011, 14:40

Forum Jump:


Users browsing this thread: 2 Guest(s)