SA-MP Forums Archive
How to change maps - 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: How to change maps (/showthread.php?tid=254906)



How to change maps - Sid_Alexander - 13.05.2011

alright guys, now so im starting my new gamemode, i wanna know how can i change the mapname and a map after a couple of minutes, example after 30 mins, can anyone help here? it is gunna be a My own map, im gunna be mapping it in MTA


Re: How to change maps - Laronic - 13.05.2011

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



Re: How to change maps - Biesmen - 13.05.2011

And you can modify the mapname by using this:
pawn Код:
SendRconCommand("mapname YourMapName");