/ar cmd
#2

top of the script:
pawn Код:
new pCuffed[MAX_PLAYERS];
pawn Код:
CMD:arrest(playerid, params[])
{
new targetid, time, string[128];
if(gTeam[playerid] != Cops) return SendClientMessage(playerid, -1, "   * You aren't a cop *");
if(sscanf(params, "ui", targetid, time)) return SendClientMessage(playerid, -1, "   * /arrest  Name/ID *");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xAFAFAFFF, "Invalid player id.");
if(!IsPlayerNearPlayer(playerid, targetid, 2)) return SendClientMessage(playerid, 0xAFAFAFFF, "You are too far away from that player.");
if(!pCuffed(playerid) == 1) return SendClientMessage(playerid, 0xAFAFAFFF, "Player Isn't Cuffed!");
format(str, sizeof(str), "   * You have arrested %s *",GetPlayerName(targetid));
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), "   * You have been arrested by %s *",GetPlayerName(playerid));
SendClientMessage(targetid, 0xE01B1B, str);
SetPlayerInterior(targetid, 0);
SetPlayerVirtualWorld(targetid, 0);
SetPlayerPos(targetid, 263.343597, 77.532028, 1001.039062);
RemovePlayerAttachedObject(playerb, 0);
SetTimer("Arrest", time, true);
SetPlayerSpecialAction(targetid, SPECIAL_ACTION_NONE);
return 1;
}
and here is the Stock
pawn Код:
stock IsPlayerNearPlayer(playerid, targetid, Float:radius)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(targetid, x, y, z);
    if(IsPlayerInRangeOfPoint(playerid, radius ,x, y, z))
    {
        return 1;
    }
    return 0;
}
Read it well and you will understand.

and the
pawn Код:
(sscanf(params, "r", targetid))
on the cuff command must be like that
pawn Код:
if(sscanf(params, "u", targetid))
add that in your cuff command
pawn Код:
pCuffed(playerid) == 1;
and in your uncuff command add this
pawn Код:
pCuffed(playerid) == 0;
Reply


Messages In This Thread
/ar cmd - by Sergeant - 26.03.2014, 17:24
Re: /ar cmd - by AhmedMohamed - 26.03.2014, 19:37
Re: /ar cmd - by AhmedMohamed - 26.03.2014, 19:46
Re: /ar cmd - by AhmedMohamed - 26.03.2014, 19:52
Re: /ar cmd - by Stinged - 26.03.2014, 20:30
Re: /ar cmd - by AhmedMohamed - 26.03.2014, 20:31
Re: /ar cmd - by AhmedMohamed - 26.03.2014, 20:38
Re: /ar cmd - by AhmedMohamed - 26.03.2014, 21:35
Re: /ar cmd - by Sergeant - 27.03.2014, 01:47
Re: /ar cmd - by RenovanZ - 27.03.2014, 01:50

Forum Jump:


Users browsing this thread: 1 Guest(s)