hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.04.25. 03:54



Jelenlévő felhasználók

Jelenleg 318 felhasználó van jelen :: 2 regisztrált, 0 rejtett és 316 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot], Google [Bot] az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 2 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Pont menü
HozzászólásElküldve: 2014.08.20. 19:27 
Offline
Beavatott
Avatar

Csatlakozott: 2014.07.30. 13:35
Hozzászólások: 77
Megköszönt másnak: 15 alkalommal
Megköszönték neki: 9 alkalommal
Hello . valaki kitudná venni ebből a fegyvereket ?
Előre is köszi :)


SMA Forráskód: [ Mindet kijelol ]
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <fun>
  6. #include <engine>
  7. #include <cstrike>
  8. #include <nvault>
  9.  
  10. #define PLUGIN "New Plug-In"
  11. #define VERSION "1.0"
  12. #define AUTHOR "Rendszergazda"
  13.  
  14. #define PARACHUTE_LEVEL ADMIN_ALL
  15.  
  16. #define FL_WATERJUMP (1<<11)
  17. #define FL_ONGROUND (1<<9)
  18.  
  19. new points[33];
  20.  
  21. new pBunny, pMulti, pParac, pAK, pM4, pAWP, pVIP
  22.  
  23. new gBunny[33], gMulti[33], gVIP[33];
  24.  
  25. new g_vault
  26. new jumpnum[33] = 0
  27. new bool:dojump[33] = false
  28.  
  29.  
  30. new has_parachute[33]
  31. new para_ent[33]
  32. new gCStrike = 0
  33. new pDetach, pFallSpeed, pEnabled;
  34.  
  35. public client_connect(id)
  36. {
  37. LoadInformation(id);
  38. if(gVIP[id])
  39. {
  40. gBunny[id] = true; gMulti[id] = true; has_parachute[id] = true;
  41. }
  42. }
  43.  
  44. public client_disconnect(id)
  45. {
  46. SaveInformation(id);
  47. }
  48. public client_PreThink(id)
  49. {
  50. bunny(id);
  51. multi(id);
  52. parac(id);
  53. }
  54.  
  55. public parac(id)
  56. {
  57. if (!get_pcvar_num(pEnabled)) return
  58. if (!is_user_alive(id) || !has_parachute[id]) return
  59.  
  60. new Float:fallspeed = get_pcvar_float(pFallSpeed) * -1.0
  61. new Float:frame
  62.  
  63. new button = get_user_button(id)
  64. new oldbutton = get_user_oldbutton(id)
  65. new flags = get_entity_flags(id)
  66.  
  67. if (para_ent[id] > 0 && (flags & FL_ONGROUND)) {
  68.  
  69. if (get_pcvar_num(pDetach)) {
  70.  
  71. if (get_user_gravity(id) == 0.1) set_user_gravity(id, 1.0)
  72.  
  73. if (entity_get_int(para_ent[id],EV_INT_sequence) != 2) {
  74. entity_set_int(para_ent[id], EV_INT_sequence, 2)
  75. entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
  76. entity_set_float(para_ent[id], EV_FL_frame, 0.0)
  77. entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
  78. entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
  79. entity_set_float(para_ent[id], EV_FL_framerate, 0.0)
  80. return
  81. }
  82.  
  83. frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0
  84. entity_set_float(para_ent[id],EV_FL_fuser1,frame)
  85. entity_set_float(para_ent[id],EV_FL_frame,frame)
  86.  
  87. if (frame > 254.0) {
  88. remove_entity(para_ent[id])
  89. para_ent[id] = 0
  90. }
  91. }
  92. else {
  93. remove_entity(para_ent[id])
  94. set_user_gravity(id, 1.0)
  95. para_ent[id] = 0
  96. }
  97.  
  98. return
  99. }
  100.  
  101. if (button & IN_USE) {
  102.  
  103. new Float:velocity[3]
  104. entity_get_vector(id, EV_VEC_velocity, velocity)
  105.  
  106. if (velocity[2] < 0.0) {
  107.  
  108. if(para_ent[id] <= 0) {
  109. para_ent[id] = create_entity("info_target")
  110. if(para_ent[id] > 0) {
  111. entity_set_string(para_ent[id],EV_SZ_classname,"parachute")
  112. entity_set_edict(para_ent[id], EV_ENT_aiment, id)
  113. entity_set_edict(para_ent[id], EV_ENT_owner, id)
  114. entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW)
  115. entity_set_model(para_ent[id], "models/parachute.mdl")
  116. entity_set_int(para_ent[id], EV_INT_sequence, 0)
  117. entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
  118. entity_set_float(para_ent[id], EV_FL_frame, 0.0)
  119. entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
  120. }
  121. }
  122.  
  123. if (para_ent[id] > 0) {
  124.  
  125. entity_set_int(id, EV_INT_sequence, 3)
  126. entity_set_int(id, EV_INT_gaitsequence, 1)
  127. entity_set_float(id, EV_FL_frame, 1.0)
  128. entity_set_float(id, EV_FL_framerate, 1.0)
  129. set_user_gravity(id, 0.1)
  130.  
  131. velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed
  132. entity_set_vector(id, EV_VEC_velocity, velocity)
  133.  
  134. if (entity_get_int(para_ent[id],EV_INT_sequence) == 0) {
  135.  
  136. frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0
  137. entity_set_float(para_ent[id],EV_FL_fuser1,frame)
  138. entity_set_float(para_ent[id],EV_FL_frame,frame)
  139.  
  140. if (frame > 100.0) {
  141. entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
  142. entity_set_float(para_ent[id], EV_FL_framerate, 0.4)
  143. entity_set_int(para_ent[id], EV_INT_sequence, 1)
  144. entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
  145. entity_set_float(para_ent[id], EV_FL_frame, 0.0)
  146. entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
  147. }
  148. }
  149. }
  150. }
  151. else if (para_ent[id] > 0) {
  152. remove_entity(para_ent[id])
  153. set_user_gravity(id, 1.0)
  154. para_ent[id] = 0
  155. }
  156. }
  157. else if ((oldbutton & IN_USE) && para_ent[id] > 0 ) {
  158. remove_entity(para_ent[id])
  159. set_user_gravity(id, 1.0)
  160. para_ent[id] = 0
  161. }
  162. }
  163.  
  164. public multi(id)
  165. {
  166. if(!is_user_alive(id) && !gMulti[id]) return PLUGIN_CONTINUE
  167. new nbut = get_user_button(id)
  168. new obut = get_user_oldbutton(id)
  169. if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
  170. {
  171. if(jumpnum[id] < 1)
  172. {
  173. dojump[id] = true
  174. jumpnum[id]++
  175. return PLUGIN_CONTINUE
  176. }
  177. }
  178. if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
  179. {
  180. jumpnum[id] = 0
  181. return PLUGIN_CONTINUE
  182. }
  183. return PLUGIN_CONTINUE
  184. }
  185.  
  186. public client_PostThink(id)
  187. {
  188. if(!is_user_alive(id) && !gMulti[id]) return PLUGIN_CONTINUE
  189. if(dojump[id] == true)
  190. {
  191. new Float:velocity[3]
  192. entity_get_vector(id,EV_VEC_velocity,velocity)
  193. velocity[2] = random_float(265.0,285.0)
  194. entity_set_vector(id,EV_VEC_velocity,velocity)
  195. dojump[id] = false
  196. return PLUGIN_CONTINUE
  197. }
  198. return PLUGIN_CONTINUE
  199. }
  200.  
  201.  
  202. public bunny(id)
  203. {
  204. if (!gBunny[id])
  205. return PLUGIN_CONTINUE
  206.  
  207. entity_set_float(id, EV_FL_fuser2, 0.0)
  208.  
  209. if (!gBunny[id])
  210. return PLUGIN_CONTINUE
  211. if (entity_get_int(id, EV_INT_button) & 2)
  212. {
  213. new flags = entity_get_int(id, EV_INT_flags)
  214.  
  215. if (flags & FL_WATERJUMP)
  216. return PLUGIN_CONTINUE
  217. if ( entity_get_int(id, EV_INT_waterlevel) >= 2 )
  218. return PLUGIN_CONTINUE
  219. if ( !(flags & FL_ONGROUND) )
  220. return PLUGIN_CONTINUE
  221.  
  222. new Float:velocity[3]
  223. entity_get_vector(id, EV_VEC_velocity, velocity)
  224. velocity[2] += 250.0
  225. entity_set_vector(id, EV_VEC_velocity, velocity)
  226.  
  227. entity_set_int(id, EV_INT_gaitsequence, 6)
  228. }
  229. return PLUGIN_CONTINUE
  230. }
  231.  
  232. public plugin_natives()
  233. {
  234. set_module_filter("module_filter")
  235. set_native_filter("native_filter")
  236. }
  237.  
  238. public module_filter(const module[])
  239. {
  240. if (!cstrike_running() && equali(module, "cstrike")) {
  241. return PLUGIN_HANDLED
  242. }
  243.  
  244. return PLUGIN_CONTINUE
  245. }
  246.  
  247. public native_filter(const name[], index, trap)
  248. {
  249. if (!trap) return PLUGIN_HANDLED
  250.  
  251. return PLUGIN_CONTINUE
  252. }
  253.  
  254. public plugin_precache()
  255. {
  256. precache_model("models/parachute.mdl")
  257. }
  258.  
  259.  
  260. public plugin_init() {
  261. register_plugin(PLUGIN, VERSION, AUTHOR);
  262. register_event("DeathMsg", "onDeath", "a", "1>0");
  263. register_clcmd("say /menu", "menu");
  264. register_clcmd("say_team /menu", "menu");
  265. register_clcmd("/menu", "menu");
  266. register_clcmd("menu", "menu");
  267.  
  268. pBunny = register_cvar("ps_bunny_cost", "50");
  269. pMulti = register_cvar("ps_multi_cost", "100");
  270. pParac = register_cvar("ps_parac_cost", "50");
  271. pAK = register_cvar("ps_ak_cost", "7");
  272. pM4 = register_cvar("ps_m4_cost", "10");
  273. pAWP = register_cvar("ps_awp_cost", "20");
  274. pVIP = register_cvar("ps_vip_cost", "800");
  275.  
  276.  
  277. pEnabled = register_cvar("sv_parachute", "1" )
  278. pFallSpeed = register_cvar("parachute_fallspeed", "100")
  279. pDetach = register_cvar("parachute_detach", "1")
  280.  
  281. if (gCStrike)
  282. {
  283.  
  284. register_concmd("amx_parachute", "admin_give_parachute", PARACHUTE_LEVEL, "<nick, #userid or @team>" )
  285. }
  286.  
  287.  
  288. }
  289.  
  290. public onDeath()
  291. {
  292. new killer = read_data(1);
  293. new victim = read_data(2);
  294. if(killer != victim)
  295. {
  296. points[killer]++
  297. set_hudmessage(0, 255, 0, 0.05, 0.88, 2, 6.0, 12.0)
  298. show_hudmessage(killer, "Kaptal 1 pontot! Menuhoz ird be, hogy /menu.")
  299. }
  300. }
  301.  
  302. public menu(id)
  303. {
  304. new menu = menu_create("Valassz targyat!", "handler");
  305. menu_additem(menu, "Bunnyhop", "0", 0);
  306. menu_additem(menu, "Dupla ugras", "1", 0);
  307. menu_additem(menu, "Ejtoernyo", "2", 0);
  308. menu_additem(menu, "AK-47 Kalasnikov", "3", 0);
  309. menu_additem(menu, "M4A1 Colt", "4", 0);
  310. menu_additem(menu, "AWP Magnum Sniper", "5", 0);
  311. menu_additem(menu, "*V.I.P.*", "6", 0);
  312. menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  313. menu_display(id, menu);
  314. }
  315.  
  316. public handler(id, menu, item)
  317. {
  318. if(item == MENU_EXIT)
  319. {
  320. menu_destroy(menu);
  321. }
  322. new szCommand[6] , szName[64]; new access , callback;
  323. menu_item_getinfo(menu , item , access , szCommand , 5 , szName , 63 , callback);
  324. new i = str_to_num(szCommand)
  325. switch(i)
  326. {
  327. case 0:
  328. {
  329. if(points[id] >= get_pcvar_num(pBunny))
  330. {
  331. gBunny[id] = true;
  332. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pBunny));
  333. }
  334. else
  335. {
  336. set_hudmessage(255, 0, 0, 0.30, 0.41, 1, 6.0, 4.0)
  337. show_hudmessage(id, "Nincs eleg penzed a vasarlashoz!")
  338. }
  339.  
  340. }
  341. case 1:
  342. {
  343. if(points[id] >= get_pcvar_num(pMulti))
  344. {
  345. gMulti[id] = true;
  346. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pMulti));
  347. }
  348. else
  349. {
  350. set_hudmessage(255, 0, 0, 0.30, 0.41, 1, 6.0, 4.0)
  351. show_hudmessage(id, "Nincs eleg penzed a vasarlashoz!")
  352. }
  353.  
  354. }
  355. case 2:
  356. {
  357. if(points[id] >= get_pcvar_num(pParac))
  358. {
  359. has_parachute[id] = true;
  360. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pParac));
  361. }
  362. else
  363. {
  364. set_hudmessage(255, 0, 0, 0.30, 0.41, 1, 6.0, 4.0)
  365. show_hudmessage(id, "Nincs eleg penzed a vasarlashoz!")
  366. }
  367.  
  368. }
  369. case 3:
  370. {
  371. if(points[id] >= get_pcvar_num(pAK))
  372. {
  373. give_item(id, "weapon_ak47");
  374. give_item(id, "ammo_762nato");
  375. give_item(id, "ammo_762nato");
  376. give_item(id, "ammo_762nato");
  377. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pAK));
  378. }
  379. else
  380. {
  381. set_hudmessage(255, 0, 0, 0.30, 0.41, 1, 6.0, 4.0)
  382. show_hudmessage(id, "Nincs eleg penzed a vasarlashoz!")
  383. }
  384. }
  385. case 4:
  386. {
  387. if(points[id] >= get_pcvar_num(pM4))
  388. {
  389. give_item(id, "weapon_m4a1");
  390. give_item(id, "ammo_556nato");
  391. give_item(id, "ammo_556nato");
  392. give_item(id, "ammo_556nato");
  393. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pM4));
  394. }
  395. else
  396. {
  397. set_hudmessage(255, 0, 0, 0.30, 0.41, 1, 6.0, 4.0)
  398. show_hudmessage(id, "Nincs eleg penzed a vasarlashoz!")
  399. }
  400. }
  401. case 5:
  402. {
  403. if(points[id] >= get_pcvar_num(pAWP))
  404. {
  405. give_item(id, "weapon_awp");
  406. give_item(id, "ammo_338magnum");
  407. give_item(id, "ammo_338magnum");
  408. give_item(id, "ammo_338magnum");
  409. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pAWP));
  410. }
  411. else
  412. {
  413. set_hudmessage(255, 0, 0, 0.30, 0.41, 1, 6.0, 4.0)
  414. show_hudmessage(id, "Nincs eleg penzed a vasarlashoz!")
  415. }
  416.  
  417. }
  418. case 6:
  419. {
  420. if(points[id] >= get_pcvar_num(pVIP))
  421. {
  422. gVIP[id] = true;
  423. gBunny[id] = true; gMulti[id] = true; has_parachute[id] = true;
  424. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pVIP));
  425. }
  426. else
  427. {
  428. set_hudmessage(255, 0, 0, 0.30, 0.41, 1, 6.0, 4.0)
  429. show_hudmessage(id, "Nincs eleg penzed a vasarlashoz!")
  430. }
  431. }
  432. }
  433. }
  434. public LoadInformation(id)
  435. {
  436. new name[32]
  437.  
  438. get_user_name(id, name, 31)
  439.  
  440. new vaultkey[64],vaultdata[256]
  441.  
  442.  
  443. format(vaultkey,63,"%sPONTSYSTEM", name)
  444.  
  445. format(vaultdata,255,"%i#%i#%i#%i#", gBunny[id], gMulti[id], gVIP[id], has_parachute[id])
  446.  
  447.  
  448. nvault_get(g_vault,vaultkey,vaultdata,255)
  449.  
  450. replace_all(vaultdata, 255, "#", " ")
  451.  
  452. new nbunny[33], nmulti[33], nvip[33], nparac[33];
  453.  
  454. parse(vaultdata, nbunny, 32, nmulti, 32, nvip, 32, nparac, 32)
  455.  
  456. gBunny[id] = str_to_num(nbunny)
  457.  
  458. gMulti[id] = str_to_num(nmulti)
  459.  
  460. gVIP[id] = str_to_num(nvip)
  461.  
  462. has_parachute[id] = str_to_num(nparac)
  463.  
  464. return PLUGIN_CONTINUE
  465.  
  466. }
  467.  
  468. public SaveInformation(id)
  469. {
  470. new name[32]
  471. get_user_name(id, name, 31)
  472.  
  473. new vaultkey[64],vaultdata[256]
  474.  
  475. format(vaultkey,63,"%sPONTSYSTEM", name)
  476.  
  477. format(vaultdata,255,"%i#%i#%i#%i#", gBunny[id], gMulti[id], gVIP[id], has_parachute[id])
  478.  
  479.  
  480.  
  481. nvault_set(g_vault,vaultkey,vaultdata)
  482. return PLUGIN_CONTINUE
  483. }

_________________
SMA Forráskód: [ Mindet kijelol ]
  1.  Compilation aborted.
  2. 4 Errors.
  3. Done.
  4. ----->


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Pont menü
HozzászólásElküldve: 2014.08.20. 20:03 
Offline
Nagyúr
Avatar

Csatlakozott: 2013.09.04. 15:21
Hozzászólások: 635
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 141 alkalommal
SMA Forráskód: [ Mindet kijelol ]
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <fun>
  6. #include <engine>
  7. #include <cstrike>
  8. #include <nvault>
  9.  
  10. #define PLUGIN "New Plug-In"
  11. #define VERSION "1.0"
  12. #define AUTHOR "Rendszergazda"
  13.  
  14. #define PARACHUTE_LEVEL ADMIN_ALL
  15.  
  16. #define FL_WATERJUMP (1<<11)
  17. #define FL_ONGROUND (1<<9)
  18.  
  19. new points[33];
  20.  
  21. new pBunny, pMulti, pParac, pVIP
  22.  
  23. new gBunny[33], gMulti[33], gVIP[33];
  24.  
  25. new g_vault
  26. new jumpnum[33] = 0
  27. new bool:dojump[33] = false
  28.  
  29.  
  30. new has_parachute[33]
  31. new para_ent[33]
  32. new gCStrike = 0
  33. new pDetach, pFallSpeed, pEnabled;
  34.  
  35. public client_connect(id)
  36. {
  37. LoadInformation(id);
  38. if(gVIP[id])
  39. {
  40. gBunny[id] = true; gMulti[id] = true; has_parachute[id] = true;
  41. }
  42. }
  43.  
  44. public client_disconnect(id)
  45. {
  46. SaveInformation(id);
  47. }
  48. public client_PreThink(id)
  49. {
  50. bunny(id);
  51. multi(id);
  52. parac(id);
  53. }
  54.  
  55. public parac(id)
  56. {
  57. if (!get_pcvar_num(pEnabled)) return
  58. if (!is_user_alive(id) || !has_parachute[id]) return
  59.  
  60. new Float:fallspeed = get_pcvar_float(pFallSpeed) * -1.0
  61. new Float:frame
  62.  
  63. new button = get_user_button(id)
  64. new oldbutton = get_user_oldbutton(id)
  65. new flags = get_entity_flags(id)
  66.  
  67. if (para_ent[id] > 0 && (flags & FL_ONGROUND)) {
  68.  
  69. if (get_pcvar_num(pDetach)) {
  70.  
  71. if (get_user_gravity(id) == 0.1) set_user_gravity(id, 1.0)
  72.  
  73. if (entity_get_int(para_ent[id],EV_INT_sequence) != 2) {
  74. entity_set_int(para_ent[id], EV_INT_sequence, 2)
  75. entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
  76. entity_set_float(para_ent[id], EV_FL_frame, 0.0)
  77. entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
  78. entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
  79. entity_set_float(para_ent[id], EV_FL_framerate, 0.0)
  80. return
  81. }
  82.  
  83. frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0
  84. entity_set_float(para_ent[id],EV_FL_fuser1,frame)
  85. entity_set_float(para_ent[id],EV_FL_frame,frame)
  86.  
  87. if (frame > 254.0) {
  88. remove_entity(para_ent[id])
  89. para_ent[id] = 0
  90. }
  91. }
  92. else {
  93. remove_entity(para_ent[id])
  94. set_user_gravity(id, 1.0)
  95. para_ent[id] = 0
  96. }
  97.  
  98. return
  99. }
  100.  
  101. if (button & IN_USE) {
  102.  
  103. new Float:velocity[3]
  104. entity_get_vector(id, EV_VEC_velocity, velocity)
  105.  
  106. if (velocity[2] < 0.0) {
  107.  
  108. if(para_ent[id] <= 0) {
  109. para_ent[id] = create_entity("info_target")
  110. if(para_ent[id] > 0) {
  111. entity_set_string(para_ent[id],EV_SZ_classname,"parachute")
  112. entity_set_edict(para_ent[id], EV_ENT_aiment, id)
  113. entity_set_edict(para_ent[id], EV_ENT_owner, id)
  114. entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW)
  115. entity_set_model(para_ent[id], "models/parachute.mdl")
  116. entity_set_int(para_ent[id], EV_INT_sequence, 0)
  117. entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
  118. entity_set_float(para_ent[id], EV_FL_frame, 0.0)
  119. entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
  120. }
  121. }
  122.  
  123. if (para_ent[id] > 0) {
  124.  
  125. entity_set_int(id, EV_INT_sequence, 3)
  126. entity_set_int(id, EV_INT_gaitsequence, 1)
  127. entity_set_float(id, EV_FL_frame, 1.0)
  128. entity_set_float(id, EV_FL_framerate, 1.0)
  129. set_user_gravity(id, 0.1)
  130.  
  131. velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed
  132. entity_set_vector(id, EV_VEC_velocity, velocity)
  133.  
  134. if (entity_get_int(para_ent[id],EV_INT_sequence) == 0) {
  135.  
  136. frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0
  137. entity_set_float(para_ent[id],EV_FL_fuser1,frame)
  138. entity_set_float(para_ent[id],EV_FL_frame,frame)
  139.  
  140. if (frame > 100.0) {
  141. entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
  142. entity_set_float(para_ent[id], EV_FL_framerate, 0.4)
  143. entity_set_int(para_ent[id], EV_INT_sequence, 1)
  144. entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
  145. entity_set_float(para_ent[id], EV_FL_frame, 0.0)
  146. entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
  147. }
  148. }
  149. }
  150. }
  151. else if (para_ent[id] > 0) {
  152. remove_entity(para_ent[id])
  153. set_user_gravity(id, 1.0)
  154. para_ent[id] = 0
  155. }
  156. }
  157. else if ((oldbutton & IN_USE) && para_ent[id] > 0 ) {
  158. remove_entity(para_ent[id])
  159. set_user_gravity(id, 1.0)
  160. para_ent[id] = 0
  161. }
  162. }
  163.  
  164. public multi(id)
  165. {
  166. if(!is_user_alive(id) && !gMulti[id]) return PLUGIN_CONTINUE
  167. new nbut = get_user_button(id)
  168. new obut = get_user_oldbutton(id)
  169. if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
  170. {
  171. if(jumpnum[id] < 1)
  172. {
  173. dojump[id] = true
  174. jumpnum[id]++
  175. return PLUGIN_CONTINUE
  176. }
  177. }
  178. if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
  179. {
  180. jumpnum[id] = 0
  181. return PLUGIN_CONTINUE
  182. }
  183. return PLUGIN_CONTINUE
  184. }
  185.  
  186. public client_PostThink(id)
  187. {
  188. if(!is_user_alive(id) && !gMulti[id]) return PLUGIN_CONTINUE
  189. if(dojump[id] == true)
  190. {
  191. new Float:velocity[3]
  192. entity_get_vector(id,EV_VEC_velocity,velocity)
  193. velocity[2] = random_float(265.0,285.0)
  194. entity_set_vector(id,EV_VEC_velocity,velocity)
  195. dojump[id] = false
  196. return PLUGIN_CONTINUE
  197. }
  198. return PLUGIN_CONTINUE
  199. }
  200.  
  201.  
  202. public bunny(id)
  203. {
  204. if (!gBunny[id])
  205. return PLUGIN_CONTINUE
  206.  
  207. entity_set_float(id, EV_FL_fuser2, 0.0)
  208.  
  209. if (!gBunny[id])
  210. return PLUGIN_CONTINUE
  211. if (entity_get_int(id, EV_INT_button) & 2)
  212. {
  213. new flags = entity_get_int(id, EV_INT_flags)
  214.  
  215. if (flags & FL_WATERJUMP)
  216. return PLUGIN_CONTINUE
  217. if ( entity_get_int(id, EV_INT_waterlevel) >= 2 )
  218. return PLUGIN_CONTINUE
  219. if ( !(flags & FL_ONGROUND) )
  220. return PLUGIN_CONTINUE
  221.  
  222. new Float:velocity[3]
  223. entity_get_vector(id, EV_VEC_velocity, velocity)
  224. velocity[2] += 250.0
  225. entity_set_vector(id, EV_VEC_velocity, velocity)
  226.  
  227. entity_set_int(id, EV_INT_gaitsequence, 6)
  228. }
  229. return PLUGIN_CONTINUE
  230. }
  231.  
  232. public plugin_natives()
  233. {
  234. set_module_filter("module_filter")
  235. set_native_filter("native_filter")
  236. }
  237.  
  238. public module_filter(const module[])
  239. {
  240. if (!cstrike_running() && equali(module, "cstrike")) {
  241. return PLUGIN_HANDLED
  242. }
  243.  
  244. return PLUGIN_CONTINUE
  245. }
  246.  
  247. public native_filter(const name[], index, trap)
  248. {
  249. if (!trap) return PLUGIN_HANDLED
  250.  
  251. return PLUGIN_CONTINUE
  252. }
  253.  
  254. public plugin_precache()
  255. {
  256. precache_model("models/parachute.mdl")
  257. }
  258.  
  259.  
  260. public plugin_init() {
  261. register_plugin(PLUGIN, VERSION, AUTHOR);
  262. register_event("DeathMsg", "onDeath", "a", "1>0");
  263. register_clcmd("say /menu", "menu");
  264. register_clcmd("say_team /menu", "menu");
  265. register_clcmd("/menu", "menu");
  266. register_clcmd("menu", "menu");
  267.  
  268. pBunny = register_cvar("ps_bunny_cost", "50");
  269. pMulti = register_cvar("ps_multi_cost", "100");
  270. pParac = register_cvar("ps_parac_cost", "50");
  271. pVIP = register_cvar("ps_vip_cost", "800");
  272.  
  273.  
  274. pEnabled = register_cvar("sv_parachute", "1" )
  275. pFallSpeed = register_cvar("parachute_fallspeed", "100")
  276. pDetach = register_cvar("parachute_detach", "1")
  277.  
  278. if (gCStrike)
  279. {
  280.  
  281. register_concmd("amx_parachute", "admin_give_parachute", PARACHUTE_LEVEL, "<nick, #userid or @team>" )
  282. }
  283.  
  284.  
  285. }
  286.  
  287. public onDeath()
  288. {
  289. new killer = read_data(1);
  290. new victim = read_data(2);
  291. if(killer != victim)
  292. {
  293. points[killer]++
  294. set_hudmessage(0, 255, 0, 0.05, 0.88, 2, 6.0, 12.0)
  295. show_hudmessage(killer, "Kaptal 1 pontot! Menuhoz ird be, hogy /menu.")
  296. }
  297. }
  298.  
  299. public menu(id)
  300. {
  301. new menu = menu_create("Valassz targyat!", "handler");
  302. menu_additem(menu, "Bunnyhop", "0", 0);
  303. menu_additem(menu, "Dupla ugras", "1", 0);
  304. menu_additem(menu, "Ejtoernyo", "2", 0);
  305. menu_additem(menu, "*V.I.P.*", "3", 0);
  306. menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  307. menu_display(id, menu);
  308. }
  309.  
  310. public handler(id, menu, item)
  311. {
  312. if(item == MENU_EXIT)
  313. {
  314. menu_destroy(menu);
  315. }
  316. new szCommand[6] , szName[64]; new access , callback;
  317. menu_item_getinfo(menu , item , access , szCommand , 5 , szName , 63 , callback);
  318. new i = str_to_num(szCommand)
  319. switch(i)
  320. {
  321. case 0:
  322. {
  323. if(points[id] >= get_pcvar_num(pBunny))
  324. {
  325. gBunny[id] = true;
  326. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pBunny));
  327. }
  328. else
  329. {
  330. set_hudmessage(255, 0, 0, 0.30, 0.41, 1, 6.0, 4.0)
  331. show_hudmessage(id, "Nincs eleg penzed a vasarlashoz!")
  332. }
  333.  
  334. }
  335. case 1:
  336. {
  337. if(points[id] >= get_pcvar_num(pMulti))
  338. {
  339. gMulti[id] = true;
  340. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pMulti));
  341. }
  342. else
  343. {
  344. set_hudmessage(255, 0, 0, 0.30, 0.41, 1, 6.0, 4.0)
  345. show_hudmessage(id, "Nincs eleg penzed a vasarlashoz!")
  346. }
  347.  
  348. }
  349. case 2:
  350. {
  351. if(points[id] >= get_pcvar_num(pParac))
  352. {
  353. has_parachute[id] = true;
  354. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pParac));
  355. }
  356. else
  357. {
  358. set_hudmessage(255, 0, 0, 0.30, 0.41, 1, 6.0, 4.0)
  359. show_hudmessage(id, "Nincs eleg penzed a vasarlashoz!")
  360. }
  361.  
  362. }
  363. case 3:
  364. {
  365. if(points[id] >= get_pcvar_num(pVIP))
  366. {
  367. gVIP[id] = true;
  368. gBunny[id] = true; gMulti[id] = true; has_parachute[id] = true;
  369. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(pVIP));
  370. }
  371. else
  372. {
  373. set_hudmessage(255, 0, 0, 0.30, 0.41, 1, 6.0, 4.0)
  374. show_hudmessage(id, "Nincs eleg penzed a vasarlashoz!")
  375. }
  376. }
  377. }
  378. }
  379. public LoadInformation(id)
  380. {
  381. new name[32]
  382.  
  383. get_user_name(id, name, 31)
  384.  
  385. new vaultkey[64],vaultdata[256]
  386.  
  387.  
  388. format(vaultkey,63,"%sPONTSYSTEM", name)
  389.  
  390. format(vaultdata,255,"%i#%i#%i#%i#", gBunny[id], gMulti[id], gVIP[id], has_parachute[id])
  391.  
  392.  
  393. nvault_get(g_vault,vaultkey,vaultdata,255)
  394.  
  395. replace_all(vaultdata, 255, "#", " ")
  396.  
  397. new nbunny[33], nmulti[33], nvip[33], nparac[33];
  398.  
  399. parse(vaultdata, nbunny, 32, nmulti, 32, nvip, 32, nparac, 32)
  400.  
  401. gBunny[id] = str_to_num(nbunny)
  402.  
  403. gMulti[id] = str_to_num(nmulti)
  404.  
  405. gVIP[id] = str_to_num(nvip)
  406.  
  407. has_parachute[id] = str_to_num(nparac)
  408.  
  409. return PLUGIN_CONTINUE
  410.  
  411. }
  412.  
  413. public SaveInformation(id)
  414. {
  415. new name[32]
  416. get_user_name(id, name, 31)
  417.  
  418. new vaultkey[64],vaultdata[256]
  419.  
  420. format(vaultkey,63,"%sPONTSYSTEM", name)
  421.  
  422. format(vaultdata,255,"%i#%i#%i#%i#", gBunny[id], gMulti[id], gVIP[id], has_parachute[id])
  423.  
  424.  
  425.  
  426. nvault_set(g_vault,vaultkey,vaultdata)
  427. return PLUGIN_CONTINUE
  428. }

_________________
My Steam:
KépKép

Ők köszönték meg Golo nek ezt a hozzászólást: FoReSt-TeA (2014.08.20. 20:13)
  Népszerűség: 2.27%


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 2 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 27 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole