SA-MP Forums Archive
Spawn problem. - 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)
+--- Thread: Spawn problem. (/showthread.php?tid=542151)



Spawn problem. - Rudy_ - 17.10.2014

Edit: Nvm


Re: Spawn problem. - Rudy_ - 17.10.2014

http://pastebin.com/Wq9RaXUF


Re: Spawn problem. - Rudy_ - 17.10.2014

I've tried this under OnPlayerSpawn
pawn Код:
if(CurrentMap == 0)
    {
        switch (gTeam[playerid])
        {
            case 0: //team 1
            {
                new Random = random(sizeof(PropSpawns));
                SetPlayerPos(playerid, PropSpawns[Random][Pos][0], PropSpawns[Random][Pos][1], PropSpawns[Random][Pos][2]);
                SetPlayerFacingAngle(playerid, PropSpawns[Random][Pos][3]);
            }
            case 1: //team 2
            {
                new Random = random(sizeof(HunterSpawns));
                SetPlayerPos(playerid, HunterSpawns[Random][Pos][0], HunterSpawns[Random][Pos][1], HunterSpawns[Random][Pos][2]);
                SetPlayerFacingAngle(playerid, HunterSpawns[Random][Pos][3]);
            }
        }
        CurrentMap = 1;
    }
    else if(CurrentMap == 1)
    {
        switch (gTeam[playerid])
        {
            case 0: //team 1
            {
                new Random = random(sizeof(PropSpawns));
                SetPlayerPos(playerid, PropSpawns[Random][Pos][0], PropSpawns[Random][Pos][1], PropSpawns[Random][Pos][2]);
                SetPlayerFacingAngle(playerid, PropSpawns[Random][Pos][3]);
            }
            case 1: //team 2
            {
                new Random = random(sizeof(HunterSpawns));
                SetPlayerPos(playerid, HunterSpawns[Random][Pos][0], HunterSpawns[Random][Pos][1], HunterSpawns[Random][Pos][2]);
                SetPlayerFacingAngle(playerid, HunterSpawns[Random][Pos][3]);
            }
        }
        CurrentMap = 0;
    }
    return 1;
}
It all works fine now, But the spawn positions is always of Map 0 .... I spawn at map 0 spawn positions when it's map 0 and even if it is map 1,.. Anyone? :/


Re: Spawn problem. - Rudy_ - 18.10.2014

can anyone help me??