16.07.2015, 02:31
PHP код:
CMD:respawn(playerid)
{
for( new v = 0; v < MAX_VEHICLES; v++ )
{
if( !IsVehicleOccupied( v ) && NotTrailerAtached( v )) SetVehicleToRespawn( v );
{
SendClientMessage( playerid, 0x00FF66AA, "{FFFF00} Vocк respawnou todos os veнculos que estгo desocupados." );
}
}
return 1;
}
PHP код:
stock IsVehicleOccupied( vehicleid )
{
foreach(Player, i ) if( IsPlayerInVehicle( i, vehicleid ) && GetPlayerState( i ) == PLAYER_STATE_DRIVER )
return 1; return 0;
}
stock NotTrailerAtached( vehicle )
{
foreach(Player, i )
{
new
v = GetPlayerVehicleID( i )
;
if( IsPlayerInAnyVehicle( i ) && GetVehicleModel( v ) == 515 )
{
if( vehicle == GetVehicleTrailer( GetPlayerVehicleID( i )) )
{
return 0;
}
}
}
return 1;
}