hlmod.hu
https://hlmod.hu/

gnmenü
https://hlmod.hu/viewtopic.php?f=9&t=6029
Oldal: 1 / 2

Szerző:  ChaspeR [2012.09.20. 16:14 ]
Hozzászólás témája:  gnmenü

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <hamsandwich>
  3. #include <cstrike>
  4. #include <fun>
  5. #include <colorchat>
  6.  
  7. #define PLUGIN "Fegyver Menu"
  8. #define VERSION "1.0"
  9. #define AUTHOR "Szemir"
  10.  
  11.  
  12. new awp = 0;
  13.  
  14. public plugin_init()
  15. {
  16. register_plugin(PLUGIN, VERSION, AUTHOR)
  17. RegisterHam(Ham_Spawn, "player", "JatekosEledes", true);
  18. }
  19.  
  20. public JatekosEledes(id)
  21. {
  22. if( is_user_alive(id) )
  23. {
  24. Fegyvermenu(id);
  25. }
  26. }
  27.  
  28. public Fegyvermenu(id)
  29. {
  30. new iMenu = menu_create("\yVálassz fegyvert:", "MainMenu_Handle");
  31.  
  32. menu_additem(iMenu, "\rM4A1 \yCsomag", "1");
  33. menu_additem(iMenu, "\rAK47 \yCsomag", "2");
  34. menu_additem(iMenu, "\rAWP \yCsomag \w(Első 4 embernek)", "3");
  35. menu_additem(iMenu, "\rScout \yCsomag", "4");
  36. menu_additem(iMenu, "\rKrieg \yCsomag", "5");
  37. menu_additem(iMenu, "\rFamas \yCsomag", "6");
  38. menu_additem(iMenu, "\rShoti \yCsomag", "7");
  39. menu_additem(iMenu, "\rAug \yCsomag", "8");
  40. menu_additem(iMenu, "\rSMG \yCsomag", "9");
  41. menu_additem(iMenu, "\rGalil \yCsomag", "10");
  42. menu_additem(iMenu, "\rMachineguns \yCsomag", "11");
  43.  
  44. menu_display(id, iMenu);
  45. }
  46.  
  47. public MainMenu_Handle(id, iMenu, iItem)
  48. {
  49. if( iItem == MENU_EXIT )
  50. {
  51. menu_destroy(iMenu);
  52. return PLUGIN_HANDLED;
  53. }
  54.  
  55. new iAccess, iCallback, szData[5];
  56. menu_item_getinfo(iMenu, iItem, iAccess, szData, charsmax(szData), _, _, iCallback);
  57.  
  58. switch( str_to_num(szData) )
  59. {
  60. case 1:
  61. {
  62.  
  63.  
  64.  
  65. give_item(id, "weapon_m4a1")
  66. give_item(id, "weapon_deagle")
  67. give_item(id, "weapon_smokegrenade")
  68. give_item(id, "weapon_hegrenade")
  69. give_item(id, "weapon_flashbang")
  70. cs_set_user_bpammo(id,CSW_M4A1,90)
  71. cs_set_user_bpammo(id,CSW_DEAGLE,35)
  72. client_print(id, print_chat, "* M4A1 Csomagot választottál !");
  73.  
  74.  
  75.  
  76.  
  77.  
  78. }
  79.  
  80. case 2:
  81. {
  82. give_item(id, "weapon_ak47")
  83. give_item(id, "weapon_deagle")
  84. give_item(id, "weapon_smokegrenade")
  85. give_item(id, "weapon_hegrenade")
  86. give_item(id, "weapon_flashbang")
  87. cs_set_user_bpammo(id,CSW_AK47,90)
  88. cs_set_user_bpammo(id,CSW_DEAGLE,35)
  89. client_print(id, print_chat, "* AK47 Csomagot választottál !");
  90. }
  91.  
  92. case 3:
  93. {
  94.  
  95.  
  96. if(awp < 4)
  97. {
  98. give_item(id, "weapon_awp")
  99. give_item(id, "weapon_deagle")
  100. give_item(id, "weapon_smokegrenade")
  101. give_item(id, "weapon_hegrenade")
  102. give_item(id, "weapon_flashbang")
  103. cs_set_user_bpammo(id,CSW_AWP,35)
  104. cs_set_user_bpammo(id,CSW_DEAGLE,35)
  105. client_print(id, print_chat, "* AWP Csomagot választottál !");
  106.  
  107. awp++
  108.  
  109. }
  110.  
  111.  
  112. else
  113. {
  114.  
  115.  
  116. ColorChat(id, GREEN, "[^x03Fegyvermenü^x04]^x03 Csak négy ember használhatja az awp -t!");
  117.  
  118.  
  119. Fegyvermenu(id);
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126. }
  127. }
  128.  
  129. case 4:
  130. {
  131. give_item(id, "weapon_scout")
  132. give_item(id, "weapon_deagle")
  133. give_item(id, "weapon_smokegrenade")
  134. give_item(id, "weapon_hegrenade")
  135. give_item(id, "weapon_flashbang")
  136. cs_set_user_bpammo(id,CSW_SCOUT,90)
  137. cs_set_user_bpammo(id,CSW_DEAGLE,35)
  138. client_print(id, print_chat, "* Scout Csomagot választottál !");
  139. }
  140.  
  141. case 5:
  142. {
  143. give_item(id, "weapon_sg550")
  144. give_item(id, "weapon_deagle")
  145. give_item(id, "weapon_smokegrenade")
  146. give_item(id, "weapon_hegrenade")
  147. give_item(id, "weapon_flashbang")
  148. cs_set_user_bpammo(id,CSW_SG550,90)
  149. cs_set_user_bpammo(id,CSW_DEAGLE,35)
  150. client_print(id, print_chat, "* Krieg Csomagot választottál !");
  151. }
  152.  
  153. case 6:
  154. {
  155. give_item(id, "weapon_famas")
  156. give_item(id, "weapon_deagle")
  157. cs_set_user_bpammo(id,CSW_FAMAS,90)
  158. cs_set_user_bpammo(id,CSW_DEAGLE,35)
  159. client_print(id, print_chat, "* Famas Csomagot választottál !");
  160. }
  161.  
  162. case 7:
  163. {
  164. give_item(id, "weapon_m3")
  165. give_item(id, "weapon_deagle")
  166. cs_set_user_bpammo(id,CSW_M3,32)
  167. cs_set_user_bpammo(id,CSW_DEAGLE,35)
  168. client_print(id, print_chat, "* Shoti Csomagot választottál !");
  169. }
  170.  
  171. case 8:
  172. {
  173. give_item(id, "weapon_aug")
  174. give_item(id, "weapon_deagle")
  175. cs_set_user_bpammo(id,CSW_AUG,90)
  176. cs_set_user_bpammo(id,CSW_DEAGLE,35)
  177. client_print(id, print_chat, "* Aug Csomagot választottál !");
  178. }
  179.  
  180. case 9:
  181. {
  182. give_item(id, "weapon_mp5navy")
  183. give_item(id, "weapon_deagle")
  184. cs_set_user_bpammo(id,CSW_MP5NAVY,120)
  185. cs_set_user_bpammo(id,CSW_DEAGLE,35)
  186. client_print(id, print_chat, "* SMG Csomagot választottál !");
  187. }
  188.  
  189. case 10:
  190. {
  191. give_item(id, "weapon_galil")
  192. give_item(id, "weapon_deagle")
  193. cs_set_user_bpammo(id,CSW_GALIL,90)
  194. cs_set_user_bpammo(id,CSW_DEAGLE,35)
  195. client_print(id, print_chat, "* Galil Csomagot választottál !");
  196. }
  197.  
  198. case 11:
  199. {
  200. give_item(id, "weapon_m249")
  201. give_item(id, "weapon_deagle")
  202. cs_set_user_bpammo(id,CSW_M249,200)
  203. cs_set_user_bpammo(id,CSW_DEAGLE,35)
  204. client_print(id, print_chat, "* Machineguns Csomagot választottál !");
  205. }
  206. }
  207.  
  208. return PLUGIN_HANDLED;
  209. }
  210. stock print_color(const id, const input[], any:...)
  211.  
  212. {
  213.  
  214. new count = 1, players[32]
  215.  
  216. static msg[191]
  217.  
  218. vformat(msg, 190, input, 3)
  219.  
  220.  
  221.  
  222. replace_all(msg, 190, "!g", "^4")
  223.  
  224. replace_all(msg, 190, "!y", "^1")
  225.  
  226. replace_all(msg, 190, "!t", "^3")
  227.  
  228. replace_all(msg, 190, "á", "á")
  229.  
  230. replace_all(msg, 190, "é", "Ă©")
  231.  
  232. replace_all(msg, 190, "í", "Ă­")
  233.  
  234. replace_all(msg, 190, "ó", "Ăł")
  235.  
  236. replace_all(msg, 190, "ö", "ö")
  237.  
  238. replace_all(msg, 190, "ő", "Ĺ‘")
  239.  
  240. replace_all(msg, 190, "ú", "Ăş")
  241.  
  242. replace_all(msg, 190, "ü", "ĂĽ")
  243.  
  244. replace_all(msg, 190, "ű", "ű")
  245.  
  246. replace_all(msg, 190, "Á", "Á")
  247.  
  248. replace_all(msg, 190, "É", "É")
  249.  
  250. replace_all(msg, 190, "Í", "ĂŤ")
  251.  
  252. replace_all(msg, 190, "Ó", "Ă“")
  253.  
  254. replace_all(msg, 190, "Ö", "Ă–")
  255.  
  256. replace_all(msg, 190, "Ő", "Ő")
  257.  
  258. replace_all(msg, 190, "Ú", "Ăš")
  259.  
  260. replace_all(msg, 190, "Ü", "Ăś")
  261.  
  262. replace_all(msg, 190, "Ű", "Ű")
  263.  
  264.  
  265.  
  266. if (id) players[0] = id; else get_players(players, count, "ch")
  267.  
  268. {
  269.  
  270. for (new i = 0; i < count; i++)
  271.  
  272. {
  273.  
  274. if (is_user_connected(players[i]))
  275.  
  276. {
  277.  
  278. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  279.  
  280. write_byte(players[i])
  281.  
  282. write_string(msg)
  283.  
  284. message_end()
  285.  
  286. }
  287.  
  288. }
  289.  
  290. }
  291.  
  292. return PLUGIN_HANDLED
  293.  
  294. }



hogyan lehetne megcsinálni , hogy ne lehessen több fegyverem , tehát ha van m4 a kezembe mellé kapok akts is következő körbe:S

Szerző:  kiki [2012.09.20. 16:16 ]
Hozzászólás témája:  Re: gnmenü

Mindegyik case elejébe:

strip_user_weapons(id);

Szerző:  ChaspeR [2012.09.20. 16:20 ]
Hozzászólás témája:  Re: gnmenü

nemjó , mert most olvastam ,hogy akkor a bomba nemlesz jó expert írta egy másik témánál...:S

Szerző:  VirTuaL ~` [2012.09.20. 16:23 ]
Hozzászólás témája:  Re: gnmenü

Annak az 1 játékosnak nem strippeled :D (akinél van a C4)

Szerző:  Bence98007 [2012.09.20. 16:31 ]
Hozzászólás témája:  Re: gnmenü

használd így:
if (user_has_weapon(id, CSW_C4))
{
strip_user_weapons(id)
give_item(id, "weapon_m4a1")
give_item(id, "weapon_c4")
}
else
{
strip_user_weapons(id)
give_item(id, "weapon_m4a1")
stb...
}

Szerző:  expert [2012.09.20. 19:40 ]
Hozzászólás témája:  Re: gnmenü

Bence98007 írta:
használd így:
if (user_has_weapon(id, CSW_C4))
{
strip_user_weapons(id)
give_item(id, "weapon_m4a1")
give_item(id, "weapon_c4")
}
else
{
strip_user_weapons(id)
give_item(id, "weapon_m4a1")
stb...
}

őő nem jó !!! adni kell neki plant-ot is mert így nem fogja tudni lerakni a bombát csak ha eldobja meg ujra felveszi !! Szóval:
SMA Forráskód: [ Mindet kijelol ]
  1. if(is_user_alive(id) && !is_user_bot(id) && user_has_weapon(id, CSW_C4))
  2. {
  3. strip_user_weapons(id);
  4. give_item(id, "weapon_c4");
  5. cs_set_user_plant(id, 1, 1);
  6. ColorChat(id, BLUE, "[ C4 ]^x04 Nalad van a Bomba !") ;
  7. }

Szerző:  fear_ezmegmi [2012.09.20. 19:42 ]
Hozzászólás témája:  Re: gnmenü

expert írta:
Bence98007 írta:
használd így:
if (user_has_weapon(id, CSW_C4))
{
strip_user_weapons(id)
give_item(id, "weapon_m4a1")
give_item(id, "weapon_c4")
}
else
{
strip_user_weapons(id)
give_item(id, "weapon_m4a1")
stb...
}

őő nem jó !!! adni kell neki plant-ot is mert így nem fogja tudni lerakni a bombát csak ha eldobja meg ujra felveszi !! Szóval:
SMA Forráskód: [ Mindet kijelol ]
  1. if(is_user_alive(id) && !is_user_bot(id) && user_has_weapon(id, CSW_C4))
  2. {
  3. strip_user_weapons(id);
  4. give_item(id, "weapon_c4");
  5. cs_set_user_plant(id, 1, 1);
  6. ColorChat(id, BLUE, "[ C4 ]^x04 Nalad van a Bomba !") ;
  7. }


szegény emberke kést nem kap? :roll:

Szerző:  expert [2012.09.20. 19:50 ]
Hozzászólás témája:  Re: gnmenü

nekem belevan irva szóval kap de azt már ő is beletudja írni hisz nem most kezdte ! :)

Szerző:  fuck604 [2012.09.20. 21:42 ]
Hozzászólás témája:  Re: gnmenü

Kód:
if(is_user_alive(id) && !is_user_bot(id) && user_has_weapon(id, CSW_C4))

ha van nála c4 akkor nyilvánvalóan él

Szerző:  expert [2012.09.22. 13:10 ]
Hozzászólás témája:  Re: gnmenü

fuck604 írta:
Kód:
if(is_user_alive(id) && !is_user_bot(id) && user_has_weapon(id, CSW_C4))

ha van nála c4 akkor nyilvánvalóan él

Igaz :D majd kiveszem én is :D

Oldal: 1 / 2 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/