hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.04.23. 14:47



Jelenlévő felhasználók

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

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

Regisztrált felhasználók: nincs regisztrált felhasználó 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: Pontrendszer
HozzászólásElküldve: 2014.08.12. 15:19 
Offline
Lelkes
Avatar

Csatlakozott: 2013.01.18. 15:06
Hozzászólások: 27
Megköszönt másnak: 25 alkalommal
Valaki javítaná ezt nekem? Előre is köszönöm :)
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <fun>
  5. #include <fakemeta>
  6. #include <hamsandwich>
  7. #include <nvault>
  8. enum Color
  9. {
  10. NORMAL = 1, // clients scr_concolor cvar color
  11. GREEN, // Green Color
  12. TEAM_COLOR, // Red, grey, blue
  13. GREY, // grey
  14. RED, // Red
  15. BLUE, // Blue
  16. }
  17.  
  18. new TeamName[][] =
  19. {
  20. "",
  21. "TERRORIST",
  22. "CT",
  23. "SPECTATOR"
  24. }
  25.  
  26. ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
  27. {
  28. static message[256];
  29.  
  30. switch(type)
  31. {
  32. case NORMAL: // clients scr_concolor cvar color
  33. {
  34. message[0] = 0x01;
  35. }
  36. case GREEN: // Green
  37. {
  38. message[0] = 0x04;
  39. }
  40. default: // White, Red, Blue
  41. {
  42. message[0] = 0x03;
  43. }
  44. }
  45.  
  46. vformat(message[1], 251, msg, 4);
  47. message[192] = '^0';
  48.  
  49. static team, ColorChange, index, MSG_Type;
  50.  
  51. if(id)
  52. {
  53. MSG_Type = MSG_ONE;
  54. index = id;
  55. } else {
  56. index = FindPlayer();
  57. MSG_Type = MSG_ALL;
  58. }
  59.  
  60. team = get_user_team(index);
  61. ColorChange = ColorSelection(index, MSG_Type, type);
  62.  
  63. ShowColorMessage(index, MSG_Type, message);
  64.  
  65. if(ColorChange)
  66. {
  67. Team_Info(index, MSG_Type, TeamName[team]);
  68. }
  69. }
  70.  
  71. ShowColorMessage(id, type, message[])
  72. {
  73. message_begin(type, get_user_msgid("SayText"), _, id);
  74. write_byte(id)
  75. write_string(message);
  76. message_end();
  77. }
  78.  
  79. Team_Info(id, type, team[])
  80. {
  81. message_begin(type, get_user_msgid("TeamInfo"), _, id);
  82. write_byte(id);
  83. write_string(team);
  84. message_end();
  85.  
  86. return 1;
  87. }
  88.  
  89. ColorSelection(index, type, Color:Type)
  90. {
  91. switch(Type)
  92. {
  93. case RED:
  94. {
  95. return Team_Info(index, type, TeamName[1]);
  96. }
  97. case BLUE:
  98. {
  99. return Team_Info(index, type, TeamName[2]);
  100. }
  101. case GREY:
  102. {
  103. return Team_Info(index, type, TeamName[0]);
  104. }
  105. }
  106.  
  107. return 0;
  108. }
  109.  
  110. FindPlayer()
  111. {
  112. static i;
  113. i = -1;
  114.  
  115. while(i <= get_maxplayers())
  116. {
  117. if(is_user_connected(++i))
  118. {
  119. return i;
  120. }
  121. }
  122.  
  123. return -1;
  124. }
  125.  
  126.  
  127. #define PLUGIN "Pontrendszer"
  128. #define VERSION "1.1"
  129. #define AUTHOR "crazy"
  130.  
  131. #define DROG_SEBESSEG 800.0
  132.  
  133. new g_vault
  134. new pontok[33]
  135. new name[33][32]
  136. new admin
  137. new killp, killhsp
  138. new ajandek1, ajandek2, ajandek3
  139. new SyncHudObj
  140. enum shopitems
  141. {
  142. GRANAT,
  143. SEBESSEG,
  144. UJRAELEDES,
  145. LATHATATLAN,
  146. NYOLCVANOTHP,
  147. ONEHIT,
  148. HALHATATLAN
  149. };
  150. new cvar_bolt[shopitems]
  151.  
  152. new bool:activ_sebesseg[33]
  153. new bool:activ_lathatatlan[33]
  154. new bool:activ_onehit[33]
  155. new bool:activ_halhatatlan[33]
  156.  
  157. #define MAX_SHOP_ITEM 7
  158. new const shop_item_names[MAX_SHOP_ITEM+1][] =
  159. {
  160. "",
  161. "\yGranat \w(HE) \r|%d| Pont",
  162. "\yNagyobb Sebesseg \r|%d| Pont",
  163. "\yUjraeledes \w(Halottak hasznalhatjak!) \r|%d| Pont",
  164. "\yLathatatlansag \w(1 kor) \r|%d| Pont",
  165. "\y85HP \r|%d| Pont",
  166. "\y1 hit = 1 kill \w(1 kor) \r|%d| Pont",
  167. "\yHalhatatlansag \w(1 kor) \r|%d| Pont",
  168. };
  169. public plugin_init() {
  170.  
  171. register_plugin(PLUGIN, VERSION, AUTHOR)
  172. set_task(2.9, "hud", 0, _, _, "b")
  173.  
  174. killp = register_cvar("pont_kill", "1")
  175. killhsp = register_cvar("pont_killhs", "2")
  176.  
  177. ajandek1 = register_cvar("pont_ajandek1", "5")
  178. ajandek2 = register_cvar("pont_ajandek2", "10")
  179. ajandek3 = register_cvar("pont_ajandek3", "20")
  180.  
  181. register_clcmd("team_say /adas", "adas")
  182. register_clcmd("say /adas", "adas")
  183. register_clcmd("pont_adas", "adas")
  184.  
  185. register_clcmd("team_say /shop", "Shop")
  186. register_clcmd("say /shop", "Shop")
  187.  
  188. register_clcmd("team_say /bolt", "Shop")
  189. register_clcmd("say /bolt", "Shop")
  190.  
  191. cvar_bolt[GRANAT] = register_cvar("bolt_1", "25")
  192. cvar_bolt[SEBESSEG] = register_cvar("bolt_2", "55")
  193. cvar_bolt[UJRAELEDES] = register_cvar("bolt_3", "35")
  194. cvar_bolt[LATHATATLAN] = register_cvar("bolt_4", "500")
  195. cvar_bolt[NYOLCVANOTHP] = register_cvar("bolt_5", "150")
  196. cvar_bolt[ONEHIT] = register_cvar("bolt_6", "500")
  197. cvar_bolt[HALHATATLAN] = register_cvar("bolt_7", "1200")
  198.  
  199. g_vault = nvault_open("PontRendszer");
  200.  
  201. RegisterHam(Ham_Killed, "player", "fw_player_killed", 1)
  202. RegisterHam(Ham_TakeDamage, "player", "fw_player_damage", 0)
  203. RegisterHam(Ham_Spawn, "player", "fw_player_spawn", 0)
  204. RegisterHam(Ham_Spawn, "player", "fw_player_spawn_post", 1)
  205. register_event("CurWeapon", "Event_Change_Weapon", "be", "1=1")
  206. SyncHudObj = CreateHudSyncObj()
  207. new itemszam = (_:shopitems)
  208. if(MAX_SHOP_ITEM != itemszam)
  209. {
  210. set_fail_state("Valamit elrontottal. A shopitems tombben es a shop_item_names tombben nem ugyanannyi elem van")
  211. }
  212. }
  213. public fw_player_killed(victim, attacker, shouldgib)
  214. {
  215. if(!is_user_connected(attacker) || !is_user_connected(victim) || attacker == victim)
  216. return PLUGIN_CONTINUE;
  217.  
  218. if(get_pdata_int(victim, 75) == HIT_HEAD)
  219. {
  220. pontok[attacker] += get_pcvar_num(killhsp)
  221. ColorChat(attacker, GREEN,"[AnarChy] .: BOOOM HEADSHOOT! :. Ez megert ^x03 %d pontot!", get_pcvar_num(killhsp))
  222. }
  223. else
  224. {
  225. pontok[attacker] += get_pcvar_num(killp)
  226. ColorChat(attacker, GREEN,"[AnarChy] ^x03 %d pont az olesert!", get_pcvar_num(killp))
  227. }
  228. return PLUGIN_CONTINUE
  229. }
  230. public fw_player_damage(victim, inflictor, attacker, Float:damage, damage_type)
  231. {
  232. if(activ_onehit[attacker])
  233. {
  234. SetHamParamFloat(4, float(get_user_health(victim)+1))
  235. }
  236. if(activ_halhatatlan[victim])
  237. {
  238. return HAM_SUPERCEDE
  239. }
  240. return HAM_IGNORED
  241. }
  242. public fw_player_spawn(id)
  243. {
  244. activ_halhatatlan[id] = false
  245. activ_onehit[id] = false
  246. activ_sebesseg[id] = false
  247. }
  248. public fw_player_spawn_post(id)
  249. {
  250. if(activ_lathatatlan[id])
  251. {
  252. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)
  253. activ_lathatatlan[id] = false
  254. }
  255. }
  256. public Event_Change_Weapon(id)
  257. {
  258. if(activ_sebesseg[id])
  259. {
  260. set_user_maxspeed(id, DROG_SEBESSEG)
  261. }
  262. return PLUGIN_CONTINUE
  263. }
  264. public Shop(id)//IGEN EZ ITT A MENU
  265. {
  266. static Item[64]
  267.  
  268. formatex(Item, charsmax(Item),"\r[AnarChy Bolt]" )
  269. new Menu = menu_create(Item, "Shoph")
  270.  
  271. new szTempid[10]
  272.  
  273. for(new i = 1; i<sizeof(shop_item_names); i++)
  274. {
  275. num_to_str(i, szTempid, 9)
  276. formatex(Item, charsmax(Item),shop_item_names[i], get_pcvar_num(cvar_bolt[shopitems:(i-1)]))
  277. menu_additem(Menu, Item, szTempid)
  278. }
  279. menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL)
  280. menu_display(id, Menu)
  281.  
  282. return PLUGIN_HANDLED
  283. }
  284. public Shoph(id, menu, item)
  285. {
  286. if( item == MENU_EXIT )
  287. {
  288. menu_destroy(menu)
  289. return PLUGIN_HANDLED
  290. }
  291. new data[6], iName[64]
  292. new access, callback
  293. menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
  294.  
  295. new key = str_to_num(data)
  296. new elo = is_user_alive(id)
  297. new ar[_:shopitems+1]
  298. for(new i=1; i<_:shopitems+1; i++)
  299. {
  300. ar[i] = get_pcvar_num(cvar_bolt[shopitems:(i-1)])
  301. }
  302.  
  303. switch(key)
  304. {
  305. case 1:
  306. {
  307. if (pontok[id] >= ar[key] && elo)
  308. {
  309. pontok[id] -= ar[key]
  310. give_item(id, "weapon_hegrenade")
  311. ColorChat(id, GREEN, "[AnarChy] Megkaptad a granatot!")
  312. }
  313. else
  314. {
  315. ColorChat(id, GREEN, "[AnarChy] Sajnos,nincs eleg pontod")
  316. }
  317. }
  318. case 2:
  319. {
  320. if (pontok[id] >= ar[key] && elo)
  321. {
  322. pontok[id] -= ar[key]
  323. set_user_maxspeed(id, DROG_SEBESSEG)
  324. activ_sebesseg[id] = true
  325. ColorChat(id, GREEN, "[AnarChy] A sebesseged gyorsitva lett!")
  326. }
  327. else
  328. {
  329. ColorChat(id, GREEN, "[AnarChy] Sajnos,nincs eleg pontod!")
  330. }
  331. }
  332. case 3:
  333. {
  334. if (pontok[id] >= ar[key] && !elo)
  335. {
  336. pontok[id] -= ar[key]
  337. ExecuteHamB(Ham_CS_RoundRespawn, id)
  338. ColorChat(id, GREEN, "[AnarChy] Ujraeledtel!")
  339. }
  340. else if(elo)
  341. {
  342. ColorChat(id, GREEN, "[AnarChy] Elok nem hasznalhatjak!")
  343. }
  344. else
  345. {
  346. ColorChat(id, GREEN, "[AnarChy] Sajnos,nincs eleg pontod")
  347. }
  348. }
  349. case 4:
  350. {
  351. if (pontok[id] >= ar[key] && elo)
  352. {
  353. pontok[id] -= ar[key]
  354. activ_lathatatlan[id] = true
  355. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0)
  356. ColorChat(id, GREEN, "[AnarChy] Megkaptad a lathatatlansagot!")
  357. }
  358. else
  359. {
  360. ColorChat(id, GREEN, "[AnarChy] Sajnos,nincs eleg pontod")
  361. }
  362. }
  363. case 5:
  364. {
  365. if (pontok[id] >= ar[key] && elo)
  366. {
  367. pontok[id] -= ar[key]
  368. set_user_health(id, get_user_health(id)+50)
  369. ColorChat(id, GREEN, "[AnarChy] Megkaptad az eletet!")
  370. }
  371. else
  372. {
  373. ColorChat(id, GREEN, "[AnarChy] Sajnos,nincs eleg pontod")
  374. }
  375. }
  376. case 6:
  377. {
  378. if (pontok[id] >= ar[key] && elo)
  379. {
  380. pontok[id] -= ar[key]
  381. activ_onehit[id] = true
  382. ColorChat(id, GREEN, "[AnarChy] Megkaptad az egy lovesbol olest!")
  383. }
  384. else
  385. {
  386. ColorChat(id, GREEN, "[AnarChy] Sajnos,nincs eleg pontod")
  387. }
  388. }
  389. case 7:
  390. {
  391. if (pontok[id] >= ar[key] && elo)
  392. {
  393. pontok[id] -= ar[key]
  394. activ_halhatatlan[id] = true
  395. ColorChat(id, GREEN, "[AnarChy] Megkaptad a halhatatlansagot!")
  396. }
  397. else
  398. {
  399. ColorChat(id, GREEN, "[AnarChy] Sajnos,nincs eleg pontod")
  400. }
  401. }
  402. }
  403. menu_destroy(menu)
  404. return PLUGIN_HANDLED
  405. }
  406.  
  407. public mentes(id)
  408. {
  409. new vaultkey[64],vaultdata[256]
  410.  
  411. format(vaultkey,63,"%s-PONTOK", name[id])
  412. format(vaultdata,255,"%d", pontok[id])
  413.  
  414. nvault_set(g_vault,vaultkey,vaultdata)
  415. return PLUGIN_CONTINUE
  416. }
  417. public betoltes(id)
  418. {
  419. new vaultkey[64],vaultdata[256]
  420.  
  421. format(vaultkey,63,"%s-PONTOK", name[id])
  422.  
  423. nvault_get(g_vault,vaultkey,vaultdata,255)
  424.  
  425. pontok[id] = str_to_num(vaultdata)
  426. return PLUGIN_CONTINUE;
  427. }
  428. public client_disconnect(id)
  429. {
  430. mentes(id);
  431. remove_task(id);
  432. pontok[id] = 0;
  433. activ_halhatatlan[id] = false
  434. activ_lathatatlan[id] = false
  435. activ_onehit[id] = false
  436. activ_sebesseg[id] = false
  437. }
  438.  
  439. public client_connect(id)
  440. {
  441. get_user_name(id, name[id], 31)
  442. betoltes(id);
  443. set_task(300.0, "ajandek_1",id)
  444. set_task(900.0, "ajandek_2",id)
  445. set_task(1800.0, "ajandek_3",id)
  446. }
  447. public adas(id)
  448. {
  449. if (get_user_flags(id) & ADMIN_KICK)
  450. {
  451. new menu = menu_create("\y [AnarChy] \rKinek akarsz pontot adni?! \y(10p)", "menu_handler")
  452. new players[32], pnum, tempid
  453. new szName[32], szTempid[10]
  454. get_players(players, pnum)
  455. for( new i; i<pnum; i++ )
  456. {
  457. tempid = players[i];
  458. get_user_name(tempid, szName, charsmax(szName))
  459. num_to_str(tempid, szTempid, charsmax(szTempid))
  460. menu_additem(menu, szName, szTempid, 0)
  461.  
  462. }
  463. menu_display(id, menu, 0)
  464. }
  465. else
  466. {
  467. ColorChat(id, GREEN, "Sajnos nincs jogod hasznalni ezt a parancsot!")
  468.  
  469. }
  470. }
  471. public menu_handler(id, menu, item)
  472. {
  473. if( item == MENU_EXIT )
  474. {
  475. menu_destroy(menu);
  476. return PLUGIN_HANDLED;
  477. }
  478.  
  479. new data[6], szName[64];
  480. new access, callback;
  481. menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
  482.  
  483. new tempid = str_to_num(data);
  484.  
  485. if( is_user_alive(tempid) )
  486. {
  487. pontok[tempid] += 10
  488. }
  489. client_cmd(id,"pont_adas")
  490. menu_destroy(menu);
  491. return PLUGIN_HANDLED;
  492. }
  493. public ajandek_1(id)
  494. {
  495. new penz = get_pcvar_num(ajandek1);
  496. client_print(id, print_chat, "[AnarChy] %d pont jar mert itt vagy mar 5 perce!", penz)
  497. pontok[id] += penz;
  498. }
  499. public ajandek_2(id)
  500. {
  501. new penz = get_pcvar_num(ajandek2);
  502. client_print(id, print_chat, "[AnarChy] %d pont jar mert itt vagy mar 10 perce!", penz)
  503. pontok[id] += penz;
  504. }
  505. public ajandek_3(id)
  506. {
  507. new penz = get_pcvar_num(ajandek3);
  508. client_print(id, print_chat, "[AnarChy] %d pont jar mert itt vagy mar 30 perce!", penz)
  509. pontok[id] += penz;
  510. }
  511.  
  512. public hud()
  513. {
  514. admin = 0;
  515. new players[32], pnum, tempid
  516. get_players(players, pnum, "c")
  517.  
  518. for( new i; i<pnum; i++ )
  519. {
  520. tempid = players[i]
  521. if(get_user_flags(tempid) & ADMIN_KICK)
  522. {
  523. admin++;
  524. }
  525.  
  526. }
  527. for( new i; i<pnum; i++ )
  528. {
  529. tempid = players[i]
  530. set_hudmessage(0, 170, 255, 0.02, 0.2, 0, 1.0, 3.0);
  531. ShowSyncHudMsg(tempid, SyncHudObj, "[Pont: %d]^n[AnarChy KNIFE Adminok: %d]",pontok[tempid],admin)
  532. }
  533. }
  534.  


Hiba:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

pontrendszer.sma(167) : error 018: initialization data exceeds declared size

1 Error.
Could not locate output file pontrendszer.amx (compile failed).


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Pontrendszer
HozzászólásElküldve: 2014.08.12. 15:43 
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. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <fun>
  5. #include <fakemeta>
  6. #include <hamsandwich>
  7. #include <nvault>
  8. enum Color
  9. {
  10. NORMAL = 1, // clients scr_concolor cvar color
  11. GREEN, // Green Color
  12. TEAM_COLOR, // Red, grey, blue
  13. GREY, // grey
  14. RED, // Red
  15. BLUE, // Blue
  16. }
  17.  
  18. new TeamName[][] =
  19. {
  20. "",
  21. "TERRORIST",
  22. "CT",
  23. "SPECTATOR"
  24. }
  25.  
  26. ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
  27. {
  28. static message[256];
  29.  
  30. switch(type)
  31. {
  32. case NORMAL: // clients scr_concolor cvar color
  33. {
  34. message[0] = 0x01;
  35. }
  36. case GREEN: // Green
  37. {
  38. message[0] = 0x04;
  39. }
  40. default: // White, Red, Blue
  41. {
  42. message[0] = 0x03;
  43. }
  44. }
  45.  
  46. vformat(message[1], 251, msg, 4);
  47. message[192] = '^0';
  48.  
  49. static team, ColorChange, index, MSG_Type;
  50.  
  51. if(id)
  52. {
  53. MSG_Type = MSG_ONE;
  54. index = id;
  55. } else {
  56. index = FindPlayer();
  57. MSG_Type = MSG_ALL;
  58. }
  59.  
  60. team = get_user_team(index);
  61. ColorChange = ColorSelection(index, MSG_Type, type);
  62.  
  63. ShowColorMessage(index, MSG_Type, message);
  64.  
  65. if(ColorChange)
  66. {
  67. Team_Info(index, MSG_Type, TeamName[team]);
  68. }
  69. }
  70.  
  71. ShowColorMessage(id, type, message[])
  72. {
  73. message_begin(type, get_user_msgid("SayText"), _, id);
  74. write_byte(id)
  75. write_string(message);
  76. message_end();
  77. }
  78.  
  79. Team_Info(id, type, team[])
  80. {
  81. message_begin(type, get_user_msgid("TeamInfo"), _, id);
  82. write_byte(id);
  83. write_string(team);
  84. message_end();
  85.  
  86. return 1;
  87. }
  88.  
  89. ColorSelection(index, type, Color:Type)
  90. {
  91. switch(Type)
  92. {
  93. case RED:
  94. {
  95. return Team_Info(index, type, TeamName[1]);
  96. }
  97. case BLUE:
  98. {
  99. return Team_Info(index, type, TeamName[2]);
  100. }
  101. case GREY:
  102. {
  103. return Team_Info(index, type, TeamName[0]);
  104. }
  105. }
  106.  
  107. return 0;
  108. }
  109.  
  110. FindPlayer()
  111. {
  112. static i;
  113. i = -1;
  114.  
  115. while(i <= get_maxplayers())
  116. {
  117. if(is_user_connected(++i))
  118. {
  119. return i;
  120. }
  121. }
  122.  
  123. return -1;
  124. }
  125.  
  126.  
  127. #define PLUGIN "Pontrendszer"
  128. #define VERSION "1.1"
  129. #define AUTHOR "crazy"
  130.  
  131. #define DROG_SEBESSEG 800.0
  132.  
  133. new g_vault
  134. new pontok[33]
  135. new name[33][32]
  136. new admin
  137. new killp, killhsp
  138. new ajandek1, ajandek2, ajandek3
  139. new SyncHudObj
  140. enum shopitems
  141. {
  142. GRANAT,
  143. SEBESSEG,
  144. UJRAELEDES,
  145. LATHATATLAN,
  146. NYOLCVANOTHP,
  147. ONEHIT,
  148. HALHATATLAN
  149. };
  150. new cvar_bolt[shopitems]
  151.  
  152. new bool:activ_sebesseg[33]
  153. new bool:activ_lathatatlan[33]
  154. new bool:activ_onehit[33]
  155. new bool:activ_halhatatlan[33]
  156.  
  157. #define MAX_SHOP_ITEM 7
  158. new const shop_item_names[MAX_SHOP_ITEM+1][] =
  159. {
  160. "",
  161. "\yGranat \w(HE) \r|%d| Pont",
  162. "\yNagyobb Sebesseg \r|%d| Pont",
  163. "\yUjraeledes \w(Halottak hasznalhatjak!) \r|%d| Pont",
  164. "\yLathatatlansag \w(1 kor) \r|%d| Pont",
  165. "\y85HP \r|%d| Pont",
  166. "\y1 hit = 1 kill \w(1 kor) \r|%d| Pont",
  167. "\yHalhatatlansag \w(1 kor) \r|%d| Pont"
  168. };
  169. public plugin_init() {
  170.  
  171. register_plugin(PLUGIN, VERSION, AUTHOR)
  172. set_task(2.9, "hud", 0, _, _, "b")
  173.  
  174. killp = register_cvar("pont_kill", "1")
  175. killhsp = register_cvar("pont_killhs", "2")
  176.  
  177. ajandek1 = register_cvar("pont_ajandek1", "5")
  178. ajandek2 = register_cvar("pont_ajandek2", "10")
  179. ajandek3 = register_cvar("pont_ajandek3", "20")
  180.  
  181. register_clcmd("team_say /adas", "adas")
  182. register_clcmd("say /adas", "adas")
  183. register_clcmd("pont_adas", "adas")
  184.  
  185. register_clcmd("team_say /shop", "Shop")
  186. register_clcmd("say /shop", "Shop")
  187.  
  188. register_clcmd("team_say /bolt", "Shop")
  189. register_clcmd("say /bolt", "Shop")
  190.  
  191. cvar_bolt[GRANAT] = register_cvar("bolt_1", "25")
  192. cvar_bolt[SEBESSEG] = register_cvar("bolt_2", "55")
  193. cvar_bolt[UJRAELEDES] = register_cvar("bolt_3", "35")
  194. cvar_bolt[LATHATATLAN] = register_cvar("bolt_4", "500")
  195. cvar_bolt[NYOLCVANOTHP] = register_cvar("bolt_5", "150")
  196. cvar_bolt[ONEHIT] = register_cvar("bolt_6", "500")
  197. cvar_bolt[HALHATATLAN] = register_cvar("bolt_7", "1200")
  198.  
  199. g_vault = nvault_open("PontRendszer");
  200.  
  201. RegisterHam(Ham_Killed, "player", "fw_player_killed", 1)
  202. RegisterHam(Ham_TakeDamage, "player", "fw_player_damage", 0)
  203. RegisterHam(Ham_Spawn, "player", "fw_player_spawn", 0)
  204. RegisterHam(Ham_Spawn, "player", "fw_player_spawn_post", 1)
  205. register_event("CurWeapon", "Event_Change_Weapon", "be", "1=1")
  206. SyncHudObj = CreateHudSyncObj()
  207. new itemszam = (_:shopitems)
  208. if(MAX_SHOP_ITEM != itemszam)
  209. {
  210. set_fail_state("Valamit elrontottal. A shopitems tombben es a shop_item_names tombben nem ugyanannyi elem van")
  211. }
  212. }
  213. public fw_player_killed(victim, attacker, shouldgib)
  214. {
  215. if(!is_user_connected(attacker) || !is_user_connected(victim) || attacker == victim)
  216. return PLUGIN_CONTINUE;
  217.  
  218. if(get_pdata_int(victim, 75) == HIT_HEAD)
  219. {
  220. pontok[attacker] += get_pcvar_num(killhsp)
  221. ColorChat(attacker, GREEN,"[AnarChy] .: BOOOM HEADSHOOT! :. Ez megert ^x03 %d pontot!", get_pcvar_num(killhsp))
  222. }
  223. else
  224. {
  225. pontok[attacker] += get_pcvar_num(killp)
  226. ColorChat(attacker, GREEN,"[AnarChy] ^x03 %d pont az olesert!", get_pcvar_num(killp))
  227. }
  228. return PLUGIN_CONTINUE
  229. }
  230. public fw_player_damage(victim, inflictor, attacker, Float:damage, damage_type)
  231. {
  232. if(activ_onehit[attacker])
  233. {
  234. SetHamParamFloat(4, float(get_user_health(victim)+1))
  235. }
  236. if(activ_halhatatlan[victim])
  237. {
  238. return HAM_SUPERCEDE
  239. }
  240. return HAM_IGNORED
  241. }
  242. public fw_player_spawn(id)
  243. {
  244. activ_halhatatlan[id] = false
  245. activ_onehit[id] = false
  246. activ_sebesseg[id] = false
  247. }
  248. public fw_player_spawn_post(id)
  249. {
  250. if(activ_lathatatlan[id])
  251. {
  252. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)
  253. activ_lathatatlan[id] = false
  254. }
  255. }
  256. public Event_Change_Weapon(id)
  257. {
  258. if(activ_sebesseg[id])
  259. {
  260. set_user_maxspeed(id, DROG_SEBESSEG)
  261. }
  262. return PLUGIN_CONTINUE
  263. }
  264. public Shop(id)//IGEN EZ ITT A MENU
  265. {
  266. static Item[64]
  267.  
  268. formatex(Item, charsmax(Item),"\r[AnarChy Bolt]" )
  269. new Menu = menu_create(Item, "Shoph")
  270.  
  271. new szTempid[10]
  272.  
  273. for(new i = 1; i<sizeof(shop_item_names); i++)
  274. {
  275. num_to_str(i, szTempid, 9)
  276. formatex(Item, charsmax(Item),shop_item_names[i], get_pcvar_num(cvar_bolt[shopitems:(i-1)]))
  277. menu_additem(Menu, Item, szTempid)
  278. }
  279. menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL)
  280. menu_display(id, Menu)
  281.  
  282. return PLUGIN_HANDLED
  283. }
  284. public Shoph(id, menu, item)
  285. {
  286. if( item == MENU_EXIT )
  287. {
  288. menu_destroy(menu)
  289. return PLUGIN_HANDLED
  290. }
  291. new data[6], iName[64]
  292. new access, callback
  293. menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
  294.  
  295. new key = str_to_num(data)
  296. new elo = is_user_alive(id)
  297. new ar[_:shopitems+1]
  298. for(new i=1; i<_:shopitems+1; i++)
  299. {
  300. ar[i] = get_pcvar_num(cvar_bolt[shopitems:(i-1)])
  301. }
  302.  
  303. switch(key)
  304. {
  305. case 1:
  306. {
  307. if (pontok[id] >= ar[key] && elo)
  308. {
  309. pontok[id] -= ar[key]
  310. give_item(id, "weapon_hegrenade")
  311. ColorChat(id, GREEN, "[AnarChy] Megkaptad a granatot!")
  312. }
  313. else
  314. {
  315. ColorChat(id, GREEN, "[AnarChy] Sajnos,nincs eleg pontod")
  316. }
  317. }
  318. case 2:
  319. {
  320. if (pontok[id] >= ar[key] && elo)
  321. {
  322. pontok[id] -= ar[key]
  323. set_user_maxspeed(id, DROG_SEBESSEG)
  324. activ_sebesseg[id] = true
  325. ColorChat(id, GREEN, "[AnarChy] A sebesseged gyorsitva lett!")
  326. }
  327. else
  328. {
  329. ColorChat(id, GREEN, "[AnarChy] Sajnos,nincs eleg pontod!")
  330. }
  331. }
  332. case 3:
  333. {
  334. if (pontok[id] >= ar[key] && !elo)
  335. {
  336. pontok[id] -= ar[key]
  337. ExecuteHamB(Ham_CS_RoundRespawn, id)
  338. ColorChat(id, GREEN, "[AnarChy] Ujraeledtel!")
  339. }
  340. else if(elo)
  341. {
  342. ColorChat(id, GREEN, "[AnarChy] Elok nem hasznalhatjak!")
  343. }
  344. else
  345. {
  346. ColorChat(id, GREEN, "[AnarChy] Sajnos,nincs eleg pontod")
  347. }
  348. }
  349. case 4:
  350. {
  351. if (pontok[id] >= ar[key] && elo)
  352. {
  353. pontok[id] -= ar[key]
  354. activ_lathatatlan[id] = true
  355. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0)
  356. ColorChat(id, GREEN, "[AnarChy] Megkaptad a lathatatlansagot!")
  357. }
  358. else
  359. {
  360. ColorChat(id, GREEN, "[AnarChy] Sajnos,nincs eleg pontod")
  361. }
  362. }
  363. case 5:
  364. {
  365. if (pontok[id] >= ar[key] && elo)
  366. {
  367. pontok[id] -= ar[key]
  368. set_user_health(id, get_user_health(id)+50)
  369. ColorChat(id, GREEN, "[AnarChy] Megkaptad az eletet!")
  370. }
  371. else
  372. {
  373. ColorChat(id, GREEN, "[AnarChy] Sajnos,nincs eleg pontod")
  374. }
  375. }
  376. case 6:
  377. {
  378. if (pontok[id] >= ar[key] && elo)
  379. {
  380. pontok[id] -= ar[key]
  381. activ_onehit[id] = true
  382. ColorChat(id, GREEN, "[AnarChy] Megkaptad az egy lovesbol olest!")
  383. }
  384. else
  385. {
  386. ColorChat(id, GREEN, "[AnarChy] Sajnos,nincs eleg pontod")
  387. }
  388. }
  389. case 7:
  390. {
  391. if (pontok[id] >= ar[key] && elo)
  392. {
  393. pontok[id] -= ar[key]
  394. activ_halhatatlan[id] = true
  395. ColorChat(id, GREEN, "[AnarChy] Megkaptad a halhatatlansagot!")
  396. }
  397. else
  398. {
  399. ColorChat(id, GREEN, "[AnarChy] Sajnos,nincs eleg pontod")
  400. }
  401. }
  402. }
  403. menu_destroy(menu)
  404. return PLUGIN_HANDLED
  405. }
  406.  
  407. public mentes(id)
  408. {
  409. new vaultkey[64],vaultdata[256]
  410.  
  411. format(vaultkey,63,"%s-PONTOK", name[id])
  412. format(vaultdata,255,"%d", pontok[id])
  413.  
  414. nvault_set(g_vault,vaultkey,vaultdata)
  415. return PLUGIN_CONTINUE
  416. }
  417. public betoltes(id)
  418. {
  419. new vaultkey[64],vaultdata[256]
  420.  
  421. format(vaultkey,63,"%s-PONTOK", name[id])
  422.  
  423. nvault_get(g_vault,vaultkey,vaultdata,255)
  424.  
  425. pontok[id] = str_to_num(vaultdata)
  426. return PLUGIN_CONTINUE;
  427. }
  428. public client_disconnect(id)
  429. {
  430. mentes(id);
  431. remove_task(id);
  432. pontok[id] = 0;
  433. activ_halhatatlan[id] = false
  434. activ_lathatatlan[id] = false
  435. activ_onehit[id] = false
  436. activ_sebesseg[id] = false
  437. }
  438.  
  439. public client_connect(id)
  440. {
  441. get_user_name(id, name[id], 31)
  442. betoltes(id);
  443. set_task(300.0, "ajandek_1",id)
  444. set_task(900.0, "ajandek_2",id)
  445. set_task(1800.0, "ajandek_3",id)
  446. }
  447. public adas(id)
  448. {
  449. if (get_user_flags(id) & ADMIN_KICK)
  450. {
  451. new menu = menu_create("\y [AnarChy] \rKinek akarsz pontot adni?! \y(10p)", "menu_handler")
  452. new players[32], pnum, tempid
  453. new szName[32], szTempid[10]
  454. get_players(players, pnum)
  455. for( new i; i<pnum; i++ )
  456. {
  457. tempid = players[i];
  458. get_user_name(tempid, szName, charsmax(szName))
  459. num_to_str(tempid, szTempid, charsmax(szTempid))
  460. menu_additem(menu, szName, szTempid, 0)
  461.  
  462. }
  463. menu_display(id, menu, 0)
  464. }
  465. else
  466. {
  467. ColorChat(id, GREEN, "Sajnos nincs jogod hasznalni ezt a parancsot!")
  468.  
  469. }
  470. }
  471. public menu_handler(id, menu, item)
  472. {
  473. if( item == MENU_EXIT )
  474. {
  475. menu_destroy(menu);
  476. return PLUGIN_HANDLED;
  477. }
  478.  
  479. new data[6], szName[64];
  480. new access, callback;
  481. menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
  482.  
  483. new tempid = str_to_num(data);
  484.  
  485. if( is_user_alive(tempid) )
  486. {
  487. pontok[tempid] += 10
  488. }
  489. client_cmd(id,"pont_adas")
  490. menu_destroy(menu);
  491. return PLUGIN_HANDLED;
  492. }
  493. public ajandek_1(id)
  494. {
  495. new penz = get_pcvar_num(ajandek1);
  496. client_print(id, print_chat, "[AnarChy] %d pont jar mert itt vagy mar 5 perce!", penz)
  497. pontok[id] += penz;
  498. }
  499. public ajandek_2(id)
  500. {
  501. new penz = get_pcvar_num(ajandek2);
  502. client_print(id, print_chat, "[AnarChy] %d pont jar mert itt vagy mar 10 perce!", penz)
  503. pontok[id] += penz;
  504. }
  505. public ajandek_3(id)
  506. {
  507. new penz = get_pcvar_num(ajandek3);
  508. client_print(id, print_chat, "[AnarChy] %d pont jar mert itt vagy mar 30 perce!", penz)
  509. pontok[id] += penz;
  510. }
  511.  
  512. public hud()
  513. {
  514. admin = 0;
  515. new players[32], pnum, tempid
  516. get_players(players, pnum, "c")
  517.  
  518. for( new i; i<pnum; i++ )
  519. {
  520. tempid = players[i]
  521. if(get_user_flags(tempid) & ADMIN_KICK)
  522. {
  523. admin++;
  524. }
  525.  
  526. }
  527. for( new i; i<pnum; i++ )
  528. {
  529. tempid = players[i]
  530. set_hudmessage(0, 170, 255, 0.02, 0.2, 0, 1.0, 3.0);
  531. ShowSyncHudMsg(tempid, SyncHudObj, "[Pont: %d]^n[AnarChy KNIFE Adminok: %d]",pontok[tempid],admin)
  532. }
  533. }
  534.  

_________________
My Steam:
KépKép

Ők köszönték meg Golo nek ezt a hozzászólást: kenan93 (2014.08.12. 16:02)
  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 8 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