I need arrest command
#1

Hi.I need if player is cop to can arrest player if he is a crime.But i wanna to can arrest it if the crime player is near by cop and if the crime isn't in vehicle.Sorry for my bad english
Reply
#2

pawn Код:
CMD:ar(playerid, params[])
{
    if(!IsPlayerCop(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You are not a cop!"); //Player must be a cop to use this command
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new Float:pposx, Float:pposy, Float:pposz;
            GetPlayerPos(playerid, pposx, pposy, pposz);
            if(IsPlayerInRangeOfPoint(i, 5, pposx, pposy, pposz)) //If they are near the cop's position
            {
                if(GetPlayerWantedLevel(i) > 0) //If the player is wanted/a criminal
                {
                    if(!IsPlayerInAnyVehicle(i)) //If they are not in a vehicle
                    {
                        //Arrest player
                        break;
                    }
                }
            }
        }
    }
    return 1;
}
This is an example code, you must replace IsPlayerCop etc. with your own variables.
Reply
#3

Thanks
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)