Advertisement
Guest User

Untitled

a guest
Jun 30th, 2020
1,536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.98 KB | None | 0 0
  1. // INCLUDES //
  2. /*
  3. Create by Janik22
  4. Date : 30.6.2020
  5. Time : 8:35
  6. Dont remove credits
  7. */
  8. #include a_samp
  9. #include sscanf
  10. #include zcmd
  11. #pragma tabsize 0
  12.  
  13. // NEWS
  14.  
  15. new aukce_weapon[150];
  16. new aukce_ammo[150];
  17. new aukce_cena[150];
  18. new aukce_kupuj[150];
  19. new aukce_prodej[150];
  20. new bool:aukce_bezi[150] = false;
  21. //==============================================================================
  22.  
  23. new WeaponNames[][28] =
  24. {
  25. {"Nic"},
  26. {"Boxér"},
  27. {"Golfová hůl"},
  28. {"Obušek"},
  29. {"Nůž"},
  30. {"Baseballka"},
  31. {"Lopata"},
  32. {"Tágo"},
  33. {"Katana"},
  34. {"Motorová pila"},
  35. {"Dildo"},
  36. {"Dildo"},
  37. {"Vibrator"},
  38. {"Vibrator"},
  39. {"Květiny"},
  40. {"Hůl"},
  41. {"Granát"},
  42. {"Slzný plyn"},
  43. {"Molotov"},
  44. {" "},
  45. {" "},
  46. {" "},
  47. {"Colt 45"},
  48. {"Silenced 9 mm"},
  49. {"Desert Eagle"},
  50. {"Brokovnice"},
  51. {"Sawn-off-Shotgun"},
  52. {"Combat Shotgun"},
  53. {"Micro Uzi (Mac 10) "},
  54. {"MP5"},
  55. {"AK47"},
  56. {"M4"},
  57. {"Tec9"},
  58. {"Puska"},
  59. {"Sniperka"},
  60. {"RPG"},
  61. {"RPG"},
  62. {"flamethrower"},
  63. {"Minigun"},
  64. {"C4 trhavina"},
  65. {"Detonator"},
  66. {"Sprey"},
  67. {"Hasicak"},
  68. {"Fotoaparat"},
  69. {"Night vision"},
  70. {"Infrared vision"},
  71. {"parachute"},
  72. {" "}
  73. };
  74.  
  75. public OnFilterScriptInit()
  76. {
  77. AntiDeAMX();
  78. return 1;
  79. }
  80. forward Aukce(playerid, cena);
  81.  
  82. CMD:auction(playerid, params[])
  83. {
  84. new string[128];
  85.  
  86. new cena,weapon,amm;
  87.  
  88. if (sscanf(params, "ddd", cena,weapon,amm)) return SendClientMessage(playerid, -1, "{ff0000}[ SERVER ]{ffffff} [ ! ]" " /auction [price] [id-weapon] [ammo]");
  89. if (weapon > 46) return SendClientMessage(playerid, 0xFF0000AA, "{ff0000}[ SERVER ]{ffffff} Špatně zadané ID zbraně!");
  90. if (weapon == 38 || weapon == 0 || weapon == 19 || weapon == 18 || weapon == 20) return SendClientMessage(playerid, -1, "{ff0000}[ SERVER ]{ffffff} This weapon cannot be auctioned!");
  91. if (weapon != GetPlayerWeapon(playerid)) return SendClientMessage(playerid,-1, "{ff0000}[ SERVER ]{ffffff} You don't have this weapon!");
  92. if (amm > GetPlayerAmmo(playerid)) return SendClientMessage(playerid, -1, "{ff0000}[ SERVER ]{ffffff} you dont have ammo!");
  93. if(aukce_bezi[playerid] == true) return SendClientMessage(playerid, 0xFF0000AA, "{ff0000}[ SERVER ]{ffffff} Only 1 auction per player is allowed!");
  94.  
  95. aukce_weapon[playerid] = weapon;
  96. aukce_ammo[playerid] = amm;
  97. aukce_cena[playerid] = cena;
  98.  
  99. aukce_bezi[playerid] = true;
  100. aukce_prodej[playerid] = playerid;
  101.  
  102. format(string, sizeof string, "{00ff00}[ Auction ] Player {4169e1}%s(%d){00ff00} auctioning a weapon {4169e1}%s(%d){00ff00} Ammo, price {4169e1}$%d", Jmeno(playerid),playerid,WeaponName(weapon), amm, cena);
  103. SendClientMessageToAll(-1, string);
  104. SendClientMessageToAll(-1, "{00ff00}[ Auction ] You throw in the higher part {4169e1}/bid");
  105. SetTimerEx("Aukce", 60000, false, "ud", playerid, cena);
  106.  
  107. return 1;
  108. }
  109. CMD:credits(playerid)
  110. {
  111. new DIALOG_CREDITS[2690];
  112. //--------------------------------------------------------------------------
  113. strcat(DIALOG_CREDITS, "{FFFFFF}[ {0000FF}Credits {FFFFFF}]:\n");
  114. strcat(DIALOG_CREDITS, "{ff1493}• {ffffff}Auction system create by Janik22: {00FF00}/credits\n");
  115. strcat(DIALOG_CREDITS, "{ff1493}• {FFFFFF}Please dont remove credits /credits\n");
  116. strcat(DIALOG_CREDITS, "{ff1493}• {FFFFFF}Create by Slovakia boss /credits\n");
  117. ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Credits (30.6.2020)(08:35)", DIALOG_CREDITS, "cancel", "");
  118. return 1;
  119. }
  120. CMD:bid(playerid, params[])
  121. {
  122. new ID, cena;
  123. if(sscanf(params, "dd", ID, cena)) return SendClientMessage(playerid, 1, "{ff0000}[ SERVER ]{ffffff} [ ! ]" " /bid [id-player] [amount]");
  124. if(strval(params) > GetPlayerMoney(playerid)) return SendClientMessage(playerid, 1, "{ff0000}[ SERVER ]{ffffff} You don't have enough money!");
  125. if(aukce_bezi[ID] == false) return SendClientMessage(playerid, -1, "{ff0000}[ SERVER ]{ffffff} This player is not expensive!");
  126. if(aukce_prodej[ID] == playerid) return SendClientMessage(playerid, -1, "{ff0000}[ SERVER ]{ffffff} It is not possible to bid on your auction!");
  127.  
  128. if(aukce_cena[ID] < cena)
  129. {
  130. aukce_cena[ID] = cena;
  131. aukce_kupuj[ID] = playerid;
  132.  
  133. new string[128];
  134. format(string, sizeof string, "{00ff00}[ Auction ] Hráč {4169e1}%s(%d) {00ff00}has bidden {4169e1}%d${00ff00} at the player's auction {4169e1}%s {00ff00}about a gun {4169e1}%s", Jmeno(playerid),playerid, cena, Jmeno(ID), WeaponName(aukce_weapon[ID]));
  135. SendClientMessageToAll(-1, string);
  136. }
  137. else
  138. {
  139. new string[128];
  140. format(string, sizeof string, "{ff0000}Your amount cannot be less than {ffffff}%d", aukce_cena[ID]);
  141. SendClientMessage(playerid, -1, string);
  142. }
  143.  
  144. return 1;
  145. }
  146.  
  147. public Aukce(playerid, cena)
  148. {
  149. if(aukce_bezi[playerid] == true)
  150. {
  151. if(aukce_cena[playerid] > cena)
  152. {
  153. GivePlayerWeapon(aukce_kupuj[playerid], aukce_weapon[playerid], aukce_ammo[playerid]);
  154. GivePlayerWeapon(playerid, -aukce_weapon[playerid], -aukce_ammo[playerid]);
  155.  
  156. GivePlayerMoney(aukce_kupuj[playerid], -aukce_cena[playerid]);
  157. GivePlayerMoney(playerid, aukce_cena[playerid]);
  158.  
  159. new string[128];
  160. format(string, sizeof string, "{00ff00}[ Auction ] Player {4169e1}%s(%d) {00ff00}won the player's auction {4169e1}%s {00ff00}for {4169e1}%d$ {00ff00}about a gun {4169e1}%s", Jmeno(aukce_kupuj[playerid]),playerid, Jmeno(playerid), aukce_cena[playerid], WeaponName(aukce_weapon[playerid]));
  161. SendClientMessageToAll(-1, string);
  162.  
  163. }
  164. else
  165. {
  166. new string[128];
  167. format(string, sizeof string, "{00ff00}[ Auction ] No one has bid on a player {4169e1}%s(%d)", Jmeno(playerid),playerid);
  168. SendClientMessageToAll(-1, string);
  169. }
  170. }
  171.  
  172. aukce_weapon[playerid] = -1;
  173. aukce_ammo[playerid] = -1;
  174. aukce_bezi[playerid] = false;
  175. aukce_prodej[playerid] = -1;
  176. aukce_kupuj[playerid] = -1;
  177. aukce_cena[playerid] = -1;
  178. }
  179.  
  180. Jmeno(playerid)
  181. {
  182. new n[24];
  183. GetPlayerName(playerid, n, sizeof n);
  184. return n;
  185. }
  186.  
  187. WeaponName(weaponid)
  188. {
  189. return WeaponNames[weaponid];
  190. }
  191. AntiDeAMX()
  192. {
  193. new a[][] =
  194. {
  195. "Unarmed (Fist)",
  196. "Brass K"
  197. };
  198. #pragma unused a
  199. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement