Example random spawn needed
#8

pawn Код:
new Float:RandSpawns1[ ][ 4 ] = // Team 1
{
    {X, Y, Z, Angle},
    {X, Y, Z, Angle}
};

new Float:RandSpawns1[ ][ 4 ] =  // team 2
{
    {X, Y, Z, Angle},
    {X, Y, Z, Angle}
};
// Add 5 more variables with random spawns for each Team

public OnPlayerSpawn( playerid )
{
    new
        rand;
       
    if( gTeam[ playerid ] == Team1 )
    {
        rand = random( sizeof( RandSpawns1 ) );
           
        SetPlayerPos( playerid, RandSpawns1[ rand ][ 0 ], RandSpawns1[ rand ][ 1 ], RandSpawns1[ rand ][ 2 ] );
        SetPlayerFacingAngle( playerid, RandSpawns1[ rand ][ 3 ] );
    }
    if( gTeam[ playerid ] == Team2 )
    {
        rand = random( sizeof( RandSpawns1 ) );

        SetPlayerPos( playerid, RandSpawns2[ rand ][ 0 ], RandSpawns2[ rand ][ 1 ], RandSpawns2[ rand ][ 2 ] );
        SetPlayerFacingAngle( playerid, RandSpawns2[ rand ][ 3 ] );
    }
    // For each Team too
    return 1;
}
Reply


Messages In This Thread
Example random spawn needed - by smokeweed - 04.02.2012, 16:11
Re: Example random spawn needed - by [ABK]Antonio - 04.02.2012, 16:15
Re: Example random spawn needed - by smokeweed - 04.02.2012, 16:26
Re: Example random spawn needed - by Konstantinos - 04.02.2012, 16:31
Re: Example random spawn needed - by smokeweed - 04.02.2012, 16:32
Re: Example random spawn needed - by [ABK]Antonio - 04.02.2012, 16:33
Re: Example random spawn needed - by smokeweed - 04.02.2012, 16:41
Re: Example random spawn needed - by Konstantinos - 04.02.2012, 16:49

Forum Jump:


Users browsing this thread: 2 Guest(s)