27.09.2013, 10:54
pawn Код:
new
Float: Save_Position[ MAX_PLAYERS ][ 4 ],
bool: InSpectate[ MAX_PLAYERS char ]
;
// OnPlayerConnect:
Save_Position[ playerid ][ 0 ] = 0.0;
Save_Position[ playerid ][ 1 ] = 0.0;
Save_Position[ playerid ][ 2 ] = 0.0;
Save_Position[ playerid ][ 3 ] = 0.0;
InSpectate{ playerid } = false;
// OnPlayerSpawn:
if( InSpectate{ playerid } )
{
SetPlayerPos( playerid, Save_Position[ playerid ][ 0 ], Save_Position[ playerid ][ 1 ], Save_Position[ playerid ][ 2 ] );
SetPlayerFacingAngle( playerid, Save_Position[ playerid ][ 3 ] );
InSpectate{ playerid } = false;
}
// Command /spec
GetPlayerPos( playerid, Save_Position[ playerid ][ 0 ], Save_Position[ playerid ][ 1 ], Save_Position[ playerid ][ 2 ] );
GetPlayerFacingAngle( playerid, Save_Position[ playerid ][ 3 ] );
InSpectate{ playerid } = true;