How do I script something like this?
#3

find nearest vehicle to player, if Enforcer is nearest one than let him use swat command like this

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;
}
if player in Enforcer
Код:
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;
}
Reply


Messages In This Thread
How do I script something like this? - by aKnoxx - 25.12.2018, 00:02
Re: How do I script something like this? - by aKnoxx - 25.12.2018, 00:51
Re: How do I script something like this? - by iorp - 25.12.2018, 01:05
Re: How do I script something like this? - by aKnoxx - 25.12.2018, 01:20
Re: How do I script something like this? - by iorp - 25.12.2018, 01:23
Re: How do I script something like this? - by aKnoxx - 25.12.2018, 01:38
Re: How do I script something like this? - by iorp - 25.12.2018, 01:41
Re: How do I script something like this? - by Pottus - 25.12.2018, 02:06
Re: How do I script something like this? - by iorp - 25.12.2018, 02:10
Re: How do I script something like this? - by aKnoxx - 25.12.2018, 02:29

Forum Jump:


Users browsing this thread: 2 Guest(s)