#3

Quote:
Originally Posted by MrCallum
Посмотреть сообщение
new IsPlayerPolice;

+Rep if i helped!
Don't ask for rep.

pawn Код:
new IsPlayerPolice[MAX_PLAYERS];
and delete your current command and put this:
pawn Код:
CMD:cuff(playerid,params[])
{
  new targetid;
  if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "USAGE: /cuff [Part of Name/Player ID]");
  if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFF,"{ff0000}ERROR: That Player Is Not Connected!");
  if(playerid == 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can't cuff yourself!");
  if(!IsPlayerPolice[playerid])
    return SendClientMessage(playerid, -1, "{ff0000}ERROR: Only cops can use this command!");

       new Float:x, Float:y, Float:z;
       GetPlayerPos(playerid, x,y,z);
       if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
       {
        new str[512];
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name,sizeof(name));
        new target[MAX_PLAYER_NAME];
        GetPlayerName(targetid, target, sizeof(target));
        format(str, sizeof(str), "{ff0000}You cuffed %s!",target);
        SendClientMessage(playerid, 0xE01B1B, str);
        SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000);
        SetPlayerSpecialAction(targetid,SPECIAL_ACTION_CUFFED);
        return 1;
       }
  return 1;
}
this would work
also I think you should replace return 0; to return 1;
and when a player chooses cops team or something do this:
pawn Код:
IsPlayerPolice[playerid] = 1;
Reply


Messages In This Thread
Cuff - by YanLanger - 22.09.2014, 15:57
Re: Cuff - by MrCallum - 22.09.2014, 15:59
Re: Cuff - by Eth - 22.09.2014, 16:02
Re: Cuff - by YanLanger - 22.09.2014, 16:04
Re: Cuff - by Eth - 22.09.2014, 16:07
Re: Cuff - by YanLanger - 22.09.2014, 16:09
Re: Cuff - by Eth - 22.09.2014, 16:10
Re: Cuff - by YanLanger - 22.09.2014, 16:11
Re: Cuff - by Eth - 22.09.2014, 16:12
Re: Cuff - by YanLanger - 22.09.2014, 16:14

Forum Jump:


Users browsing this thread: 1 Guest(s)