07.07.2012, 07:46
pawn Код:
#define check_player_in_car true//make false if you not want to check player
CMD:respawncar(playerid, params[]) {
if(isnull(params)) {
SendClientMessage(playerid, 0xFFFFFFFFF, "/respawncar [id]");
return 1;
}
if (params == INVALID_VEHICLE_ID ) return SendClientMessage( playerid, COLOR_RED, "ERROR: Invalid vehicle ID." );
#if check_player_in_car == true
for(new i=0; i<MAX_PLAYERS; i++){
if(IsPlayerInVehicle(i, params))
{
SendClientMessage(playerid,0xFFFFFFFFF,"There is a player in vehicle");
return 1;
}
}
#endif
SetVehicleToRespawn(params);
SendClientMessage(playerid,0xFFFFFFFFF,"Vehicle is Respawned");
return 1;
}