Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.18 KB | None | 0 0
  1. #include <a_samp>
  2. #include <sscanf2>
  3. #include <zcmd>
  4.  
  5. #define START_CASH 1000
  6. #define DIALOG_RULES 1
  7. #define DIALOG_PASSWORD 2
  8. #define DIALOG_DESC 3
  9. #define DIALOG_GUN 4
  10. main() {}
  11.  
  12. public OnGameModeInit()
  13. {
  14. for(new i = 0; i < 312; i++)
  15. {
  16. AddPlayerClass(i,1707.1323,-1949.5258,14.1172,270.5076,0,0,0,0,0,0);
  17. }
  18. return 1;
  19. }
  20.  
  21. public OnPlayerDeath(playerid, killerid, reason)
  22. {
  23. SendDeathMessage(killerid, playerid, reason);
  24. return 1;
  25. }
  26.  
  27. public OnPlayerRequestClass(playerid, classid)
  28. {
  29. SetPlayerPos(playerid, 1707.1323,-1949.5258,14.1172);
  30. SetPlayerCameraPos(playerid, 1723.8694,-1949.2831,14.1172);
  31. SetPlayerCameraLookAt(playerid, 1707.1323,-1949.5258,16.1172);
  32. return 1;
  33. }
  34.  
  35. public OnPlayerSpawn(playerid)
  36. {
  37. new name[24];
  38. GetPlayerName(playerid, name, sizeof(name));
  39.  
  40. GivePlayerMoney(playerid, START_CASH);
  41.  
  42. new string[128];
  43.  
  44. format(string, sizeof(string), "Witaj {C0C0C0}%s{FFFFFF} na naszym serwerze. Zyczymy milej gry!", name);
  45. SendClientMessage(playerid, 0xFFFFFFFF, string);
  46. format(string, sizeof(string), "Potrzebujesz pomocy? Wpisz /pomoc", name);
  47. SendClientMessage(playerid, 0xFFFFFFFF, string);
  48.  
  49. return 1;
  50. }
  51.  
  52. /*
  53. public OnPlayerCommandText(playerid, cmdtext[])
  54. {
  55. // /hp 0 100
  56. new cmd[32], params[128];
  57. sscanf(cmdtext, "s[32]s[128]", cmd, params);
  58.  
  59. if(strcmp(cmd, "/hp", true) == 0)
  60. {
  61. new give_playerid,
  62. Float:hp;
  63.  
  64. sscanf(params, "df", give_playerid, hp);
  65.  
  66. if(IsPlayerConnected(give_playerid))
  67. {
  68. SetPlayerHealth(give_playerid, hp);
  69. SendClientMessage(give_playerid, 0xFFFFFFFF, "Zostales uleczony!");
  70. } else {
  71. SendClientMessage(playerid, 0xFFFFFFFF, "Nie ma takiego gracza on-line!");
  72. }
  73. return 1;
  74. }
  75.  
  76. return 1;
  77.  
  78. }
  79. */
  80.  
  81. CMD:hp(playerid, params[])
  82. {
  83. new give_playerid,
  84. Float:hp;
  85.  
  86. if(sscanf(params, "df", give_playerid, hp))
  87. {
  88. SendClientMessage(playerid, 0x808080FF, "Uzycie komendy: /hp [id gracza] [ilosc hp]");
  89. return 1;
  90. }
  91.  
  92. if(!IsPlayerConnected(give_playerid))
  93. {
  94. SendClientMessage(playerid, 0xFFFFFFFF, "Gracz o podanym ID nie istnieje!");
  95. return 1;
  96. }
  97.  
  98. if(hp < 0 || hp > 100)
  99. {
  100. SendClientMessage(playerid, 0xFFFFFFFF, "HP musi znajdowac sie pomiedzy wartoscia 0 - 100.");
  101. return 1;
  102. }
  103.  
  104. SetPlayerHealth(give_playerid, hp);
  105. SendClientMessage(give_playerid, 0xFFFFFFFF, "Otrzymales zdrowie!");
  106.  
  107. SendClientMessage(playerid, 0xFFFFFFFF, "HP zostalo poprawnie nadane!");
  108.  
  109. return 1;
  110.  
  111. }
  112.  
  113. CMD:100hp(playerid, params[])
  114. {
  115. new string[16];
  116. format(string, sizeof(string), "%d %d", playerid, 100);
  117.  
  118. cmd_hp(playerid, string);
  119. return 1;
  120. }
  121.  
  122. CMD:regulamin(playerid, params[])
  123. {
  124. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Regulamin serwera", "Jakis tekst", "Tak", "Nie");
  125. return 1;
  126. }
  127.  
  128. CMD:opis(playerid, params[])
  129. {
  130. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Ustawienia > Opis", "Ustaw swoj opis:", "OK", "Anuluj");
  131. return 1;
  132. }
  133.  
  134. CMD:bronie(playerid, params[])
  135. {
  136. ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Wybierz swoja bron:", "1. AK-47\n2. M4A1\n3. Desert Eagle", "OK", "Anuluj");
  137. return 1;
  138. }
  139.  
  140. CMD:rejestracja(playerid, params[])
  141. {
  142. ShowPlayerDialog(playerid, 4, DIALOG_STYLE_PASSWORD, "Zarejestruj sie", "Podal haslo:", "OK", "Wyjdz");
  143. return 1;
  144. }
  145.  
  146. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  147. {
  148. if(dialogid == DIALOG_RULES)
  149. {
  150. SendClientMessage(playerid, 0x009000FF, "Akceptujesz regulamin.");
  151. return 1;
  152. } else {
  153. SendClientMessage(playerid, 0xFF0000FF, "Nie akceptujesz regulaminu.");
  154. return 1;
  155. }
  156. }
  157. else if(dialogid == DIALOG_PASSWORD)
  158. {
  159. new string[64];
  160. format(string, sizeof(string), "ID %d wpisal haslo %s", playerid, inputtext);
  161. SendClientMessage(playerid, 0xFFFFFFFF, string);
  162. return 1;
  163. }
  164. else if(dialogid == DIALOG_GUN)
  165. {
  166. switch(listitem)
  167. {
  168. case 0: GivePlayerWeapon(playerid, WEAPON_AK47, 1000);
  169. case 1: GivePlayerWeapon(playerid, WEAPON_M4, 1000);
  170. case 2: GivePlayerWeapon(playerid, WEAPON_DEAGLE, 1000);
  171.  
  172. return 1;
  173. }
  174. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement