Guest User

Hazze - SIMPLE VIP SYSTEM V2

a guest
Apr 13th, 2019
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.94 KB | None | 0 0
  1. #include "a_samp"
  2. #include "Pawn.CMD"
  3. #include "sscanf2"
  4.  
  5. main()
  6. {
  7. print("Hazze");
  8. }
  9.  
  10. enum vipInfo
  11. {
  12. VIPBodovi
  13. }
  14. new vip_Info[MAX_PLAYERS][vipInfo];
  15.  
  16. new game_string[128];
  17.  
  18. CMD:setvip(playerid, const params[])
  19. {
  20. if(!IsPlayerAdmin(playerid))
  21. return SendClientMessage(playerid, -1, "Niste ulogovani kao RCON administrator.");
  22.  
  23. extract params -> new id, bodovi; else
  24. {
  25. return SendClientMessage(playerid, -1, "/setvip (id/ime_prezime) (bodovi)");
  26. }
  27.  
  28. if(!IsPlayerConnected(id))
  29. return SendClientMessage(playerid, -1, "Igrac nije konektovan.");
  30.  
  31. if(bodovi < 0 || bodovi >= 1000)
  32. return SendClientMessage(playerid, -1, "Bodovi ne mogu ici u minus i preko 1000");
  33.  
  34. vip_Info[id][VIPBodovi] = bodovi;
  35.  
  36. if(bodovi == 0)
  37. {
  38. SendClientMessage(id, -1, "Postavljeni su vam VIP bodovi na nulu. Ukoliko mislite da je ovo greskom ucinjeno javite se adminu.");
  39. }
  40. else
  41. {
  42. format(game_string, sizeof(game_string), "Postavljeni su vam VIP bodovi na %i, od admina %s(%i)", bodovi, GetName(playerid), playerid);
  43. SendClientMessage(id, -1, game_string);
  44. game_string[0] = EOS;
  45. format(game_string, sizeof(game_string), "Postavili ste igracu %s(%i) VIP bodove na %i", GetName(id), id, bodovi);
  46. SendClientMessage(playerid, -1, game_string);
  47. game_string[0] = EOS;
  48. }
  49. return true;
  50. }
  51.  
  52. CMD:fixveh(playerid, const params[])
  53. {
  54. if(vip_Info[playerid][VIPBodovi] <= 0)
  55. return SendClientMessage(playerid, -1, "Nemate VIP bodova.");
  56.  
  57. extract params -> new heltivozila; else
  58. {
  59. return SendClientMessage(playerid, -1, "/fixveh (helti vozila");
  60. }
  61.  
  62. if(heltivozila < 600 || heltivozila >= 1000)
  63. return SendClientMessage(playerid, -1, "Helte vozila ne mozete namjestiti ispod 600 ili preko 1000.");
  64.  
  65. new vehicleid = GetPlayerVehicleID(playerid);
  66.  
  67. new Float:health = GetVehicleHealth(vehicleid, health);
  68.  
  69. if(health >= 400.1)
  70. return SendClientMessage(playerid, -1, "Ne mozete popraviti vozilo jer vase vozilo ima preko 400 helti.");
  71.  
  72. SetVehicleHealth(vehicleid, heltivozila);
  73.  
  74. format(game_string, sizeof(game_string), "Postavili ste helte vozila na %i.", heltivozila);
  75. SendClientMessage(playerid, -1, game_string);
  76. game_string[0] = EOS;
  77.  
  78. vip_Info[playerid][VIPBodovi] --;
  79.  
  80. format(game_string, sizeof(game_string), "Trenutni VIP bodovi %i", vip_Info[playerid][VIPBodovi]);
  81. SendClientMessage(playerid, -1, game_string);
  82. game_string[0] = EOS;
  83. return true;
  84. }
  85.  
  86. CMD:mycc(playerid, const params[])
  87. {
  88. if(vip_Info[playerid][VIPBodovi] <= 0)
  89. return SendClientMessage(playerid, -1, "Nemate VIP bodova.");
  90.  
  91. ClearPlayerChat(playerid);
  92.  
  93. SendClientMessage(playerid, -1, "Ocistili ste sebi chat.");
  94.  
  95. vip_Info[playerid][VIPBodovi] --;
  96.  
  97. format(game_string, sizeof(game_string), "Trenutni VIP bodovi %i", vip_Info[playerid][VIPBodovi]);
  98. SendClientMessage(playerid, -1, game_string);
  99. game_string[0] = EOS;
  100. return true;
  101. }
  102.  
  103. CMD:myip(playerid, const params[])
  104. {
  105. if(vip_Info[playerid][VIPBodovi] <= 0)
  106. return SendClientMessage(playerid, -1, "Nemate VIP bodova.");
  107.  
  108. new plrIP[16];
  109. GetPlayerIp(playerid, plrIP, sizeof(plrIP));
  110.  
  111. format(game_string, sizeof(plrIP), "Vasa trenutna IP adresa je %s", plrIP);
  112. SendClientMessage(playerid, -1, game_string);
  113. game_string[0] = EOS;
  114.  
  115. vip_Info[playerid][VIPBodovi] --;
  116.  
  117. format(game_string, sizeof(game_string), "Trenutni VIP bodovi %i", vip_Info[playerid][VIPBodovi]);
  118. SendClientMessage(playerid, -1, game_string);
  119. game_string[0] = EOS;
  120. return true;
  121. }
  122.  
  123. CMD:setfightingstyle(playerid, const params[])
  124. {
  125. if(vip_Info[playerid][VIPBodovi] <= 0)
  126. return SendClientMessage(playerid, -1, "Nemate VIP bodova.");
  127.  
  128. extract params -> new stilborenja; else
  129. {
  130. return SendClientMessage(playerid, -1, "/setfightingstyle (4 - normalan, 5 - box, 6 - kung fu, 7 - kneehead, 15 - grabkick, 16 - elbow)");
  131. }
  132.  
  133. if(stilborenja == 4)
  134. {
  135. SendClientMessage(playerid, -1, "Odabrali ste normalan nacin borenja.");
  136. SetPlayerFightingStyle (playerid, FIGHT_STYLE_NORMAL);
  137. }
  138.  
  139. else if(stilborenja == 5)
  140. {
  141. SendClientMessage(playerid, -1, "Odabrali ste box nacin borenja.");
  142. SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
  143. }
  144.  
  145. else if(stilborenja == 6)
  146. {
  147. SendClientMessage(playerid, -1, "Odabrali ste kung fu nacin borenja.");
  148. SetPlayerFightingStyle (playerid, FIGHT_STYLE_KUNGFU);
  149. }
  150.  
  151. else if(stilborenja == 7)
  152. {
  153. SendClientMessage(playerid, -1, "Odabrali ste koljeno u glavu(kneehead) nacin borenja.");
  154. SetPlayerFightingStyle (playerid, FIGHT_STYLE_KNEEHEAD);
  155. }
  156.  
  157. else if(stilborenja == 15)
  158. {
  159. SendClientMessage(playerid, -1, "Odabrali ste uhvatanje i udaranje(grabkick) nacin borenja.");
  160. SetPlayerFightingStyle (playerid, FIGHT_STYLE_GRABKICK);
  161. }
  162.  
  163. else if(stilborenja == 16)
  164. {
  165. SendClientMessage(playerid, -1, "Odabrali ste elbow nacin borenja.");
  166. SetPlayerFightingStyle (playerid, FIGHT_STYLE_ELBOW);
  167. }
  168.  
  169. else SendClientMessage(playerid, -1, "Error");
  170.  
  171. vip_Info[playerid][VIPBodovi] --;
  172. format(game_string, sizeof(game_string), "Trenutni VIP bodovi %i", vip_Info[playerid][VIPBodovi]);
  173. SendClientMessage(playerid, -1, game_string);
  174. game_string[0] = EOS;
  175. return true;
  176. }
  177.  
  178. CMD:viphelp(playerid, const params[])
  179. {
  180. ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "VIP KOMANDE", "/fixveh (helti vozila) - popravkak vozila\n/mycc - ciscenje chata\n/myip - provjera Vase trenutne IP adres\n/setfightingstyle - nacin borenja\n/viphelp - pomoc oko komandi", "Zatvori", "");
  181. return true;
  182. }
  183.  
  184. GetName(playerid)
  185. {
  186. static name[MAX_PLAYER_NAME];
  187. GetPlayerName(playerid, name, sizeof(name));
  188. return name;
  189. }
  190.  
  191. ClearPlayerChat(playerid)
  192. {
  193. for(new i = 0; i != 32; i++) SendClientMessage(playerid, 0xFFFFFFFF, " ");
  194. return true;
  195. }
Advertisement
Add Comment
Please, Sign In to add comment