25.12.2018, 01:05
find nearest vehicle to player, if Enforcer is nearest one than let him use swat command like this
if Enforcer is nearest
if player in Enforcer
if Enforcer is nearest
Код:
CMD:swat(playerid, params[]) { if(GetVehicleModel(GetNearestVehicleToPlayer(playerid)) != Enforcer_Vehicle_Model) return SendClientMessage(playerid, -1, "you are not close to enforcer") return 1; }
Код:
CMD:swat(playerid, params[]) { if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "you are not inside Enforcer") if(GetVehicleModel(GetPlayerVehicleID(playerid)) != Enforcer_Vehicle_Model) return SendClientMessage(playerid, -1, "you need to Enforcer vehicle to use this command") return 1; }