Guest User

(un)cuff By For Cops and Robbers - by mgd

a guest
Jan 19th, 2013
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.87 KB | None | 0 0
  1. //made by mgd
  2. #include <a_samp>
  3. #include <zcmd>
  4. #include <sscanf>
  5. CMD:cuff(playerid, params[])
  6. {
  7.     new targetid;
  8.     if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "[USAGE]: /cuff [Part of Name/Player ID]");
  9.     if(IsPlayerConnected(targetid))
  10.         {
  11.             new Float:x, Float:y, Float:z;
  12.                GetPlayerPos(playerid, x, y, z);
  13.                if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
  14.                    {
  15.                     new str[512];
  16.                       new name[MAX_PLAYER_NAME];
  17.                     GetPlayerName(playerid, name, sizeof(name));
  18.                     new target[MAX_PLAYER_NAME];
  19.                        GetPlayerName(targetid, target, sizeof(target));
  20.                        format(str, sizeof(str), "INFO: You have cuffed %s!",target);
  21.                        SendClientMessage(playerid, 0xE01B1B, str);
  22.                        format(str, sizeof(str), "WARNING: You have been cuffed by %s!",name);
  23.                        SendClientMessage(targetid, 0xE01B1B, str);
  24.                     SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000);
  25.                       SetPlayerSpecialAction(targetid,SPECIAL_ACTION_CUFFED);
  26.                       return 1;
  27.                 }
  28.  
  29.         }
  30.     return 1;
  31. }
  32.  
  33. CMD:uncuff(playerid, params[])
  34. {
  35.  
  36.         new targetid;
  37.         if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "[USAGE]: /uncuff [Part of Name/Player ID]");
  38.         if(IsPlayerConnected(targetid))
  39.         {
  40.             new Float:x, Float:y, Float:z;
  41.                GetPlayerPos(playerid, x, y, z);
  42.                if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
  43.                    {
  44.                     if(!SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000))return SendClientMessage(playerid,-1,"ERROR: The player is not cuffed!");//this will check that if the player is not cuffed and you are trying to apply this cmd,this will send him a error message.
  45.                       SetPlayerSpecialAction(targetid,SPECIAL_ACTION_NONE);
  46.                     new str[512];
  47.                       new name[MAX_PLAYER_NAME];
  48.                     GetPlayerName(playerid, name, sizeof(name));
  49.                     new target[MAX_PLAYER_NAME];
  50.                        GetPlayerName(targetid, target, sizeof(target));
  51.                        format(str, sizeof(str), "INFO: You have uncuffed %s!",target);
  52.                        SendClientMessage(playerid, 0xE01B1B, str);
  53.                        format(str, sizeof(str), "WARNING: You have been uncuffed by %s!",name);
  54.                        SendClientMessage(targetid, 0xE01B1B, str);/
  55.                       return 1;
  56.                 }
  57.  
  58.         }
  59.         return 1;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment