Advertisement
Guest User

Untitled

a guest
Oct 16th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.23 KB | None | 0 0
  1. CMD:duty(playerid, params[])
  2. {
  3. if(PinLogged[playerid] == 0)return SCM(playerid, COLOR_DARKNICERED,"{FFFFFF}{FFFFFF}Contul tau este {ff0000}blocat{ffffff}, foloseste {ff0000}/pin{ffffff} pentru a-l debloca..");
  4. if(IsPlayerConnected(playerid))
  5. {
  6. if(PlayerInfo[playerid][pGunLic] == 0) return SendClientMessage(playerid, COLOR_WHITE,"{FFB870}You don't have gun license.");
  7. new house = PlayerInfo[playerid][pPhousekey],string[200],sendername[MAX_PLAYER_NAME];
  8. GetPlayerName(playerid, sendername, sizeof(sendername));
  9. if(IsACop(playerid))
  10. {
  11. if(PlayerInfo[playerid][pLocal] == house || IsPlayerInRangeOfPoint(playerid, 150.0, 245.8297,112.4436,1003.2188) || IsPlayerInRangeOfPoint(playerid, 150.0, 236.3031,162.9478,1003.0300))
  12. {
  13. if(GetPlayerInterior(playerid) != 0)
  14. {
  15. if(OnDuty[playerid] == 0)
  16. {
  17. if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
  18. {
  19. format(string, sizeof(string), "* Officer %s took a Badge and a Gun from his locker.", sendername);
  20. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  21. GivePlayerWeaponEx(playerid, 24, 500);
  22. GivePlayerWeaponEx(playerid, 3, 1);
  23. GivePlayerWeaponEx(playerid, 41, 500);
  24. GivePlayerWeaponEx(playerid, 29, 1000);
  25. GivePlayerWeaponEx(playerid, 31, 1000);
  26. SetPlayerArmourEx(playerid, 100);
  27. SetPlayerHealthEx(playerid, 100);
  28. OnDuty[playerid] = 1;
  29. }
  30. if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
  31. {
  32. format(string, sizeof(string), "* Officer %s took a Badge and a Gun from his locker.", sendername);
  33. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  34. GivePlayerWeaponEx(playerid, 24, 500);
  35. GivePlayerWeaponEx(playerid, 3, 1);
  36. GivePlayerWeaponEx(playerid, 41, 500);
  37. GivePlayerWeaponEx(playerid, 29, 1000);
  38. GivePlayerWeaponEx(playerid, 31, 1000);
  39. SetPlayerArmourEx(playerid, 100);
  40. SetPlayerHealthEx(playerid, 100);
  41. OnDuty[playerid] = 1;
  42. }
  43. if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
  44. {
  45. format(string, sizeof(string), "* Officer %s took a Badge and a Gun from his locker.", sendername);
  46. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  47. GivePlayerWeaponEx(playerid, 24, 500);
  48. GivePlayerWeaponEx(playerid, 41, 500);
  49. GivePlayerWeaponEx(playerid, 29, 1000);
  50. GivePlayerWeaponEx(playerid, 31, 1000);
  51. SetPlayerArmourEx(playerid, 100);
  52. SetPlayerHealthEx(playerid, 100);
  53. OnDuty[playerid] = 1;
  54. }
  55. if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
  56. {
  57. format(string, sizeof(string), "* Officer %s took a Badge and a Gun from his locker.", sendername);
  58. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  59. GivePlayerWeaponEx(playerid, 24, 500);
  60. GivePlayerWeaponEx(playerid, 3, 1);
  61. GivePlayerWeaponEx(playerid, 41, 500);
  62. GivePlayerWeaponEx(playerid, 29, 1000);
  63. GivePlayerWeaponEx(playerid, 31, 1000);
  64. SetPlayerArmourEx(playerid, 100);
  65. SetPlayerHealthEx(playerid, 100);
  66. OnDuty[playerid] = 1;
  67. }
  68. }
  69. else if(OnDuty[playerid]==1)
  70. {
  71. format(string, sizeof(string), "* Officer %s places his Badge and Gun in his locker.", sendername);
  72. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  73. OnDuty[playerid] = 0;
  74. SetPlayerArmourEx(playerid, 0);
  75. ResetPlayerWeaponsEx(playerid);
  76. ResetPlayerWeapons(playerid);
  77. }
  78. }
  79. else
  80. {
  81. SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You are not in a locker room/your house.");
  82. return 1;
  83. }
  84. }
  85. else
  86. {
  87. SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You are not in a locker room/your house.");
  88. return 1;
  89. }
  90. }
  91. else if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLocal] == house)
  92. {
  93. if(IsPlayerInRangeOfPoint(playerid, 50.0, 1494.7902,1306.6029,1093.2947))
  94. {
  95. if(PlayerInfo[playerid][pMember] != 14) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a medic.");
  96. if(OnDutymedic[playerid] == 0)
  97. {
  98. format(string, sizeof(string), "* Medic %s took a Health Kit and a Fire Extinguisher from his locker.", sendername);
  99. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  100. GivePlayerWeaponEx(playerid, 42, 1000);
  101. OnDutymedic[playerid] = 1;
  102. }
  103. else if(OnDutymedic[playerid] > 0)
  104. {
  105. format(string, sizeof(string), "* Medic %s places his Health Kit and Fire Extinguisher in his locker.", sendername);
  106. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  107. OnDutymedic[playerid] = 0;
  108. }
  109. }
  110. }
  111. }
  112. return 1;
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement