I need arrest command
#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


Messages In This Thread
I need arrest command - by Hugoca - 28.12.2012, 07:51
Re: I need arrest command - by Threshold - 28.12.2012, 08:36
Re: I need arrest command - by Hugoca - 28.12.2012, 09:18

Forum Jump:


Users browsing this thread: 2 Guest(s)