Guest User

Untitled

a guest
Jul 22nd, 2014
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.59 KB | None | 0 0
  1. if(dialogid == DIALOG_CDLOCKMENU)
  2. {
  3. new idx = PlayerInfo[playerid][InBusiness];
  4. if(response) {
  5. if(GetPVarInt(playerid, "lockmenu") == 1) {
  6. new pvid;
  7. if(IsNumeric(inputtext)) {
  8. pvid = strval(inputtext)-1;
  9. if(PlayerVehicleInfo[playerid][pvid][pvId] == INVALID_PLAYER_VEHICLE_ID)
  10. {
  11. SendClientMessage(playerid, COLOR_GRAD4, "ERROR: You don't have a vehicle in this slot.");
  12. SetPVarInt(playerid, "lockmenu", 0);
  13. return 1;
  14. }
  15. if(PlayerVehicleInfo[playerid][pvid][pvLock] == 1)
  16. {
  17. SendClientMessage(playerid, COLOR_GRAD4, "ERROR: You already have this item installed on this vehicle.");
  18. SetPVarInt(playerid, "lockmenu", 0);
  19. return 1;
  20. }
  21. format(string, sizeof(string), " You have purchased an alarm lock!");
  22. SendClientMessage(playerid, COLOR_GRAD4, string);
  23. SendClientMessage(playerid, COLOR_YELLOW, "HINT: You can now use /pvlock to lock your car.");
  24. PlayerInfo[playerid][pCash] -= BizInfo[PlayerInfo[playerid][InBusiness]][bProductsPrice11];
  25. BizInfo[idx][bMoney] += BizInfo[PlayerInfo[playerid][InBusiness]][bProductsPrice11];
  26. BizInfo[idx][bSupplies] --;
  27. PlayerVehicleInfo[playerid][pvid][pvLock] = 1;
  28. SetPVarInt(playerid, "lockmenu", 0);
  29. }
  30. }
  31. else if(GetPVarInt(playerid, "lockmenu") == 2)
  32. {
  33. new pvid;
  34. if(IsNumeric(inputtext))
  35. {
  36. pvid = strval(inputtext)-1;
  37. if(PlayerVehicleInfo[playerid][pvid][pvId] == INVALID_PLAYER_VEHICLE_ID)
  38. {
  39. SendClientMessage(playerid, COLOR_GRAD4, "ERROR: You don't have a vehicle in this slot.");
  40. SetPVarInt(playerid, "lockmenu", 0);
  41. return 1;
  42. }
  43. if(PlayerVehicleInfo[playerid][pvid][pvLock] == 2)
  44. {
  45. SendClientMessage(playerid, COLOR_GRAD4, "ERROR: You already have this item installed on this vehicle.");
  46. SetPVarInt(playerid, "lockmenu", 0);
  47. return 1;
  48. }
  49. format(string, sizeof(string), " You have Purchased an industrial lock!");
  50. SendClientMessage(playerid, COLOR_GRAD4, string);
  51. SendClientMessage(playerid, COLOR_YELLOW, "HINT: You can now use /pvlock to lock your car.");
  52. PlayerInfo[playerid][pCash] -= BizInfo[PlayerInfo[playerid][InBusiness]][bProductsPrice12];
  53. BizInfo[idx][bMoney] += BizInfo[PlayerInfo[playerid][InBusiness]][bProductsPrice12];
  54. BizInfo[idx][bSupplies] --;
  55. PlayerVehicleInfo[playerid][pvid][pvLock] = 2;
  56. SetPVarInt(playerid, "lockmenu", 0);
  57. }
  58. }
  59. }
  60. }
  61. //--------------------------------------------//
  62. if(dialogid == DIALOG_ELOCK1)
  63. {
  64. if(GetPVarInt(playerid, "lockmenu") == 4)
  65. {
  66. new pvid;
  67. if (IsNumeric(inputtext))
  68. {
  69. pvid = strval(inputtext)-1;
  70. if(PlayerVehicleInfo[playerid][pvid][pvId] == INVALID_PLAYER_VEHICLE_ID)
  71. {
  72. SendClientMessageEx(playerid, COLOR_GRAD4, "ERROR: You don't have a vehicle in this slot.");
  73. SetPVarInt(playerid, "lockmenu", 0);
  74. return 1;
  75. }
  76. if(PlayerVehicleInfo[playerid][pvid][pvLock] == 3)
  77. {
  78. SendClientMessageEx(playerid, COLOR_GRAD4, "ERROR: You already have this item installed on this vehicle.");
  79. SetPVarInt(playerid, "lockmenu", 0);
  80. return 1;
  81. }
  82. new String[128];
  83. format(string, sizeof(string), " You have successfuly install an electric shock lock!");
  84. SendClientMessageEx(playerid, COLOR_GRAD4, string);
  85. SendClientMessageEx(playerid, COLOR_YELLOW, "HINT: You can now use /pvlock to lock your car.");
  86. PlayerVehicleInfo[playerid][pvid][pvLock] = 3;
  87. SetPVarInt(playerid, "lockmenu", 0);
  88. format(String, sizeof(String), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) has successfuly installed the Electrict Shock Lock to their Vehicle", GetPlayerNameEx(playerid), playerid);
  89. ABroadCast(COLOR_YELLOW, String, 2);
  90. }
  91. }
  92. }
  93. //--------------------------------------------------------//
  94. }
  95. else if(PlayerVehicleInfo[i][v][pvLocked] == 1 && PlayerVehicleInfo[i][v][pvLock] == 1) {
  96. GetVehicleParamsEx(newcar,engine,lights,alarm,doors,bonnet,boot,objective);
  97. SetVehicleParamsEx(newcar,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
  98. SetTimerEx("DisableVehicleAlarm", 20000, 0, "d", newcar);
  99. }
  100. else if(PlayerVehicleInfo[i][v][pvLocked] == 1 && PlayerVehicleInfo[i][v][pvLock] == 3) {
  101.  
  102. new
  103. string[49 + MAX_PLAYER_NAME];
  104.  
  105. if(AdminDuty[playerid] == 1)
  106. {
  107. format(string, sizeof(string), "* %s has been stunned by an electric shock lock ",GetPlayerNameEx(playerid));
  108. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  109. new Float:X, Float:Y, Float:Z, Float:HP;
  110. GetPlayerPos(playerid, X, Y, Z);
  111. //SendAudioToRange(64, 100, X, Y, Z, 20.0);
  112. SetPlayerPos(playerid, X + 1, Y, Z);
  113. RemovePlayerFromVehicle(playerid);
  114. SetPVarInt(playerid, "IsFrozen", 1);
  115. TogglePlayerControllable(playerid,0);
  116. SetTimerEx("ReleasePlayer", 10000, 0, "d", playerid);
  117. GameTextForPlayer(playerid,"~r~STUNNED!",11000,3);
  118. GetPlayerHealth(playerid,HP);
  119. SetPlayerHealth(playerid,HP-15);
  120. }
  121. else
  122. {
  123. format(string, sizeof(string), "Warning: This %s is owned by %s.", GetVehicleName(newcar), GetPlayerNameEx(i));
  124. SendClientMessage(playerid, COLOR_GREY, string);
  125. }
  126. }
  127. return 1;
  128. }
  129. }
Advertisement
Add Comment
Please, Sign In to add comment