hlmod.hu
https://hlmod.hu/

Bazisepito pontrendszer+bolt
https://hlmod.hu/viewtopic.php?f=29&t=11335
Oldal: 1 / 1

Szerző:  misu88 [2013.10.17. 16:29 ]
Hozzászólás témája:  Bazisepito pontrendszer+bolt

Van ez a pontrendszer + bolt. Csak a boltba kéne dolgokatt rakni, a többin nem kell valtoztatni.
Itt az sma, a végén levan irva miket kéne bele.
Amugy egy bázisépitő szerverre kell, ha ez szamit benne :)

SMA Forráskód: [ Mindet kijelol ]
  1.  
  2. #include <amxmodx>
  3. #include <amxmisc>
  4. #include <cstrike>
  5. #include <fun>
  6. #include <nvault>
  7. #include <hamsandwich>
  8. #include <engine>
  9. new pont[33]
  10. new hs,oles
  11. new g_vault
  12. new bool:g_aranyak[33] = false
  13. new bool:g_aranym4[33] = false
  14. new bool:g_aranydezi[33] = false
  15. public plugin_init() {
  16. register_plugin("pontrendszer","1.0","A")
  17. hs = register_cvar("HS", "16")
  18. oles = register_cvar("oles", "10")
  19. register_event("DeathMsg", "halal", "a")
  20. register_clcmd("say /shop", "bolt")
  21. g_vault = nvault_open("pontmentes")
  22. register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")
  23. RegisterHam( Ham_TakeDamage , "player" , "PlayerHurt", 0);
  24. RegisterHam(Ham_Spawn, "player", "newRound", 1)
  25. register_concmd("amx_pont", "cmd_pont");
  26.  
  27.  
  28. }
  29. public plugin_precache()
  30. {
  31. precache_model("models/aranyak/v_aranyak.mdl")
  32. precache_model("models/aranyak/p_aranyak.mdl")
  33. precache_model("models/aranydezi/p_aranydezi.mdl")
  34. precache_model("models/aranydezi/v_aranydezi.mdl")
  35. precache_model("models/aranym4/v_aranym4.mdl")
  36. precache_model("models/aranym4/p_aranym4.mdl")
  37.  
  38. }
  39. public client_PreThink(id)
  40. {
  41. set_hudmessage(0, 170, 255, 0.02, 0.2, 0, 1.0, 3.0)
  42. show_hudmessage(id, "Pontjaid:%d",pont[id])
  43. return 0
  44.  
  45. }
  46. public newRound(id)
  47. {
  48. g_aranyak[id] = false
  49. g_aranym4[id] = false
  50. g_aranydezi[id] = false
  51. }
  52. public client_connect(id)
  53. {
  54.  
  55. LoadData(id)
  56. }
  57. public client_disconnect(id)
  58. {
  59.  
  60. SaveData(id)
  61.  
  62. }
  63. public SaveData(id)
  64. {
  65. new name[32]
  66. get_user_name(id, name, 31)
  67.  
  68. new vaultkey[64],vaultdata[256]
  69. format(vaultkey,63,"%sBBPONT", name)
  70.  
  71. format(vaultdata,255,"%i",pont[id])
  72.  
  73. nvault_set(g_vault,vaultkey,vaultdata)
  74. return PLUGIN_CONTINUE
  75. }
  76. public LoadData(id)
  77. {
  78. new name[32]
  79. get_user_name(id, name, 31)
  80. new vaultkey[64],vaultdata[256]
  81. format(vaultkey,63,"%sBBPONT", name)
  82. format(vaultdata,255,"%i",pont[id])
  83. nvault_get(g_vault,vaultkey,vaultdata,255)
  84. replace_all(vaultdata, 255, "#", " ")
  85. new pontok[33]
  86. parse(vaultdata, pontok, 32)
  87. pont[id] = str_to_num(pontok)
  88. return PLUGIN_CONTINUE
  89. }
  90. public halal()
  91. {
  92. new killer = read_data(1)
  93. new victim = read_data(2)
  94.  
  95. if(killer != victim && get_user_team(killer) != get_user_team(victim) && read_data(3))
  96. {
  97. pont[killer] += get_pcvar_num(hs)
  98. }
  99. if(killer != victim && get_user_team(killer) != get_user_team(victim))
  100. {
  101. pont[killer] += get_pcvar_num(oles)
  102. }
  103. return PLUGIN_CONTINUE
  104. }
  105. public bolt(id)
  106. {
  107. new menu = menu_create("Bolt ", "bolt_hand");
  108.  
  109. menu_additem(menu, "VIP menu", "", 0); // case 0
  110. menu_additem(menu, "Fegyverek", "", 0); // case 1
  111. menu_additem(menu, "Kepessegek", "", 0); // case 2
  112.  
  113. menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  114.  
  115. menu_display(id, menu, 0);
  116.  
  117. return PLUGIN_HANDLED;
  118. }
  119.  
  120. public bolt_hand(id, menu, item)
  121. {
  122. if(item == MENU_EXIT)
  123. {
  124. menu_cancel(id);
  125. return PLUGIN_HANDLED;
  126. }
  127.  
  128. new command[6], name[64], access, callback;
  129.  
  130. menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
  131.  
  132. switch(item)
  133. {
  134. case 0: vipmenu(id)
  135. case 1: fegyverek(id)
  136. case 2: kepessegek(id)
  137. }
  138.  
  139. menu_destroy(menu);
  140.  
  141. return PLUGIN_HANDLED;
  142. }
  143. public vipmenu(id)
  144. {
  145. if(get_user_flags(id) & ADMIN_LEVEL_H)
  146. {
  147. new menu = menu_create("Vip menu", "vipmenu_hand");
  148.  
  149. menu_additem(menu, "AWP [2] pont", "", 0); // case 0
  150. menu_additem(menu, "CT/T Magozo [3] pont", "", 0); // case 1
  151. menu_additem(menu, "Arany AK [10] pont", "", 0); // case 2
  152. menu_additem(menu, "Arany M4 [10] pon", "", 0); // case 3
  153. menu_additem(menu, "Arany Dezi [3] pont", "", 0); // case 4
  154.  
  155.  
  156. menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  157.  
  158. menu_display(id, menu, 0);
  159.  
  160.  
  161. }
  162. else client_print(id, print_chat, "Nincs elerhetoseged ehhez a menuhoz")
  163. return PLUGIN_CONTINUE
  164. }
  165. public vipmenu_hand(id, menu, item)
  166. {
  167. if(item == MENU_EXIT)
  168. {
  169. menu_cancel(id);
  170. return PLUGIN_HANDLED;
  171. }
  172.  
  173. new command[6], name[64], access, callback;
  174.  
  175. menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
  176.  
  177. switch(item)
  178. {
  179. case 0:
  180. {
  181. if(pont[id] >= 2)
  182. {
  183. give_item(id, "weapon_awp")
  184. cs_set_user_bpammo(id, CSW_AWP, 35)
  185. pont[id] -= 2
  186. client_print(id, print_chat, "Sikeres vasarlas")
  187. }
  188. else client_print(id, print_chat, "Nincs eleg pontod")
  189. }
  190. case 1:
  191. {
  192. if(pont[id] >= 3 && cs_get_user_team(id) == CS_TEAM_CT)
  193. {
  194. give_item(id, "weapon_sg550")
  195. cs_set_user_bpammo(id, CSW_SG550, 120)
  196. pont[id] -= 3
  197. client_print(id, print_chat, "Sikeres vasarlas")
  198. }
  199. if(pont[id] >= 3 && cs_get_user_team(id) == CS_TEAM_T)
  200. {
  201. give_item(id, "weapon_sg552")
  202. cs_set_user_bpammo(id, CSW_SG552, 120)
  203. pont[id] -= 3
  204. client_print(id, print_chat, "Sikeres vasarlas")
  205. }
  206. else client_print(id, print_chat, "Nincs eleg pontod")
  207. }
  208. case 2:
  209. {
  210. if(pont[id] >= 10)
  211. {
  212. give_item(id, "weapon_ak47")
  213. cs_set_user_bpammo(id, CSW_AK47, 90)
  214. g_aranyak[id] = true
  215. pont[id] -= 10
  216. client_print(id, print_chat, "Sikeres vasarlas")
  217. }
  218. else client_print(id, print_chat, "Nincs eleg pontod")
  219. }
  220. case 3:
  221. {
  222. if(pont[id] >= 10)
  223. {
  224. give_item(id, "weapon_m4a1")
  225. cs_set_user_bpammo(id, CSW_M4A1, 90)
  226. g_aranym4[id] = true
  227. pont[id] -= 10
  228. client_print(id, print_chat, "Sikeres vasarlas")
  229. }
  230. else client_print(id, print_chat, "Nincs eleg pontod")
  231. }
  232. case 4:
  233. {
  234. if(pont[id] >= 3)
  235. {
  236. give_item(id, "weapon_deagle")
  237. cs_set_user_bpammo(id, CSW_DEAGLE, 35)
  238. g_aranydezi[id] = true
  239. pont[id] -= 3
  240. client_print(id, print_chat, "Sikeres vasarlas")
  241. }
  242. else client_print(id, print_chat, "Nincs eleg pontod")
  243. }
  244. }
  245.  
  246. menu_destroy(menu);
  247.  
  248. return PLUGIN_HANDLED;
  249. }
  250. public fegyverek(id)
  251. {
  252. new menu = menu_create("Fegyver menu", "fegyver_hand");
  253.  
  254. menu_additem(menu, "AWP [10] pont", "", 0); // case 0
  255. menu_additem(menu, "CT/T Magozo [15] pont", "", 0); // case 1
  256. menu_additem(menu, "Arany AK [30] pont", "", 0); // case 2
  257. menu_additem(menu, "Arany M4 [30] pon", "", 0); // case 3
  258. menu_additem(menu, "Arany Dezi [15] pont", "", 0); // case 4
  259.  
  260. menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  261.  
  262. menu_display(id, menu, 0);
  263.  
  264. return PLUGIN_HANDLED;
  265. }
  266.  
  267. public fegyver_hand(id, menu, item)
  268. {
  269. if(item == MENU_EXIT)
  270. {
  271. menu_cancel(id);
  272. return PLUGIN_HANDLED;
  273. }
  274.  
  275. new command[6], name[64], access, callback;
  276.  
  277. menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
  278.  
  279. switch(item)
  280. {
  281. case 0:
  282. {
  283. if(pont[id] >= 10)
  284. {
  285. give_item(id, "weapon_awp")
  286. cs_set_user_bpammo(id, CSW_AWP, 35)
  287. pont[id] -= 10
  288. client_print(id, print_chat, "Sikeres vasarlas")
  289. }
  290. else client_print(id, print_chat, "Nincs eleg pontod")
  291. }
  292. case 1:
  293. {
  294. if(pont[id] >= 15 && cs_get_user_team(id) == CS_TEAM_CT)
  295. {
  296. give_item(id, "weapon_sg550")
  297. cs_set_user_bpammo(id, CSW_SG550, 120)
  298. pont[id] -= 15
  299. client_print(id, print_chat, "Sikeres vasarlas")
  300. }
  301. if(pont[id] >= 15 && cs_get_user_team(id) == CS_TEAM_T)
  302. {
  303. give_item(id, "weapon_sg552")
  304. cs_set_user_bpammo(id, CSW_SG552, 120)
  305. pont[id] -= 15
  306. client_print(id, print_chat, "Sikeres vasarlas")
  307. }
  308. else client_print(id, print_chat, "Nincs eleg pontod")
  309. }
  310. case 2:
  311. {
  312. if(pont[id] >= 30)
  313. {
  314. give_item(id, "weapon_ak47")
  315. cs_set_user_bpammo(id, CSW_AK47, 90)
  316. g_aranyak[id] = true
  317. pont[id] -= 30
  318. client_print(id, print_chat, "Sikeres vasarlas")
  319. }
  320. else client_print(id, print_chat, "Nincs eleg pontod")
  321. }
  322. case 3:
  323. {
  324. if(pont[id] >= 30)
  325. {
  326. give_item(id, "weapon_m4a1")
  327. cs_set_user_bpammo(id, CSW_M4A1, 90)
  328. g_aranym4[id] = true
  329. pont[id] -= 30
  330. client_print(id, print_chat, "Sikeres vasarlas")
  331. }
  332. else client_print(id, print_chat, "Nincs eleg pontod")
  333. }
  334. case 4:
  335. {
  336. if(pont[id] >= 15)
  337. {
  338. give_item(id, "weapon_deagle")
  339. cs_set_user_bpammo(id, CSW_DEAGLE, 35)
  340. g_aranydezi[id] = true
  341. pont[id] -= 15
  342. client_print(id, print_chat, "Sikeres vasarlas")
  343. }
  344. else client_print(id, print_chat, "Nincs eleg pontod")
  345. }
  346. }
  347.  
  348. menu_destroy(menu);
  349.  
  350. return PLUGIN_HANDLED;
  351. }
  352. public kepessegek(id)
  353. {
  354. new menu = menu_create("Kepesseg menu", "kep_hand");
  355.  
  356. menu_additem(menu, "Gyorsasag [5] pont", "", 0); // case 0
  357. menu_additem(menu, "Gravitacio [5] pont", "", 0); // case 1
  358. menu_additem(menu, "+50hp [2] pont", "", 0); // case 2
  359.  
  360. menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  361.  
  362. menu_display(id, menu, 0);
  363.  
  364. return PLUGIN_HANDLED;
  365. }
  366.  
  367. public kep_hand(id, menu, item)
  368. {
  369. if(item == MENU_EXIT)
  370. {
  371. menu_cancel(id);
  372. return PLUGIN_HANDLED;
  373. }
  374.  
  375. new command[6], name[64], access, callback;
  376.  
  377. menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
  378.  
  379. switch(item)
  380. {
  381. case 0:
  382. {
  383. if(pont[id] >= 5)
  384. {
  385. set_user_maxspeed(id, 500.0)
  386. pont[id] -= 5
  387. client_print(id, print_chat, "Sikeres vasarlas")
  388. }
  389. else client_print(id, print_chat, "Nincs eleg pontod")
  390. }
  391. case 1:
  392. {
  393. if(pont[id] >= 5)
  394. {
  395. set_user_gravity(id, 0.8)
  396. pont[id] -= 5
  397. client_print(id, print_chat, "Sikeres vasarlas")
  398. }
  399. else client_print(id, print_chat, "Nincs eleg pontod")
  400. }
  401. case 2:
  402. {
  403. if(pont[id] >= 2)
  404. {
  405. set_user_health(id, get_user_health(id)+50)
  406. pont[id] -= 2
  407. client_print(id, print_chat, "Sikeres vasarlas")
  408. }
  409. else client_print(id, print_chat, "Nincs eleg pontod")
  410. }
  411. }
  412.  
  413. menu_destroy(menu);
  414.  
  415. return PLUGIN_HANDLED;
  416. }
  417. //Arany fegyverek cuccai
  418. public Event_CurWeapon(id)
  419. {
  420. new weapon = get_user_weapon(id)
  421. if(weapon == CSW_AK47 && g_aranyak[id] == true)
  422. {
  423. entity_set_string(id, EV_SZ_viewmodel, "models/aranyak/v_aranyak.mdl")
  424. entity_set_string(id, EV_SZ_weaponmodel, "models/aranyak/p_aranyak.mdl")
  425. }
  426. if(weapon == CSW_AK47 && g_aranyak[id] == false)
  427. {
  428. entity_set_string(id, EV_SZ_viewmodel, "models/v_ak47.mdl")
  429. entity_set_string(id, EV_SZ_weaponmodel, "models/p_ak47.mdl")
  430. }
  431. if(weapon == CSW_M4A1 && g_aranym4[id] == true)
  432. {
  433. entity_set_string(id, EV_SZ_viewmodel, "models/aranym4/v_aranym4.mdl")
  434. entity_set_string(id, EV_SZ_weaponmodel, "models/aranym4/p_aranym4.mdl")
  435. }
  436. if(weapon == CSW_M4A1 && g_aranym4[id] == false)
  437. {
  438. entity_set_string(id, EV_SZ_viewmodel, "models/v_m4a1.mdl")
  439. entity_set_string(id, EV_SZ_weaponmodel, "models/p_m4a1.mdl")
  440. }
  441. if(weapon == CSW_DEAGLE && g_aranydezi[id] == true)
  442. {
  443. entity_set_string(id, EV_SZ_viewmodel, "models/aranydezi/v_aranydezi.mdl")
  444. entity_set_string(id, EV_SZ_weaponmodel, "models/aranydezi/p_aranydezi.mdl")
  445.  
  446. }
  447. if(weapon == CSW_DEAGLE && g_aranydezi[id] == false)
  448. {
  449. entity_set_string(id, EV_SZ_viewmodel, "models/v_deagle.mdl")
  450. entity_set_string(id, EV_SZ_weaponmodel, "models/p_deagle.mdl")
  451.  
  452. }
  453.  
  454.  
  455. }
  456. public PlayerHurt( victim,inflictor,attacker,Float:damage, DamageBits )
  457. {
  458. new weapon = get_user_weapon(attacker)
  459. if(weapon == CSW_AK47 && g_aranyak[attacker])
  460. {
  461. SetHamParamFloat(4, damage * 1.50);
  462. }
  463. if(weapon == CSW_M4A1 && g_aranym4[attacker])
  464. {
  465. SetHamParamFloat(4, damage * 1.50);
  466. }
  467. if(weapon == CSW_DEAGLE && g_aranydezi[attacker])
  468. {
  469. SetHamParamFloat(4, damage * 1.50);
  470. }
  471. }
  472.  
  473. //pont adás
  474. public cmd_pont(id)
  475. {
  476.  
  477. if(get_user_flags(id) & ADMIN_IMMUNITY)
  478.  
  479. {
  480.  
  481.  
  482.  
  483. new Arg1[64]
  484.  
  485. read_argv(1, Arg1, 63)
  486.  
  487. new Target = cmd_target(id, Arg1, 0);
  488.  
  489. new iLevel[32], Value
  490.  
  491. read_argv(2, iLevel, 31);
  492.  
  493. Value = str_to_num(iLevel);
  494. pont[Target] += Value
  495.  
  496.  
  497.  
  498.  
  499.  
  500. }
  501.  
  502. }
  503.  



Akkor azt kéne:
1. A vip menube rakni:(ami van azt ne vedd ki)
http://amxmodx.crys.hu/site/?p=pluginz&c=l&f=goldenawp
http://amxmodx.crys.hu/site/?p=pluginz&c=l&f=ZPNB11


2. A sima fegyver menuhoz:
Ami van benne arany fegyo azt vedd ki, és csak a magozo és awp maradjon. +
http://amxmodx.crys.hu/site/?p=pluginz&c=l&f=granatpack
http://amxmodx.crys.hu/site/?p=pluginz&c=l&f=zpwatergun
http://amxmodx.crys.hu/site/?p=pluginz& ... traminigun
http://amxmodx.crys.hu/site/?p=pluginz& ... alinfinity
http://amxmodx.crys.hu/site/?p=pluginz&c=l&f=zpthompson

3. Egyeb dolgoknal ami van azt hagyajatok benne +
1000HP, csak zombiknak/vagyis teroristaknak, mas ne tudja
Ami van sima embereknek 50hp, azt csak 3szor tudjak megvenni
Orok loszert berakni.


Az árakat majd én beállitom.
Ennyi lenne ha megoldható. Ha nem az sem baj :DD
Vagyis a Vip menube csak berakni kene, amit az 1.-hoz irtam.
A sima fegyver menuhobol kivenni az arany:ak,m4,desi-t és marad a magozo,awp+ berakni amit irtam,ha lehet.
Ha megcsinalja valaki irja le melyik modelleket rakjam be stb.
Köszönöm.

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