PHP код:
//Topo
new kPos[ 5 ];
if( !strcmp( cmdtext, "/salvar", true ) )
{
GetPlayerPos( playerid, kPos[ 0 ], kPos[ 1 ], kPos[ 2 ] );
GetPlayerFacingAngle( playerid, kPos[ 3 ] );
SendClientMessage( playerid, COR, "Vocк guardou a posiзгo use '/irsalvo'!" );
kPos[ 4 ] = ( GetPlayerInterior( playerid ) );
PlayerPlaySound( playerid, 1137 , 0.0, 0.0, 0.0 );
return 1;
}
if( !strcmp( cmdtext, "/irsalvo", true ) )
{
if ( !floatsqroot( kPos[ 0 ] + kPos[ 1 ] + kPos[ 2 ] ) )
{
return SendClientMessage( playerid, COR, "Deve salvar antes!'/salvar'" );
}
else
{
if( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
{
SetVehiclePos( GetPlayerVehicleID(playerid), kPos[ 0 ], kPos[ 1 ], kPos[ 2 ] );
SetVehicleZAngle( GetPlayerVehicleID( playerid ), kPos[ 3 ] );
SetCameraBehindPlayer( playerid );
LinkVehicleToInterior( GetPlayerVehicleID( playerid ), kPos[ 4 ]) ;
return true;
}
else
{
EnCoche[ playerid ] = false;
SetPlayerPos( playerid, kPos[ 0 ], kPos[ 1 ], kPos[ 2 ] );
SetPlayerFacingAngle( playerid, kPos[ 3 ] );
SetCameraBehindPlayer( playerid );
return true;
}
PlayerPlaySound( playerid, 1085, 0.0, 0.0, 0.0 );
SetPlayerInterior( playerid, kPos[ 4 ] );
SendClientMessage( playerid, COLOR_ORANGE, "Posiзгo carregada com sucesso!!" );
}
return true;
}