Arrest Command.
#1

How to make /arrest [id] for police ?

But please Give me a tutorial don't give me the command and YES i tried to search on ******

So give me tutorial explained and all.

Thanks.
Reply
#2

Sorry i meant /arrest [id] or [name] or both {i didn't edit cause i have a problem}
Reply
#3

No one ?
Reply
#4

Please stop bumping your thread.

Anyways,

pawn Код:
CMD:ar(playerid,params[]) // We are using ZCMD by Zeex
{
    new string[128];
    new ID;
    if(sscanf(params, "u", ID)) // We are using sscanf so we define the command format usage
    {
        SendClientMessage(playerid,-1,"USAGE: /ar (Player Name/ID)");
        return 1;
    }
    if(!IsPlayerConnected(ID)) // If the player is not connected, '!' refers to not
    {
        format(string,sizeof(string),"The player ID %d is not connected to the server. You cannot arrest them.",ID);
        SendClientMessage(playerid,-1,string);
        return 1;
    }
    if(GetDistanceBetweenPlayers(playerid,ID) > 4) // If the player distance between the id which he want to cuff is more than four
    {
        format(string,sizeof(string),"%s(%d) is too far away. You cannot reach him to arrest him.",PlayerName(ID),ID);
        SendClientMessage(playerid,-1,string);
        return 1;
    }
    if(playerid == ID) // If the id which he typed is the same as his id
    {
        SendClientMessage(playerid,-1,"You cannot arrest yourself, why would you do that anyway?");
        return 1;
    }
    if(GetDistanceBetweenPlayers(playerid,ID) <= 4) // If the player is near from the police
    {
        // Sends a message to the player that he is arrested
        SendClientMessage(ID,-1,"[[_Arrested_]]");
        // Reseting player weapon so he wont shoot people while in jail
        ResetPlayerWeapons(ID);
    }
    return 1;
}
I explained in the code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)