SA-MP Forums Archive
Random Spawns for Teams - 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: Random Spawns for Teams (/showthread.php?tid=353887)



Random Spawns for Teams - andrew2695 - 24.06.2012

fixed


Re: Random Spawns for Teams - [NWA]Hannes - 24.06.2012

pawn Код:
public OnPlayerSpawn (playerid)
{
    new MexiSpawns = random(sizeof(MexicanSpawns));
    new AmericSpawns = random(sizeof(AmericanSpawns));
    new BPSpawns = random(sizeof(BorderPatrolSpawns));

    if(gTeam[playerid] == TEAM_MEXICAN)
    {
        SetPlayerPos(playerid, MexicanSpawns[MexiSpawns][0], MexicanSpawns[MexiSpawns][1], MexicanSpawns[MexiSpawns][2]);
        SetPlayerFacingAngle(playerid, MexicanSpawns[MexiSpawns][3]);
        GivePlayerWeapon(playerid, 24, 1);
    }
    else if (gTeam[playerid] == TEAM_AMERICAN)
    {
        SetPlayerPos(playerid, AmericanSpawns[AmericSpawns][0], AmericanSpawns[AmericSpawns][1], AmericanSpawns[AmericSpawns][2]);
        SetPlayerFacingAngle(playerid, AmericanSpawns[AmericSpawns][3]);
        GivePlayerWeapon(playerid, 24, 2);
    }
    else if (gTeam[playerid] == TEAM_BP)
    {
        SetPlayerPos(playerid, BorderPatrolSpawns[BPSpawns][0], BorderPatrolSpawns[BPSpawns][1], BorderPatrolSpawns[BPSpawns][2]);
        SetPlayerFacingAngle(playerid, BorderPatrolSpawns[BPSpawns][3]);
        GivePlayerWeapon(playerid, 24, 3);
    }
    return 1;
}



Re : Random Spawns for Teams - andrew2695 - 24.06.2012

its working thx.