25.11.2010, 13:23
You could do:
pawn Код:
#include <a_samp>
enum e_SPAWN_POINTS
{
Float:e_fX,
Float:e_fY,
Float:e_fZ,
Float:e_fRot
};
new const g_SpawnPoints[ ][ e_SPAWN_POINTS ] = {
// x y z rotation
{ 123.0, 456.0, 789.0, 0.0 },
{ 123.0, 456.0, 789.0, 0.0 },
{ 123.0, 456.0, 789.0, 0.0 },
{ 123.0, 456.0, 789.0, 0.0 },
{ 123.0, 456.0, 789.0, 0.0 },
{ 123.0, 456.0, 789.0, 0.0 },
{ 123.0, 456.0, 789.0, 0.0 },
{ 123.0, 456.0, 789.0, 0.0 },
{ 123.0, 456.0, 789.0, 0.0 }
};
new g_iSpawnPoint = 0;
public OnGameModeInit( )
{
SetTimer( "UpdateSpawnPoint", 6 * 60 * 1000, true );
}
forward UpdateSpawnPoint( );
public UpdateSpawnPoint( )
g_iSpawnPoint = ( g_iSpawnPoint + 1 ) % sizeof( g_SpawnPoints );
public OnPlayerSpawn( playerid )
{
SetPlayerPos( playerid, g_SpawnPoints[ g_iSpawnPoint ][ e_fX ], g_SpawnPoints[ g_iSpawnPoint ][ e_fY ], g_SpawnPoints[ g_iSpawnPoint ][ e_fZ ] );
SetPlayerFacingAngle( playerid, g_SpawnPoints[ g_iSpawnPoint ][ e_fRot ] );
}