Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.07 KB | None | 0 0
  1. CMD:tie(playerid, params[])
  2. {
  3. if(PlayerInfo[playerid][pRope] > 0)
  4. {
  5. new string[128], giveplayerid;
  6. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /tie [playerid]");
  7.  
  8. if(IsPlayerConnected(giveplayerid))
  9. {
  10. if(PlayerTied[giveplayerid] > 0)
  11. {
  12. SendClientMessageEx(playerid, COLOR_GREY, " Player already Tied!");
  13. return 1;
  14. }
  15. if(PlayerCuffed[giveplayerid] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can't tie a cuffed/tazed player.");
  16. if(PlayerInfo[giveplayerid][pJailed] >= 1)
  17. {
  18. SendClientMessageEx(playerid, COLOR_WHITE, "You can't tie a prisoned player.");
  19. return 1;
  20. }
  21. if(PlayerInfo[playerid][pRope] == 0)
  22. {
  23. SendClientMessageEx(playerid, COLOR_WHITE, "You don't have any rope left.");
  24. }
  25. else
  26. {
  27. if (ProxDetectorS(8.0, playerid, giveplayerid))
  28. {
  29. new car = GetPlayerVehicleID(playerid);
  30. if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot tie up yourself!"); return 1; }
  31. if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2 && IsPlayerInVehicle(giveplayerid, car))
  32. {
  33. if(PlayerCuffed[giveplayerid] == 1 || PlayerCuffed[giveplayerid] == 2) {
  34. SendClientMessageEx(playerid, COLOR_GRAD2, "You can't do this right now.");
  35. return 1;
  36. }
  37.  
  38. format(string, sizeof(string), "* You were tied up by %s, till untie.", GetPlayerNameEx(playerid));
  39. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  40. format(string, sizeof(string), "* You tied %s up, till untie.", GetPlayerNameEx(giveplayerid));
  41. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  42. format(string, sizeof(string), "* %s ties %s up, so he wont go anywhere.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  43. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  44. GameTextForPlayer(giveplayerid, "~r~Tied", 2500, 3);
  45. SetPVarInt(giveplayerid, "IsFrozen", 1);
  46. TogglePlayerControllable(giveplayerid, 0);
  47. PlayerTied[giveplayerid] = 1;
  48. PlayerInfo[playerid][pRope]--;
  49. }
  50. else
  51. {
  52. SendClientMessageEx(playerid, COLOR_GREY, " Player not in your Car, or you are not the Driver!");
  53. return 1;
  54. }
  55. }
  56. else
  57. {
  58. SendClientMessageEx(playerid, COLOR_GREY, "That player isn't near you.");
  59. return 1;
  60. }
  61. }
  62.  
  63. }
  64. else
  65. {
  66. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  67. return 1;
  68. }
  69. }
  70. else
  71. {
  72. SendClientMessageEx(playerid, COLOR_GREY, " You don't have a Rope!");
  73. }
  74. return 1;
  75. }
  76.  
  77. CMD:untie(playerid, params[])
  78. {
  79. new string[128], giveplayerid;
  80. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /untie [playerid]");
  81.  
  82. if(IsPlayerConnected(giveplayerid))
  83. {
  84. if (ProxDetectorS(8.0, playerid, giveplayerid))
  85. {
  86. if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot Untie yourself!"); return 1; }
  87. if(PlayerCuffed[giveplayerid] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can't untie a cuffed/tazed player.");
  88. if(PlayerTied[giveplayerid])
  89. {
  90. DeletePVar(giveplayerid, "IsFrozen");
  91. format(string, sizeof(string), "* You were untied by %s.", GetPlayerNameEx(playerid));
  92. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  93. format(string, sizeof(string), "* You untied %s.", GetPlayerNameEx(giveplayerid));
  94. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  95. GameTextForPlayer(giveplayerid, "~g~Untied", 2500, 3);
  96. TogglePlayerControllable(giveplayerid, 1);
  97. PlayerTied[giveplayerid] = 0;
  98. }
  99. else
  100. {
  101. SendClientMessageEx(playerid, COLOR_GREY, " That player isn't Tied up!");
  102. return 1;
  103. }
  104. }
  105. else
  106. {
  107. SendClientMessageEx(playerid, COLOR_GREY, "That player isn't near you.");
  108. return 1;
  109. }
  110. }
  111. else
  112. {
  113. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  114. return 1;
  115. }
  116. return 1;
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement