hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2025.07.04. 15:12



Jelenlévő felhasználók

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

A legtöbb felhasználó (2761 fő) 2025.01.09. 20:06-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot], Majestic-12 [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  [3 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Pontredszer - Javítás
HozzászólásElküldve:2012.08.23. 14:48 
Offline
Őskövület
Avatar

Csatlakozott:2013.01.01. 17:48
Hozzászólások:2441
Megköszönt másnak: 18 alkalommal
Megköszönték neki: 21 alkalommal
Üdv.!

Valaki, akinek van ideje, kijavítaná nekem ezt?
Error,warn:
Kód:
  1. Welcome to the AMX Mod X 1.76-300 Compiler.

  2. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

  3.  

  4. Error: Array must be indexed (variable "-unknown-") on line 63

  5. Warning: Expression has no effect on line 64

  6. Warning: Symbol is assigned a value that is never used: "pont" on line 66

  7. Warning: Loose indentation on line 119

  8. Warning: Loose indentation on line 141

  9. Warning: Loose indentation on line 163

  10. Warning: Loose indentation on line 185

  11. Warning: Loose indentation on line 207

  12. Warning: Loose indentation on line 229

  13. Warning: Loose indentation on line 251

  14. Warning: Loose indentation on line 273

  15. Warning: Loose indentation on line 295

  16. Warning: Loose indentation on line 317

  17. Warning: Loose indentation on line 339

  18. Warning: Loose indentation on line 361

  19. Warning: Loose indentation on line 383

  20. Warning: Loose indentation on line 405

  21. Warning: Loose indentation on line 427

  22.  

  23. 1 Error.

  24.  

  25.  


SMA:
Kód:
  1.  

  2. #include <amxmodx>

  3. #include <amxmisc>

  4. #include <cstrike>

  5. #include <fakemeta>

  6. #include <fun>

  7. #include <colorchat>

  8. #include <dhudmessage>

  9. #include <hamsandwich>

  10. #include <nvault>

  11.  

  12. #define PLUGIN "Pont rendszer"

  13. #define VERZIO "2.3"

  14. #define KESZITO "Oroszrulett."

  15.  

  16.  

  17. #define KEZDOPONT       5

  18. #define KEZDOPONT_VIP   10

  19. #define OLESPONT        2

  20. #define OLESPONT_VIP    5

  21.  

  22. #define BONUSZ1         5

  23. #define BONUSZ2         7

  24. #define BONUSZ3         8

  25.  

  26. #define BONUSZIDO1      180.0

  27. #define BONUSZIDO2      300.0

  28. #define BONUSZIDO3      600.0

  29.  

  30. #define VIPJOG          ADMIN_LEVEL_B

  31.  

  32. #define SZINT_2         50

  33. #define SZINT_2_BONUSZ  10

  34.  

  35.  

  36. new pontok[33]

  37. new r

  38. new g

  39. new b

  40. new playernev[33][32]

  41. new vault

  42.  

  43. public plugin_init() {

  44.         register_plugin(PLUGIN, VERZIO, KESZITO)

  45.         register_clcmd("say /pontok", "kiir_pont")

  46.         register_clcmd("say /pont", "kiir_pont")

  47.         register_clcmd("say /shop", "menu")

  48.         register_clcmd("say /bolt", "menu")

  49.         register_clcmd("say /1000pont", "ad_pont")

  50.        

  51.         register_dictionary("pontrendszer.txt")

  52.         vault = nvault_open("Ponton");

  53.        

  54.         RegisterHam(Ham_Killed,         "player", "fw_player_killed")

  55.        

  56.        

  57. }

  58.  

  59. public ad_pont(id)

  60. {

  61.         if(get_user_flags(id) == ADMIN_BAN)

  62.         {

  63.                 new pont = pontok

  64.                 pontok[id] + 1000

  65.                 client_print(id, print_chat, "[Pontrendszer] +100 Pontot kaptal!")

  66.         }

  67. }

  68.  

  69. public menu(id)

  70. {

  71.         if (cs_get_user_team(id) == CS_TEAM_CT)

  72.         {

  73.                 new menu = menu_create("\yDubStepCity Shop  \w[By Bence98007]","fegyver_menu")

  74.                

  75.                 menu_additem(menu,"\yAK47 Dragon \w|25 pont|","1",0)

  76.                 menu_additem(menu,"\yAnaconda \w|15 pont|","2",0)

  77.                 menu_additem(menu,"\yGitar \w|20 pont|","3",0)

  78.                 menu_additem(menu,"\yKSG-12 \w|25 pont|","4",0)

  79.                 menu_additem(menu,"\yLuger \w|10 pont|","5",0)

  80.                 menu_additem(menu,"\yM4A1 Dragon \w|25 pont|","6",0)

  81.                 menu_additem(menu,"\yMP-7 \w|15 pont|","7",0)

  82.                 menu_additem(menu,"\yWinchester \w|30 pont|","8",0)

  83.                 menu_additem(menu,"\yPKM \w|50 pont|","9",0)

  84.                 menu_additem(menu,"\yMusket \w|16 pont|","10",0)

  85.                 menu_additem(menu,"\ySkull-1 \w|20 pont|","11",0)

  86.                 menu_additem(menu,"\ySkull-7 \w|50 pont|","12",0)

  87.                 menu_additem(menu,"\yXM8 \w|20 pont|","13",0)

  88.                 menu_additem(menu,"\yInfiniti \w|18 pont|","14",0)

  89.                 menu_additem(menu,"\yM95 Sniper Rifle \w|18 pont|","15",0)

  90.                 menu_setprop(menu,MPROP_EXIT,MEXIT_ALL)

  91.                 menu_display(id,menu,0)

  92.         }

  93. }

  94. public fegyver_menu(id,menu,item)

  95. {

  96.        

  97.         if(item==MENU_EXIT)

  98.         {

  99.                 menu_destroy(menu)

  100.                 return PLUGIN_HANDLED

  101.         }

  102.        

  103.         new data[6], iName[64]

  104.         new access, callback

  105.        

  106.         menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

  107.        

  108.         new key = str_to_num(data)

  109.        

  110.         switch(key)

  111.         {

  112.                 case 1 : {

  113.                         if (!is_user_alive(id))

  114.                 {

  115.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  116.                                 return PLUGIN_HANDLED

  117.                 }

  118.                

  119.                 new penz = pontok[id]

  120.                

  121.                 if (penz < 600)

  122.                 {

  123.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  124.                                 return PLUGIN_HANDLED

  125.                 }

  126.                 else

  127.                 {

  128.                                 cs_set_user_money(id, penz -= 25)

  129.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  130.                                 client_cmd(id, "ak47")

  131.                 }

  132.                        

  133.                 }

  134.                 case 2 : {

  135.                         if (!is_user_alive(id))

  136.                 {

  137.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  138.                                 return PLUGIN_HANDLED

  139.                 }

  140.                

  141.                 new penz = pontok[id]

  142.                

  143.                 if (penz < 600)

  144.                 {

  145.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  146.                                 return PLUGIN_HANDLED

  147.                 }

  148.                 else

  149.                 {

  150.                                 cs_set_user_money(id, penz -= 25)

  151.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  152.                                 client_cmd(id, "anaconda")

  153.                 }

  154.                        

  155.                 }

  156.                 case 3 : {

  157.                         if (!is_user_alive(id))

  158.                 {

  159.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  160.                                 return PLUGIN_HANDLED

  161.                 }

  162.                

  163.                 new penz = pontok[id]

  164.                

  165.                 if (penz < 600)

  166.                 {

  167.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  168.                                 return PLUGIN_HANDLED

  169.                 }

  170.                 else

  171.                 {

  172.                                 cs_set_user_money(id, penz -= 25)

  173.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  174.                                 client_cmd(id, "gitar")

  175.                 }

  176.                        

  177.                 }

  178.                 case 4 : {

  179.                         if (!is_user_alive(id))

  180.                 {

  181.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  182.                                 return PLUGIN_HANDLED

  183.                 }

  184.                

  185.                 new penz = pontok[id]

  186.                

  187.                 if (penz < 600)

  188.                 {

  189.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  190.                                 return PLUGIN_HANDLED

  191.                 }

  192.                 else

  193.                 {

  194.                                 cs_set_user_money(id, penz -= 25)

  195.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  196.                                 client_cmd(id, "ksg")

  197.                 }

  198.                        

  199.                 }

  200.                 case 5 : {

  201.                         if (!is_user_alive(id))

  202.                 {

  203.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  204.                                 return PLUGIN_HANDLED

  205.                 }

  206.                

  207.                 new penz = pontok[id]

  208.                

  209.                 if (penz < 600)

  210.                 {

  211.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  212.                                 return PLUGIN_HANDLED

  213.                 }

  214.                 else

  215.                 {

  216.                                 cs_set_user_money(id, penz -= 25)

  217.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  218.                                 client_cmd(id, "lug")

  219.                 }

  220.                        

  221.                 }

  222.                 case 6 : {

  223.                         if (!is_user_alive(id))

  224.                 {

  225.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  226.                                 return PLUGIN_HANDLED

  227.                 }

  228.                

  229.                 new penz = pontok[id]

  230.                

  231.                 if (penz < 600)

  232.                 {

  233.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  234.                                 return PLUGIN_HANDLED

  235.                 }

  236.                 else

  237.                 {

  238.                                 cs_set_user_money(id, penz -= 25)

  239.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  240.                                 client_cmd(id, "m4")

  241.                 }

  242.                        

  243.                 }

  244.                 case 7 : {

  245.                         if (!is_user_alive(id))

  246.                 {

  247.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  248.                                 return PLUGIN_HANDLED

  249.                 }

  250.                

  251.                 new penz = pontok[id]

  252.                

  253.                 if (penz < 600)

  254.                 {

  255.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  256.                                 return PLUGIN_HANDLED

  257.                 }

  258.                 else

  259.                 {

  260.                                 cs_set_user_money(id, penz -= 25)

  261.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  262.                                 client_cmd(id, "mp7")

  263.                 }

  264.                        

  265.                 }

  266.                 case 8 : {

  267.                         if (!is_user_alive(id))

  268.                 {

  269.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  270.                                 return PLUGIN_HANDLED

  271.                 }

  272.                

  273.                 new penz = pontok[id]

  274.                

  275.                 if (penz < 600)

  276.                 {

  277.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  278.                                 return PLUGIN_HANDLED

  279.                 }

  280.                 else

  281.                 {

  282.                                 cs_set_user_money(id, penz -= 25)

  283.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  284.                                 client_cmd(id, "win")

  285.                 }

  286.                        

  287.                 }

  288.                 case 9 : {

  289.                         if (!is_user_alive(id))

  290.                 {

  291.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  292.                                 return PLUGIN_HANDLED

  293.                 }

  294.                

  295.                 new penz = pontok[id]

  296.                

  297.                 if (penz < 600)

  298.                 {

  299.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  300.                                 return PLUGIN_HANDLED

  301.                 }

  302.                 else

  303.                 {

  304.                                 cs_set_user_money(id, penz -= 25)

  305.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  306.                                 client_cmd(id, "pkm")

  307.                 }

  308.                        

  309.                 }

  310.                 case 10 : {

  311.                         if (!is_user_alive(id))

  312.                 {

  313.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  314.                                 return PLUGIN_HANDLED

  315.                 }

  316.                

  317.                 new penz = pontok[id]

  318.                

  319.                 if (penz < 600)

  320.                 {

  321.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  322.                                 return PLUGIN_HANDLED

  323.                 }

  324.                 else

  325.                 {

  326.                                 cs_set_user_money(id, penz -= 25)

  327.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  328.                                 client_cmd(id, "musket")

  329.                 }

  330.                        

  331.                 }

  332.                 case 11 : {

  333.                         if (!is_user_alive(id))

  334.                 {

  335.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  336.                                 return PLUGIN_HANDLED

  337.                 }

  338.                

  339.                 new penz = pontok[id]

  340.                

  341.                 if (penz < 600)

  342.                 {

  343.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  344.                                 return PLUGIN_HANDLED

  345.                 }

  346.                 else

  347.                 {

  348.                                 cs_set_user_money(id, penz -= 25)

  349.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  350.                                 client_cmd(id, "skull1")

  351.                 }

  352.                        

  353.                 }

  354.                 case 12 : {

  355.                         if (!is_user_alive(id))

  356.                 {

  357.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  358.                                 return PLUGIN_HANDLED

  359.                 }

  360.                

  361.                 new penz = pontok[id]

  362.                

  363.                 if (penz < 600)

  364.                 {

  365.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  366.                                 return PLUGIN_HANDLED

  367.                 }

  368.                 else

  369.                 {

  370.                                 cs_set_user_money(id, penz -= 25)

  371.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  372.                                 client_cmd(id, "skull7")

  373.                 }

  374.                        

  375.                 }

  376.                 case 13 : {

  377.                         if (!is_user_alive(id))

  378.                 {

  379.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  380.                                 return PLUGIN_HANDLED

  381.                 }

  382.                

  383.                 new penz = pontok[id]

  384.                

  385.                 if (penz < 600)

  386.                 {

  387.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  388.                                 return PLUGIN_HANDLED

  389.                 }

  390.                 else

  391.                 {

  392.                                 cs_set_user_money(id, penz -= 25)

  393.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  394.                                 client_cmd(id, "xm8")

  395.                 }

  396.                        

  397.                 }

  398.                 case 14 : {

  399.                         if (!is_user_alive(id))

  400.                 {

  401.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  402.                                 return PLUGIN_HANDLED

  403.                 }

  404.                

  405.                 new penz = pontok[id]

  406.                

  407.                 if (penz < 600)

  408.                 {

  409.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  410.                                 return PLUGIN_HANDLED

  411.                 }

  412.                 else

  413.                 {

  414.                                 cs_set_user_money(id, penz -= 25)

  415.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  416.                                 client_cmd(id, "infi")

  417.                 }

  418.                        

  419.                 }

  420.                 case 15 : {

  421.                         if (!is_user_alive(id))

  422.                 {

  423.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  424.                                 return PLUGIN_HANDLED

  425.                 }

  426.                

  427.                 new penz = pontok[id]

  428.                

  429.                 if (penz < 600)

  430.                 {

  431.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  432.                                 return PLUGIN_HANDLED

  433.                 }

  434.                 else

  435.                 {

  436.                                 cs_set_user_money(id, penz -= 25)

  437.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  438.                                 client_cmd(id, "m95")

  439.                 }

  440.                        

  441.                 }

  442.         }

  443.         return PLUGIN_HANDLED

  444. }  

  445.  

  446. public client_putinserver( id )

  447. {

  448.         get_user_name(id, playernev[id], 31)

  449.         Betoltes(id)

  450.         set_task(5.0, "kiir_hud_pont", id)

  451.         set_task(5.1, "kiir_chat_info", id)    

  452.        

  453.         //Ido bonusz

  454.         set_task(BONUSZIDO1, "bonusz_1", id)

  455.         set_task(BONUSZIDO2, "bonusz_2", id)

  456.         set_task(BONUSZIDO3, "bonusz_3", id)

  457. }

  458. public client_disconnect(id)

  459. {

  460.         Mentes(id)

  461.         pontok[id] = 0

  462. }

  463. public bonusz_1( id )

  464. {

  465.         pontok[id] += BONUSZ1

  466.         ColorChat(id, GREEN, "%L", LANG_PLAYER, "BONUSZ_1", BONUSZ1, BONUSZIDO1)

  467. }

  468. public bonusz_2( id )

  469. {

  470.         pontok[id] += BONUSZ2

  471.         ColorChat(id, GREEN, "%L", LANG_PLAYER, "BONUSZ_2", BONUSZ2, BONUSZIDO1)

  472. }

  473. public bonusz_3( id )

  474. {

  475.         pontok[id] += BONUSZ3

  476.         ColorChat(id, GREEN, "%L", LANG_PLAYER, "BONUSZ_3", BONUSZ3, BONUSZIDO1)

  477. }

  478.  

  479. public kiir_hud_pont( id )

  480. {

  481.         r = random_num(50, 256)

  482.         g = random_num(50, 256)

  483.         b = random_num(50, 256)

  484.         set_dhudmessage(r, g, b, 0.7,-1.0, 0, 6.0, 12.0)

  485.         show_dhudmessage(id, "%L", LANG_PLAYER, "PONTOK_HUD", pontok[id])

  486. }

  487.  

  488. public kiir_chat_info( id )

  489. {

  490.         ColorChat(id, GREEN, "%L", LANG_PLAYER, "INFO_CHAT_1")

  491.         ColorChat(id, GREEN, "%L", LANG_PLAYER, "INFO_CHAT_2")

  492. }

  493.  

  494. public kiir_pont( id )

  495. {

  496.         ColorChat(id, GREEN, "%L", LANG_PLAYER, "PONTOK_CHAT", pontok[id])

  497. }

  498.  

  499.  

  500. public fw_player_killed(victim, attacker, shouldgib, id)

  501. {

  502.         if(get_user_flags(id, VIPJOG))

  503.         {

  504.                 pontok[attacker] += OLESPONT_VIP

  505.                 ColorChat(attacker, GREEN, "%L", LANG_PLAYER, "OLES", OLESPONT_VIP)

  506.                

  507.                 if(pontok[id] >= SZINT_2)

  508.                 {      

  509.                         new name[33]

  510.                         get_user_name(id, name, 31)

  511.                         ColorChat(0, RED, "%L", LANG_PLAYER, "SZINTLEPES", name, SZINT_2_BONUSZ)

  512.                         pontok[id] += SZINT_2_BONUSZ

  513.                 }      

  514.                 }else{

  515.                 pontok[attacker] += OLESPONT

  516.                 ColorChat(attacker, GREEN, "%L", LANG_PLAYER, "OLES", OLESPONT)

  517.         }

  518. }

  519.  

  520. public Mentes(id)

  521. {

  522.         new vaultkey[128],vaultdata[256];

  523.         format(vaultkey, charsmax(vaultkey),"%s-pont", playernev[id]);

  524.         format(vaultdata, charsmax(vaultdata),"%i", pontok[id]);

  525.         nvault_set(vault,vaultkey,vaultdata);

  526.        

  527.         return PLUGIN_CONTINUE;

  528. }

  529.  

  530. public Betoltes(id)

  531. {

  532.         new vaultkey[128],vaultdata[256];

  533.         format(vaultkey, charsmax(vaultkey),"%s-pont", playernev[id]);

  534.         nvault_get(vault,vaultkey,vaultdata,255)

  535.        

  536.         pontok[id] = (str_to_num(vaultdata)>KEZDOPONT)?str_to_num(vaultdata):KEZDOPONT;

  537.        

  538.         return PLUGIN_CONTINUE;

  539. }

  540.  


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Pontredszer - Javítás
HozzászólásElküldve:2012.08.23. 15:09 
Offline
Félisten

Csatlakozott:2012.01.07. 21:10
Hozzászólások:850
Megköszönt másnak: 9 alkalommal
Megköszönték neki: 154 alkalommal
63. sort töröld.

_________________
Megköszönni nem szégyen!
Csak kattints a Kép jelre. --->


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Pontredszer - Javítás
HozzászólásElküldve:2012.08.23. 15:13 
Offline
Őskövület
Avatar

Csatlakozott:2012.02.27. 09:42
Hozzászólások:2588
Megköszönt másnak: 26 alkalommal
Megköszönték neki: 418 alkalommal
Kód:
  1.  

  2. #include <amxmodx>

  3. #include <amxmisc>

  4. #include <cstrike>

  5. #include <fakemeta>

  6. #include <fun>

  7. #include <colorchat>

  8. #include <dhudmessage>

  9. #include <hamsandwich>

  10. #include <nvault>

  11.  

  12. #define PLUGIN "Pont rendszer"

  13. #define VERZIO "2.3"

  14. #define KESZITO "Oroszrulett."

  15.  

  16.  

  17. #define KEZDOPONT       5

  18. #define KEZDOPONT_VIP   10

  19. #define OLESPONT        2

  20. #define OLESPONT_VIP    5

  21.  

  22. #define BONUSZ1         5

  23. #define BONUSZ2         7

  24. #define BONUSZ3         8

  25.  

  26. #define BONUSZIDO1      180.0

  27. #define BONUSZIDO2      300.0

  28. #define BONUSZIDO3      600.0

  29.  

  30. #define VIPJOG          ADMIN_LEVEL_B

  31.  

  32. #define SZINT_2         50

  33. #define SZINT_2_BONUSZ  10

  34.  

  35.  

  36. new pontok[33]

  37. new r

  38. new g

  39. new b

  40. new playernev[33][32]

  41. new vault

  42.  

  43. public plugin_init() {

  44.         register_plugin(PLUGIN, VERZIO, KESZITO)

  45.         register_clcmd("say /pontok", "kiir_pont")

  46.         register_clcmd("say /pont", "kiir_pont")

  47.         register_clcmd("say /shop", "menu")

  48.         register_clcmd("say /bolt", "menu")

  49.         register_clcmd("say /1000pont", "ad_pont")

  50.        

  51.         register_dictionary("pontrendszer.txt")

  52.         vault = nvault_open("Ponton");

  53.        

  54.         RegisterHam(Ham_Killed,         "player", "fw_player_killed")

  55.        

  56.        

  57. }

  58.  

  59. public ad_pont(id)

  60. {

  61.         if(get_user_flags(id) == ADMIN_BAN)

  62.         {

  63.                

  64.                 pontok[id] + 1000

  65.                 client_print(id, print_chat, "[Pontrendszer] +1000 Pontot kaptal!")

  66.         }

  67. }

  68.  

  69. public menu(id)

  70. {

  71.         if (cs_get_user_team(id) == CS_TEAM_CT)

  72.         {

  73.                 new menu = menu_create("\yDubStepCity Shop  \w[By Bence98007]","fegyver_menu")

  74.                

  75.                 menu_additem(menu,"\yAK47 Dragon \w|25 pont|","1",0)

  76.                 menu_additem(menu,"\yAnaconda \w|15 pont|","2",0)

  77.                 menu_additem(menu,"\yGitar \w|20 pont|","3",0)

  78.                 menu_additem(menu,"\yKSG-12 \w|25 pont|","4",0)

  79.                 menu_additem(menu,"\yLuger \w|10 pont|","5",0)

  80.                 menu_additem(menu,"\yM4A1 Dragon \w|25 pont|","6",0)

  81.                 menu_additem(menu,"\yMP-7 \w|15 pont|","7",0)

  82.                 menu_additem(menu,"\yWinchester \w|30 pont|","8",0)

  83.                 menu_additem(menu,"\yPKM \w|50 pont|","9",0)

  84.                 menu_additem(menu,"\yMusket \w|16 pont|","10",0)

  85.                 menu_additem(menu,"\ySkull-1 \w|20 pont|","11",0)

  86.                 menu_additem(menu,"\ySkull-7 \w|50 pont|","12",0)

  87.                 menu_additem(menu,"\yXM8 \w|20 pont|","13",0)

  88.                 menu_additem(menu,"\yInfiniti \w|18 pont|","14",0)

  89.                 menu_additem(menu,"\yM95 Sniper Rifle \w|18 pont|","15",0)

  90.                 menu_setprop(menu,MPROP_EXIT,MEXIT_ALL)

  91.                 menu_display(id,menu,0)

  92.         }

  93. }

  94. public fegyver_menu(id,menu,item)

  95. {

  96.        

  97.         if(item==MENU_EXIT)

  98.         {

  99.                 menu_destroy(menu)

  100.                 return PLUGIN_HANDLED

  101.         }

  102.        

  103.         new data[6], iName[64]

  104.         new access, callback

  105.        

  106.         menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

  107.        

  108.         new key = str_to_num(data)

  109.        

  110.         switch(key)

  111.         {

  112.                 case 1 : {

  113.                         if (!is_user_alive(id))

  114.                 {

  115.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  116.                                 return PLUGIN_HANDLED

  117.                 }

  118.                

  119.                 new penz = pontok[id]

  120.                

  121.                 if (penz < 600)

  122.                 {

  123.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  124.                                 return PLUGIN_HANDLED

  125.                 }

  126.                 else

  127.                 {

  128.                                 cs_set_user_money(id, penz -= 25)

  129.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  130.                                 client_cmd(id, "ak47")

  131.                 }

  132.                        

  133.                 }

  134.                 case 2 : {

  135.                         if (!is_user_alive(id))

  136.                 {

  137.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  138.                                 return PLUGIN_HANDLED

  139.                 }

  140.                

  141.                 new penz = pontok[id]

  142.                

  143.                 if (penz < 600)

  144.                 {

  145.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  146.                                 return PLUGIN_HANDLED

  147.                 }

  148.                 else

  149.                 {

  150.                                 cs_set_user_money(id, penz -= 25)

  151.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  152.                                 client_cmd(id, "anaconda")

  153.                 }

  154.                        

  155.                 }

  156.                 case 3 : {

  157.                         if (!is_user_alive(id))

  158.                 {

  159.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  160.                                 return PLUGIN_HANDLED

  161.                 }

  162.                

  163.                 new penz = pontok[id]

  164.                

  165.                 if (penz < 600)

  166.                 {

  167.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  168.                                 return PLUGIN_HANDLED

  169.                 }

  170.                 else

  171.                 {

  172.                                 cs_set_user_money(id, penz -= 25)

  173.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  174.                                 client_cmd(id, "gitar")

  175.                 }

  176.                        

  177.                 }

  178.                 case 4 : {

  179.                         if (!is_user_alive(id))

  180.                 {

  181.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  182.                                 return PLUGIN_HANDLED

  183.                 }

  184.                

  185.                 new penz = pontok[id]

  186.                

  187.                 if (penz < 600)

  188.                 {

  189.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  190.                                 return PLUGIN_HANDLED

  191.                 }

  192.                 else

  193.                 {

  194.                                 cs_set_user_money(id, penz -= 25)

  195.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  196.                                 client_cmd(id, "ksg")

  197.                 }

  198.                        

  199.                 }

  200.                 case 5 : {

  201.                         if (!is_user_alive(id))

  202.                 {

  203.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  204.                                 return PLUGIN_HANDLED

  205.                 }

  206.                

  207.                 new penz = pontok[id]

  208.                

  209.                 if (penz < 600)

  210.                 {

  211.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  212.                                 return PLUGIN_HANDLED

  213.                 }

  214.                 else

  215.                 {

  216.                                 cs_set_user_money(id, penz -= 25)

  217.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  218.                                 client_cmd(id, "lug")

  219.                 }

  220.                        

  221.                 }

  222.                 case 6 : {

  223.                         if (!is_user_alive(id))

  224.                 {

  225.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  226.                                 return PLUGIN_HANDLED

  227.                 }

  228.                

  229.                 new penz = pontok[id]

  230.                

  231.                 if (penz < 600)

  232.                 {

  233.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  234.                                 return PLUGIN_HANDLED

  235.                 }

  236.                 else

  237.                 {

  238.                                 cs_set_user_money(id, penz -= 25)

  239.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  240.                                 client_cmd(id, "m4")

  241.                 }

  242.                        

  243.                 }

  244.                 case 7 : {

  245.                         if (!is_user_alive(id))

  246.                 {

  247.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  248.                                 return PLUGIN_HANDLED

  249.                 }

  250.                

  251.                 new penz = pontok[id]

  252.                

  253.                 if (penz < 600)

  254.                 {

  255.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  256.                                 return PLUGIN_HANDLED

  257.                 }

  258.                 else

  259.                 {

  260.                                 cs_set_user_money(id, penz -= 25)

  261.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  262.                                 client_cmd(id, "mp7")

  263.                 }

  264.                        

  265.                 }

  266.                 case 8 : {

  267.                         if (!is_user_alive(id))

  268.                 {

  269.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  270.                                 return PLUGIN_HANDLED

  271.                 }

  272.                

  273.                 new penz = pontok[id]

  274.                

  275.                 if (penz < 600)

  276.                 {

  277.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  278.                                 return PLUGIN_HANDLED

  279.                 }

  280.                 else

  281.                 {

  282.                                 cs_set_user_money(id, penz -= 25)

  283.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  284.                                 client_cmd(id, "win")

  285.                 }

  286.                        

  287.                 }

  288.                 case 9 : {

  289.                         if (!is_user_alive(id))

  290.                 {

  291.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  292.                                 return PLUGIN_HANDLED

  293.                 }

  294.                

  295.                 new penz = pontok[id]

  296.                

  297.                 if (penz < 600)

  298.                 {

  299.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  300.                                 return PLUGIN_HANDLED

  301.                 }

  302.                 else

  303.                 {

  304.                                 cs_set_user_money(id, penz -= 25)

  305.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  306.                                 client_cmd(id, "pkm")

  307.                 }

  308.                        

  309.                 }

  310.                 case 10 : {

  311.                         if (!is_user_alive(id))

  312.                 {

  313.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  314.                                 return PLUGIN_HANDLED

  315.                 }

  316.                

  317.                 new penz = pontok[id]

  318.                

  319.                 if (penz < 600)

  320.                 {

  321.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  322.                                 return PLUGIN_HANDLED

  323.                 }

  324.                 else

  325.                 {

  326.                                 cs_set_user_money(id, penz -= 25)

  327.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  328.                                 client_cmd(id, "musket")

  329.                 }

  330.                        

  331.                 }

  332.                 case 11 : {

  333.                         if (!is_user_alive(id))

  334.                 {

  335.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  336.                                 return PLUGIN_HANDLED

  337.                 }

  338.                

  339.                 new penz = pontok[id]

  340.                

  341.                 if (penz < 600)

  342.                 {

  343.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  344.                                 return PLUGIN_HANDLED

  345.                 }

  346.                 else

  347.                 {

  348.                                 cs_set_user_money(id, penz -= 25)

  349.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  350.                                 client_cmd(id, "skull1")

  351.                 }

  352.                        

  353.                 }

  354.                 case 12 : {

  355.                         if (!is_user_alive(id))

  356.                 {

  357.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  358.                                 return PLUGIN_HANDLED

  359.                 }

  360.                

  361.                 new penz = pontok[id]

  362.                

  363.                 if (penz < 600)

  364.                 {

  365.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  366.                                 return PLUGIN_HANDLED

  367.                 }

  368.                 else

  369.                 {

  370.                                 cs_set_user_money(id, penz -= 25)

  371.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  372.                                 client_cmd(id, "skull7")

  373.                 }

  374.                        

  375.                 }

  376.                 case 13 : {

  377.                         if (!is_user_alive(id))

  378.                 {

  379.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  380.                                 return PLUGIN_HANDLED

  381.                 }

  382.                

  383.                 new penz = pontok[id]

  384.                

  385.                 if (penz < 600)

  386.                 {

  387.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  388.                                 return PLUGIN_HANDLED

  389.                 }

  390.                 else

  391.                 {

  392.                                 cs_set_user_money(id, penz -= 25)

  393.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  394.                                 client_cmd(id, "xm8")

  395.                 }

  396.                        

  397.                 }

  398.                 case 14 : {

  399.                         if (!is_user_alive(id))

  400.                 {

  401.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  402.                                 return PLUGIN_HANDLED

  403.                 }

  404.                

  405.                 new penz = pontok[id]

  406.                

  407.                 if (penz < 600)

  408.                 {

  409.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  410.                                 return PLUGIN_HANDLED

  411.                 }

  412.                 else

  413.                 {

  414.                                 cs_set_user_money(id, penz -= 25)

  415.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  416.                                 client_cmd(id, "infi")

  417.                 }

  418.                        

  419.                 }

  420.                 case 15 : {

  421.                         if (!is_user_alive(id))

  422.                 {

  423.                                 client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")

  424.                                 return PLUGIN_HANDLED

  425.                 }

  426.                

  427.                 new penz = pontok[id]

  428.                

  429.                 if (penz < 600)

  430.                 {

  431.                                 client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")

  432.                                 return PLUGIN_HANDLED

  433.                 }

  434.                 else

  435.                 {

  436.                                 cs_set_user_money(id, penz -= 25)

  437.                                 client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")

  438.                                 client_cmd(id, "m95")

  439.                 }

  440.                        

  441.                 }

  442.         }

  443.         return PLUGIN_HANDLED

  444. }  

  445.  

  446. public client_putinserver( id )

  447. {

  448.         get_user_name(id, playernev[id], 31)

  449.         Betoltes(id)

  450.         set_task(5.0, "kiir_hud_pont", id)

  451.         set_task(5.1, "kiir_chat_info", id)    

  452.        

  453.         //Ido bonusz

  454.         set_task(BONUSZIDO1, "bonusz_1", id)

  455.         set_task(BONUSZIDO2, "bonusz_2", id)

  456.         set_task(BONUSZIDO3, "bonusz_3", id)

  457. }

  458. public client_disconnect(id)

  459. {

  460.         Mentes(id)

  461.         pontok[id] = 0

  462. }

  463. public bonusz_1( id )

  464. {

  465.         pontok[id] += BONUSZ1

  466.         ColorChat(id, GREEN, "%L", LANG_PLAYER, "BONUSZ_1", BONUSZ1, BONUSZIDO1)

  467. }

  468. public bonusz_2( id )

  469. {

  470.         pontok[id] += BONUSZ2

  471.         ColorChat(id, GREEN, "%L", LANG_PLAYER, "BONUSZ_2", BONUSZ2, BONUSZIDO1)

  472. }

  473. public bonusz_3( id )

  474. {

  475.         pontok[id] += BONUSZ3

  476.         ColorChat(id, GREEN, "%L", LANG_PLAYER, "BONUSZ_3", BONUSZ3, BONUSZIDO1)

  477. }

  478.  

  479. public kiir_hud_pont( id )

  480. {

  481.         r = random_num(50, 256)

  482.         g = random_num(50, 256)

  483.         b = random_num(50, 256)

  484.         set_dhudmessage(r, g, b, 0.7,-1.0, 0, 6.0, 12.0)

  485.         show_dhudmessage(id, "%L", LANG_PLAYER, "PONTOK_HUD", pontok[id])

  486. }

  487.  

  488. public kiir_chat_info( id )

  489. {

  490.         ColorChat(id, GREEN, "%L", LANG_PLAYER, "INFO_CHAT_1")

  491.         ColorChat(id, GREEN, "%L", LANG_PLAYER, "INFO_CHAT_2")

  492. }

  493.  

  494. public kiir_pont( id )

  495. {

  496.         ColorChat(id, GREEN, "%L", LANG_PLAYER, "PONTOK_CHAT", pontok[id])

  497. }

  498.  

  499.  

  500. public fw_player_killed(victim, attacker, shouldgib, id)

  501. {

  502.         if(get_user_flags(id, VIPJOG))

  503.         {

  504.                 pontok[attacker] += OLESPONT_VIP

  505.                 ColorChat(attacker, GREEN, "%L", LANG_PLAYER, "OLES", OLESPONT_VIP)

  506.                

  507.                 if(pontok[id] >= SZINT_2)

  508.                 {      

  509.                         new name[33]

  510.                         get_user_name(id, name, 31)

  511.                         ColorChat(0, RED, "%L", LANG_PLAYER, "SZINTLEPES", name, SZINT_2_BONUSZ)

  512.                         pontok[id] += SZINT_2_BONUSZ

  513.                 }      

  514.                 }else{

  515.                 pontok[attacker] += OLESPONT

  516.                 ColorChat(attacker, GREEN, "%L", LANG_PLAYER, "OLES", OLESPONT)

  517.         }

  518. }

  519.  

  520. public Mentes(id)

  521. {

  522.         new vaultkey[128],vaultdata[256];

  523.         format(vaultkey, charsmax(vaultkey),"%s-pont", playernev[id]);

  524.         format(vaultdata, charsmax(vaultdata),"%i", pontok[id]);

  525.         nvault_set(vault,vaultkey,vaultdata);

  526.        

  527.         return PLUGIN_CONTINUE;

  528. }

  529.  

  530. public Betoltes(id)

  531. {

  532.         new vaultkey[128],vaultdata[256];

  533.         format(vaultkey, charsmax(vaultkey),"%s-pont", playernev[id]);

  534.         nvault_get(vault,vaultkey,vaultdata,255)

  535.        

  536.         pontok[id] = (str_to_num(vaultdata)>KEZDOPONT)?str_to_num(vaultdata):KEZDOPONT;

  537.        

  538.         return PLUGIN_CONTINUE;

  539. }

  540.  

_________________
Kép


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  [3 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 4 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