01.02.2012, 14:48
I make something and I hope it works.
And
Or
pawn Code:
new Float:cop_spawns[ 3 ][ ][ 4 ] =
{
{ // Los Santos
{0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 0.0}
}, // Los Santos
{ // San Fiero
{0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 0.0}
}, // San Fiero
{ // Las Venturas
{0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 0.0}
} // Las Venturas
};
pawn Code:
public OnPlayerSpawn( playerid )
{
new cityrand = random( 3 );
new rand = random( sizeof( cop_spawns ) );
if( cityrand == 0 )
{
SetPlayerPos( playerid, cop_spawns[ cityrand ][ rand ][ 0 ], cop_spawns[ cityrand ][ rand ][ 1 ], cop_spawns[ cityrand ][ rand ][ 2 ] );
}
else if( cityrand == 1 )
{
SetPlayerPos( playerid, cop_spawns[ cityrand ][ rand ][ 0 ], cop_spawns[ cityrand ][ rand ][ 1 ], cop_spawns[ cityrand ][ rand ][ 2 ] );
}
else
{
SetPlayerPos( playerid, cop_spawns[ cityrand ][ rand ][ 0 ], cop_spawns[ cityrand ][ rand ][ 1 ], cop_spawns[ cityrand ][ rand ][ 2 ] );
}
return 1;
}
pawn Code:
public OnPlayerSpawn( playerid )
{
new cityrand = random( 3 );
new rand = random( sizeof( cop_spawns ) );
SetPlayerPos( playerid, cop_spawns[ cityrand ][ rand ][ 0 ], cop_spawns[ cityrand ][ rand ][ 1 ], cop_spawns[ cityrand ][ rand ][ 2 ] );
return 1;
}