hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.11. 11:01



Jelenlévő felhasználók

Jelenleg 545 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 545 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 | nem működik a bolt
HozzászólásElküldve: 2016.12.27. 16:59 
Offline
Tud valamit
Avatar

Csatlakozott: 2012.04.13. 14:37
Hozzászólások: 123
Megköszönt másnak: 8 alkalommal
Megköszönték neki: 3 alkalommal
Sziasztok!

Surf Pontrendszer

A fentebb linkelt pluginnal lenne egy kis problémám. Beteszek szépen mindent a helyére, elvileg minden fut is, gyakorlatilag a vásárlás menü(bolt) nem nyílik meg.

Valaki tud valami megoldást? Válaszokat előre is köszi:)


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Pontrendszer | nem működik a bolt
HozzászólásElküldve: 2016.12.28. 19:59 
Offline
Tiszteletbeli
Avatar

Csatlakozott: 2015.03.11. 20:11
Hozzászólások: 915
Megköszönt másnak: 52 alkalommal
Megköszönték neki: 317 alkalommal
http://prnt.sc/dozo7e
  1. // Includes
  2. // --- #include <xs> not needed!
  3. #define _xs_included
  4.  
  5. #include <amxmodx>
  6. #include <amxmisc>
  7. #include <hamsandwich>
  8. #include <fakemeta_util>
  9. #include <cstrike>
  10. /*
  11.     Surf Olympics Points System,
  12.     (c) Hatrick,
  13.    
  14.     surf.inc file
  15.     Location: "$moddir\cstrike\addons\amxmodx\scripting\include\"
  16. */
  17.  
  18. #if defined _surf_included
  19.   #endinput
  20. #endif
  21. #define _surf_included
  22.  
  23.  
  24. /**
  25.  * Get user points
  26.  *
  27.  */
  28. native surf_get_user_points(index);
  29.  
  30. /**
  31.  * Set user points
  32.  *
  33.  */
  34. native surf_set_user_points(index, amount);
  35.  
  36. /**
  37.  * Add user points
  38.  *
  39.  */
  40. native surf_add_user_points(index, amount);
  41.  
  42. /**
  43.  * Delete user points
  44.  *
  45.  */
  46. native surf_del_user_points(index, amount);
  47.  
  48. // Pragma
  49. #pragma semicolon 1
  50.  
  51. // Plugin info
  52. new const PLUGIN[] =    "Surf Buy";
  53. new const VERSION[] =   "1.0";
  54. new const AUTHOR[] =    "Hattrick";
  55.  
  56. // Customization
  57. new const xPrefix[] =   "!g[Surf Pontrendszer]";
  58. new const ConfigFile[] = "addons/amxmodx/configs/surf_buy.cfg";
  59.  
  60. // Unlimited clip offsets
  61. #if cellbits == 32
  62.     const OFFSET_CLIPAMMO = 51;
  63. #else
  64.     const OFFSET_CLIPAMMO = 65;
  65. #endif
  66. const OFFSET_LINUX_WEAPONS = 4;
  67.  
  68. // Maxclip const
  69. new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 };
  70.  
  71. // Entities list
  72. new entlist[][] = { "func_button", "trigger_multiple", "trigger_once" };
  73.  
  74. // Cvars
  75. new cvar_health1_cost, cvar_speed_cost, cvar_gravity_cost, cvar_invisibility_cost, cvar_moneys_cost, cvar_damage_cost, cvar_noclip_cost, cvar_godmode_cost,
  76. cvar_health2_cost, cvar_unlimitedclip_cost, cvar_jail_cost, cvar_shotguns_cost,
  77. cvar_health1_cost2, cvar_speed_cost2, cvar_gravity_cost2, cvar_invisibility_cost2, cvar_moneys_cost2, cvar_damage_cost2, cvar_noclip_cost2, cvar_godmode_cost2,
  78. cvar_health2_cost2, cvar_unlimitedclip_cost2, cvar_jail_cost2, cvar_shotguns_cost2;
  79.  
  80. // Bools
  81. new bool:b_Speed[33], bool:b_Invisibility[33], bool:b_Damage[33], bool:b_Noclip[33], bool:b_Godmode[33],
  82. bool:b_Unlimitedclip[33], b_Spawns[33], g_GodmodeCount[33], g_NoclipCount[33], bool:b_Gravity[33], bool:b_Shotguns[33];
  83.  
  84. // Init
  85. public plugin_init()
  86. {
  87.     // Register the plugin
  88.     register_plugin(PLUGIN, VERSION, AUTHOR);
  89.    
  90.     // Register the plugin dictionary
  91.     register_dictionary("surf_buy.txt");
  92.    
  93.     // Register the plugins events
  94.     register_event("CurWeapon", "event_CurWeapon", "be", "1=1");
  95.    
  96.     // Client commands
  97.     register_clcmd("say /menu", "command_Buy");
  98.     register_clcmd("say menu", "command_Buy");
  99.     register_clcmd("say /shop", "command_Buy");
  100.     register_clcmd("say shop", "command_Buy");
  101.    
  102.     // Menu commands
  103.     register_menucmd(register_menuid("aaaxMenu1"), 1023, "BuyMenu");
  104.     register_menucmd(register_menuid("bbbxMenu2"), 1023, "BuyMenu2");
  105.    
  106.     // Messages
  107.     register_message(get_user_msgid("CurWeapon"), "message_cur_weapon");
  108.  
  109.     // Plugin cvars
  110.     cvar_health1_cost = register_cvar("surf_health1_cost", "3");
  111.     cvar_speed_cost = register_cvar("surf_speed_cost", "3");
  112.     cvar_gravity_cost = register_cvar("surf_gravity_cost", "3");
  113.     cvar_invisibility_cost = register_cvar("surf_invisibility_cost", "4");
  114.     cvar_moneys_cost = register_cvar("surf_moneys_cost", "4");
  115.     cvar_damage_cost = register_cvar("surf_damage_cost", "5");
  116.     cvar_noclip_cost = register_cvar("surf_noclip_cost", "7");
  117.     cvar_godmode_cost = register_cvar("surf_godmode_cost", "7");
  118.     cvar_health2_cost = register_cvar("surf_health2_cost", "8");
  119.     cvar_unlimitedclip_cost = register_cvar("surf_unlimitedclip_cost", "8");
  120.     cvar_jail_cost = register_cvar("surf_jail_cost", "3");
  121.     cvar_shotguns_cost = register_cvar("surf_shotguns_cost", "8");
  122.     cvar_health1_cost2 = register_cvar("surf_health1_cost2", "1500");
  123.     cvar_speed_cost2 = register_cvar("surf_speed_cost2", "1750");
  124.     cvar_gravity_cost2 = register_cvar("surf_gravity_cost2", "1500");
  125.     cvar_invisibility_cost2 = register_cvar("surf_invisibility_cost2", "2000");
  126.     cvar_moneys_cost2 = register_cvar("surf_moneys_cost2", "10000");
  127.     cvar_damage_cost2 = register_cvar("surf_damage_cost2", "8000");
  128.     cvar_noclip_cost2 = register_cvar("surf_noclip_cost2", "12000");
  129.     cvar_godmode_cost2 = register_cvar("surf_godmode_cost2", "12000");
  130.     cvar_health2_cost2 = register_cvar("surf_health2_cost2", "14500");
  131.     cvar_unlimitedclip_cost2 = register_cvar("surf_unlimitedclip_cost2", "14500");
  132.     cvar_jail_cost2 = register_cvar("surf_jail_cost2", "3750");
  133.     cvar_shotguns_cost2 = register_cvar("surf_shotguns_cost2", "15000");
  134.    
  135.     // Forwards
  136.     RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawned_Post", 1);
  137.     RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage");
  138. }
  139.  
  140. // Public plugin config
  141. public plugin_cfg()
  142. {
  143.     new x[128];
  144.     format(x, 127, "exec %s", ConfigFile);
  145.     server_cmd(x);
  146.     server_exec();
  147. }
  148.  
  149. // Menu format
  150. public command_Buy(id)
  151. {
  152.     // Make menu (2024 max characters)
  153.     new menuBody[2025];
  154.     add(menuBody, 2024, "\ySurf Pontrendszer^n^n");
  155.     add(menuBody, 2024, "\r1.\w Élet \y[+255 HP]^n");
  156.     add(menuBody, 2024, "\r2.\w Sebesség \y[350 Sebesség]^n");
  157.     add(menuBody, 2024, "\r3.\w Gravitáció \y[500 Gravitáció]^n");
  158.     add(menuBody, 2024, "\r4.\w Láthatatlanság \y[100% Láthatatlanság]^n");
  159.     add(menuBody, 2024, "\r5.\w Pénz \y[+12500$]^n");
  160.     add(menuBody, 2024, "\r6.\w Sebzés \y[2x DMG]^n");
  161.     add(menuBody, 2024, "\r7.\w Noclip \y[20 Seconds]^n");
  162.     add(menuBody, 2024, "\r8.\w Isten mód \y[20 Seconds]^n^n");
  163.     add(menuBody, 2024, "\r9.\w Következő^n^n");
  164.     add(menuBody, 2024, "\r0.\w Kilép^n");
  165.    
  166.     // Show menu to player
  167.     show_menu(id, (1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7 | 1<<8 | 1<<9), menuBody, -1, "aaaxMenu1");
  168. }
  169.  
  170. // Menu2 format
  171. public command_Buy2(id)
  172. {
  173.     // Make menu (2024 max characters)
  174.     new menuBody[2025];
  175.     add(menuBody, 2024, "\ySurf Pontrendszer 2^n^n");
  176.     add(menuBody, 2024, "\r1.\w Élet \y[+1000 HP]^n");
  177.     add(menuBody, 2024, "\r2.\w Korlátlan lőszer \y[lőszer]^n");
  178.     add(menuBody, 2024, "\r3.\w Jail nyitása^n");
  179.     add(menuBody, 2024, "\r4.\w ShotGun fegyver \y[M3 & XM1014]^n^n");
  180.     add(menuBody, 2024, "\r9.\w Vissza^n^n");
  181.     add(menuBody, 2024, "\r0.\w Kilépés^n");
  182.    
  183.     // Show menu to player
  184.     show_menu(id, (1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7 | 1<<8 | 1<<9), menuBody, -1, "bbbxMenu2");
  185. }
  186.  
  187. // Buy menu
  188. public BuyMenu(id, key)
  189. {
  190.     // Get the user name
  191.     new name[32];
  192.     get_user_name(id, name, 31);
  193.    
  194.     // Switch the player key
  195.     switch(key)
  196.     {
  197.         // Health +255
  198.         case 0:
  199.         {
  200.             // Has enough points?
  201.             if (surf_get_user_points(id) >= get_pcvar_num(cvar_health1_cost))
  202.             {
  203.                 fm_set_user_health(id, get_user_health(id) + 255);
  204.                 surf_del_user_points(id, get_pcvar_num(cvar_health1_cost));
  205.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "+255 HP");
  206.             }
  207.             // Not has enough points, has enough moneys?
  208.             else if (cs_get_user_money(id) >= get_pcvar_num(cvar_health1_cost2))
  209.             {
  210.                 fm_set_user_health(id, get_user_health(id) + 255);
  211.                 cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_health1_cost2));
  212.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "+255 HP");
  213.             }
  214.             // Not has points, not has moneys... I'm sorry...
  215.             else
  216.             {
  217.                 write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_health1_cost), get_pcvar_num(cvar_health1_cost2));
  218.             }
  219.         }
  220.         // 300 Speed
  221.         case 1:
  222.         {
  223.             // Has enough points?
  224.             if (surf_get_user_points(id) >= get_pcvar_num(cvar_speed_cost))
  225.             {
  226.                 b_Speed[id] = true;
  227.                 surf_del_user_points(id, get_pcvar_num(cvar_speed_cost));
  228.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "300 sebességed");
  229.             }
  230.             // Not has enough points, has enough moneys?
  231.             else if (cs_get_user_money(id) >= get_pcvar_num(cvar_speed_cost2))
  232.             {
  233.                 b_Speed[id] = true;
  234.                 cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_speed_cost2));
  235.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "300 sebességed");
  236.             }
  237.             // Not has points, not has moneys... I'm sorry...
  238.             else
  239.             {
  240.                 write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_speed_cost), get_pcvar_num(cvar_speed_cost2));
  241.             }
  242.         }
  243.         // 500 Gravity
  244.         case 2:
  245.         {
  246.             // Has enough points?
  247.             if (surf_get_user_points(id) >= get_pcvar_num(cvar_gravity_cost))
  248.             {
  249.                 b_Gravity[id] = true;
  250.                 fm_set_user_gravity(id, 0.7);
  251.                 surf_del_user_points(id, get_pcvar_num(cvar_gravity_cost));
  252.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "500+ gravitációd");
  253.             }
  254.             // Not has enough points, has enough moneys?
  255.             else if (cs_get_user_money(id) >= get_pcvar_num(cvar_gravity_cost2))
  256.             {
  257.                 b_Gravity[id] = true;
  258.                 fm_set_user_gravity(id, 0.7);
  259.                 cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_gravity_cost2));
  260.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "500 gravitációd");
  261.             }
  262.             // Not has points, not has moneys... I'm sorry...
  263.             else
  264.             {
  265.                 write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_gravity_cost), get_pcvar_num(cvar_gravity_cost2));
  266.             }
  267.         }
  268.         // 100% Invisibility
  269.         case 3:
  270.         {
  271.             // Has enough points?
  272.             if (surf_get_user_points(id) >= get_pcvar_num(cvar_invisibility_cost))
  273.             {
  274.                 b_Invisibility[id] = true;
  275.                 fm_set_user_rendering(id, kRenderFxHologram, 0, 0, 0, kRenderTransAlpha, 250);
  276.                 surf_del_user_points(id, get_pcvar_num(cvar_invisibility_cost));
  277.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "100% láthatatlanság");
  278.             }
  279.             // Not has enough points, has enough moneys?
  280.             else if (cs_get_user_money(id) >= get_pcvar_num(cvar_invisibility_cost2))
  281.             {
  282.                 b_Invisibility[id] = true;
  283.                 fm_set_user_rendering(id, kRenderFxHologram, 0, 0, 0, kRenderTransAlpha, 250);
  284.                 cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_invisibility_cost2));
  285.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "100% láthatatlanság");
  286.             }
  287.             // Not has points, not has moneys... I'm sorry...
  288.             else
  289.             {
  290.                 write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_invisibility_cost), get_pcvar_num(cvar_invisibility_cost2));
  291.             }
  292.         }
  293.         // 12500$ Moneys
  294.         case 4:
  295.         {
  296.             // Has enough points?
  297.             if (surf_get_user_points(id) >= get_pcvar_num(cvar_moneys_cost))
  298.             {
  299.                 cs_set_user_money(id, cs_get_user_money(id) + 12500);
  300.                 surf_del_user_points(id, get_pcvar_num(cvar_moneys_cost));
  301.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "12500$ dollár");
  302.             }
  303.             // Not has enough points, has enough moneys?
  304.             else if (cs_get_user_money(id) >= get_pcvar_num(cvar_moneys_cost2))
  305.             {
  306.                 cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_moneys_cost2));
  307.                 cs_set_user_money(id, cs_get_user_money(id) + 12500);
  308.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "12500$ dollár");
  309.             }
  310.             // Not has points, not has moneys... I'm sorry...
  311.             else
  312.             {
  313.                 write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_moneys_cost), get_pcvar_num(cvar_moneys_cost2));
  314.             }
  315.         }
  316.         // 2x Damage
  317.         case 5:
  318.         {
  319.             // Has enough points?
  320.             if (surf_get_user_points(id) >= get_pcvar_num(cvar_damage_cost))
  321.             {
  322.                 b_Damage[id] = true;
  323.                 surf_del_user_points(id, get_pcvar_num(cvar_damage_cost));
  324.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "2x sebzés");
  325.             }
  326.             // Not has enough points, has enough moneys?
  327.             else if (cs_get_user_money(id) >= get_pcvar_num(cvar_damage_cost2))
  328.             {
  329.                 b_Damage[id] = true;
  330.                 cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_damage_cost2));
  331.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "2x sebzés");
  332.             }
  333.             // Not has points, not has moneys... I'm sorry...
  334.             else
  335.             {
  336.                 write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_damage_cost), get_pcvar_num(cvar_damage_cost2));
  337.             }
  338.         }
  339.         // Noclip 20 seconds
  340.         case 6:
  341.         {
  342.             // Has enough points?
  343.             if (surf_get_user_points(id) >= get_pcvar_num(cvar_noclip_cost))
  344.             {
  345.                 b_Noclip[id] = true;
  346.                 g_NoclipCount[id] = 19;
  347.                 fm_set_user_noclip(id, 1);
  348.                 surf_del_user_points(id, get_pcvar_num(cvar_noclip_cost));
  349.                 set_task(20.0, "task_RemoveNoclip", id);
  350.                 set_task(1.0, "task_NoclipCountDown", id, _, _, "a", 19);
  351.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "Noclip");
  352.             }
  353.             // Not has enough points, has enough moneys?
  354.             else if (cs_get_user_money(id) >= get_pcvar_num(cvar_noclip_cost2))
  355.             {
  356.                 b_Noclip[id] = true;
  357.                 g_NoclipCount[id] = 19;
  358.                 fm_set_user_noclip(id, 1);
  359.                 cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_noclip_cost2));
  360.                 set_task(20.0, "task_RemoveNoclip", id);
  361.                 set_task(1.0, "task_NoclipCountDown", id, _, _, "a", 19);
  362.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "Noclip");
  363.             }
  364.             // Not has points, not has moneys... I'm sorry...
  365.             else
  366.             {
  367.                 write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_noclip_cost), get_pcvar_num(cvar_noclip_cost2));
  368.             }
  369.         }
  370.         // Godmode 20 seconds
  371.         case 7:
  372.         {
  373.             // Has enough points?
  374.             if (surf_get_user_points(id) >= get_pcvar_num(cvar_godmode_cost))
  375.             {
  376.                 b_Godmode[id] = true;
  377.                 g_GodmodeCount[id] = 19;
  378.                 fm_set_user_godmode(id, 1);
  379.                 surf_del_user_points(id, get_pcvar_num(cvar_godmode_cost));
  380.                 set_task(20.0, "task_RemoveGodmode", id);
  381.                 set_task(1.0, "task_GodmodeCountDown", id, _, _, "a", 19);
  382.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "Istenmód");
  383.             }
  384.             // Not has enough points, has enough moneys?
  385.             else if (cs_get_user_money(id) >= get_pcvar_num(cvar_godmode_cost2))
  386.             {
  387.                 b_Godmode[id] = true;
  388.                 g_GodmodeCount[id] = 19;
  389.                 fm_set_user_godmode(id, 1);
  390.                 cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_godmode_cost2));
  391.                 set_task(20.0, "task_RemoveGodmode", id);
  392.                 set_task(1.0, "task_GodmodeCountDown", id, _, _, "a", 19);
  393.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "Isten mód");
  394.             }
  395.             // Not has points, not has moneys... I'm sorry...
  396.             else
  397.             {
  398.                 write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_godmode_cost), get_pcvar_num(cvar_godmode_cost2));
  399.             }
  400.         }
  401.         case 8:
  402.         {
  403.             command_Buy2(id);
  404.         }
  405.         default:
  406.         {
  407.             return PLUGIN_CONTINUE;
  408.         }
  409.     }
  410.     return PLUGIN_CONTINUE;
  411. }
  412.  
  413. // Buy menu2
  414. public BuyMenu2(id, key)
  415. {
  416.     // Get the user name
  417.     new name[32];
  418.     get_user_name(id, name, 31);
  419.    
  420.     // Switch the player key
  421.     switch(key)
  422.     {
  423.         // Health +1000
  424.         case 0:
  425.         {
  426.             // Has enough points?
  427.             if (surf_get_user_points(id) >= get_pcvar_num(cvar_health2_cost))
  428.             {
  429.                 fm_set_user_health(id, get_user_health(id) + 1000);
  430.                 surf_del_user_points(id, get_pcvar_num(cvar_health2_cost));
  431.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "+1000 HP");
  432.             }
  433.             // Not has enough points, has enough moneys?
  434.             else if (cs_get_user_money(id) >= get_pcvar_num(cvar_health2_cost2))
  435.             {
  436.                 fm_set_user_health(id, get_user_health(id) + 1000);
  437.                 cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_health2_cost2));
  438.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "+1000 HP");
  439.             }
  440.             // Not has points, not has moneys... I'm sorry...
  441.             else
  442.             {
  443.                 write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_health2_cost), get_pcvar_num(cvar_health2_cost2));
  444.             }
  445.         }
  446.         // Unlimited Clip
  447.         case 1:
  448.         {
  449.             // Has enough points?
  450.             if (surf_get_user_points(id) >= get_pcvar_num(cvar_unlimitedclip_cost))
  451.             {
  452.                 b_Unlimitedclip[id] = true;
  453.                 surf_del_user_points(id, get_pcvar_num(cvar_unlimitedclip_cost));
  454.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "végtelen lőszer");
  455.             }
  456.             // Not has enough points, has enough moneys?
  457.             else if (cs_get_user_money(id) >= get_pcvar_num(cvar_unlimitedclip_cost2))
  458.             {
  459.                 b_Unlimitedclip[id] = true;
  460.                 cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_unlimitedclip_cost2));
  461.                 write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "végtelen lőszer");
  462.             }
  463.             // Not has points, not has moneys... I'm sorry...
  464.             else
  465.             {
  466.                 write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_unlimitedclip_cost), get_pcvar_num(cvar_unlimitedclip_cost2));
  467.             }
  468.         }
  469.         // Jail open
  470.         case 2:
  471.         {
  472.             // Has enough points?
  473.             if (surf_get_user_points(id) >= get_pcvar_num(cvar_jail_cost))
  474.             {
  475.                 open_jail(id);
  476.                 surf_del_user_points(id, get_pcvar_num(cvar_jail_cost));
  477.             }
  478.             // Not has enough points, has enough moneys?
  479.             else if (cs_get_user_money(id) >= get_pcvar_num(cvar_jail_cost2))
  480.             {
  481.                 open_jail(id);
  482.                 cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_jail_cost2));
  483.             }
  484.             // Not has points, not has moneys... I'm sorry...
  485.             else
  486.             {
  487.                 write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_jail_cost), get_pcvar_num(cvar_jail_cost2));
  488.             }
  489.         }
  490.         // ShotGuns
  491.         case 3:
  492.         {
  493.             // Has enough points?
  494.             if (surf_get_user_points(id) >= get_pcvar_num(cvar_shotguns_cost))
  495.             {
  496.                 b_Shotguns[id] = true;
  497.                 fm_give_item(id, "weapon_m3");
  498.                 fm_give_item(id, "weapon_xm1014");
  499.                 cs_set_user_bpammo(id, CSW_M3, 999);
  500.                 cs_set_user_bpammo(id, CSW_XM1014, 999);
  501.                 surf_del_user_points(id, get_pcvar_num(cvar_shotguns_cost));
  502.             }
  503.             // Not has enough points, has enough moneys?
  504.             else if (cs_get_user_money(id) >= get_pcvar_num(cvar_shotguns_cost2))
  505.             {
  506.                 b_Shotguns[id] = true;
  507.                 fm_give_item(id, "weapon_m3");
  508.                 fm_give_item(id, "weapon_xm1014");
  509.                 cs_set_user_bpammo(id, CSW_M3, 999);
  510.                 cs_set_user_bpammo(id, CSW_XM1014, 999);
  511.                 cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_shotguns_cost2));
  512.             }
  513.             // Not has points, not has moneys... I'm sorry...
  514.             else
  515.             {
  516.                 write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_shotguns_cost), get_pcvar_num(cvar_shotguns_cost2));
  517.             }
  518.         }
  519.         case 8:
  520.         {
  521.             command_Buy(id);
  522.         }
  523.         default:
  524.         {
  525.             return PLUGIN_CONTINUE;
  526.         }
  527.     }
  528.     return PLUGIN_CONTINUE;
  529. }
  530.  
  531. // Current Weapon event
  532. public event_CurWeapon(id)
  533. {
  534.     if (b_Speed[id])
  535.     {
  536.         fm_set_user_maxspeed(id, 350.0);
  537.     }
  538. }
  539.  
  540. // When client is spawned
  541. public ham_PlayerSpawned_Post(id)
  542. {
  543.     b_Spawns[id]++;
  544.     if (b_Speed[id])
  545.     {
  546.         b_Speed[id] = false;
  547.     }
  548.     if (b_Invisibility[id])
  549.     {
  550.         b_Invisibility[id] = false;
  551.         fm_set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255);
  552.     }
  553.     if (b_Gravity[id])
  554.     {
  555.         b_Gravity[id] = false;
  556.         fm_set_user_gravity(id, 1.0);
  557.     }
  558.     if (b_Damage[id])
  559.     {
  560.         b_Damage[id] = false;
  561.     }
  562.     if (b_Noclip[id])
  563.     {
  564.         b_Noclip[id] = false;
  565.         fm_set_user_noclip(id, 0);
  566.     }
  567.     if (b_Godmode[id])
  568.     {
  569.         b_Godmode[id] = false;
  570.         fm_set_user_godmode(id, 0);
  571.     }
  572.     if (b_Spawns[id] == 3)
  573.     {
  574.         command_Buy(id);
  575.         write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_BEGGIN_INFO");
  576.         write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_BEGGIN_INFO");
  577.     }
  578.     if (b_Unlimitedclip[id])
  579.     {
  580.         b_Unlimitedclip[id] = false;
  581.     }
  582.     if (g_GodmodeCount[id])
  583.     {
  584.         g_GodmodeCount[id] = 0;
  585.     }
  586.     if (g_NoclipCount[id])
  587.     {
  588.         g_NoclipCount[id] = 0;
  589.     }
  590.     if (b_Shotguns[id])
  591.     {
  592.         b_Shotguns[id] = false;
  593.         fm_give_item(id, "weapon_m3");
  594.         fm_give_item(id, "weapon_xm1014");
  595.         cs_set_user_bpammo(id, CSW_M3, 999);
  596.         cs_set_user_bpammo(id, CSW_XM1014, 999);
  597.     }
  598. }
  599.  
  600. // Damage multiplier
  601. public ham_TakeDamage(victim, inflictor, attacker, Float:damage)
  602. {
  603.     if (victim == attacker || !is_user_connected(attacker))
  604.     {
  605.         return HAM_IGNORED;
  606.     }
  607.     if (b_Damage[attacker])
  608.     {
  609.         damage *= 2.0;
  610.         SetHamParamFloat(4, damage);
  611.     }
  612.     return HAM_IGNORED;
  613. }
  614.  
  615. // When client joining
  616. public client_putinserver(id)
  617. {
  618.     set_task(25.0, "task_Announce", id);
  619. }
  620.  
  621. // When client disconnect
  622. public client_disconnect(id)
  623. {
  624.     if (b_Speed[id])
  625.     {
  626.         b_Speed[id] = false;
  627.     }
  628.     if (b_Invisibility[id])
  629.     {
  630.         b_Invisibility[id] = false;
  631.     }
  632.     if (b_Gravity[id])
  633.     {
  634.         b_Gravity[id] = false;
  635.     }
  636.     if (b_Damage[id])
  637.     {
  638.         b_Damage[id] = false;
  639.     }
  640.     if (b_Noclip[id])
  641.     {
  642.         b_Noclip[id] = false;
  643.     }
  644.     if (b_Godmode[id])
  645.     {
  646.         b_Godmode[id] = false;
  647.     }
  648.     if (b_Spawns[id])
  649.     {
  650.         b_Spawns[id] = 0;
  651.     }
  652.     if (b_Unlimitedclip[id])
  653.     {
  654.         b_Unlimitedclip[id] = false;
  655.     }
  656.     if (g_GodmodeCount[id])
  657.     {
  658.         g_GodmodeCount[id] = 0;
  659.     }
  660.     if (g_NoclipCount[id])
  661.     {
  662.         g_NoclipCount[id] = 0;
  663.     }
  664.     if (b_Shotguns[id])
  665.     {
  666.         b_Shotguns[id] = false;
  667.     }
  668. }
  669.  
  670. // Remove Noclip task
  671. public task_RemoveNoclip(id)
  672. {
  673.     if (!is_user_connected(id))
  674.     {
  675.         return;
  676.     }
  677.     if (fm_get_user_noclip(id))
  678.     {
  679.         b_Noclip[id] = false;
  680.         fm_set_user_noclip(id, 0);
  681.         new Float:origin[3], hulltype;
  682.         pev(id, pev_origin, origin);
  683.         hulltype = (pev(id, pev_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN;
  684.         if (!hattrick_hull_vacant(id, origin, hulltype))
  685.         {
  686.             user_kill(id);
  687.             write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NOCLIP_DIED");
  688.         }
  689.         if (is_user_alive(id))
  690.         {
  691.             write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NOCLIP_REMOVED");
  692.         }
  693.     }
  694. }
  695.  
  696. // Remove Godmode task
  697. public task_RemoveGodmode(id)
  698. {
  699.     if (!is_user_connected(id))
  700.     {
  701.         return;
  702.     }
  703.     if (fm_get_user_godmode(id))
  704.     {
  705.         b_Godmode[id] = false;
  706.         fm_set_user_godmode(id, 0);
  707.         write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_GODMODE_REMOVED");
  708.     }
  709. }
  710.  
  711. // Announce the player
  712. public task_Announce(id)
  713. {
  714.     if (is_user_connected(id))
  715.     {
  716.         write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_WELCOME");
  717.     }
  718. }
  719.  
  720. // Countdown player noclip
  721. public task_NoclipCountDown(id)
  722. {
  723.     if (!is_user_connected(id) || !is_user_alive(id))
  724.     {
  725.         return;
  726.     }
  727.     g_NoclipCount[id]--;
  728.     set_hudmessage(0, 255, 0, 0.35, 0.8, _, _, 7.0);
  729.     show_hudmessage(id, "%L", LANG_PLAYER, "SURF_YOU_HAVE", "noclip", g_NoclipCount[id]);
  730. }
  731.  
  732. // Countdown player godmode
  733. public task_GodmodeCountDown(id)
  734. {
  735.     if (!is_user_connected(id) || !is_user_alive(id))
  736.     {
  737.         return;
  738.     }
  739.     g_GodmodeCount[id]--;
  740.     set_hudmessage(0, 255, 0, 0.35, 0.8, _, _, 7.0);
  741.     show_hudmessage(id, "%L", LANG_PLAYER, "SURF_YOU_HAVE", "godmode", g_GodmodeCount[id]);
  742. }
  743.  
  744. // Write colored function
  745. public write_colored(const id, const string[], {Float, Sql, Resul,_}:...)
  746. {
  747.     new msg[191], players[32], count = 1;
  748.     vformat(msg, 190, string, 3);
  749.     replace_all(msg, 190, "!n", "^1");
  750.     replace_all(msg, 190, "!t", "^3");
  751.     replace_all(msg, 190, "!g", "^4");
  752.     if (id) players[0] = id;
  753.     else get_players(players, count, "ch");
  754.     for (new i = 0; i < count; i++)
  755.     {
  756.         if (is_user_connected(players[i]))
  757.         {
  758.             message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  759.             write_byte(players[i]);
  760.             write_string(msg);
  761.             message_end();
  762.         }
  763.     }
  764. }
  765.  
  766. // Is hull vacant stock (credits ==> VEN)
  767. stock bool:hattrick_hull_vacant(id, const Float:origin[3], hullType = HULL_HEAD, &hitent = 0)
  768. {
  769.     engfunc(EngFunc_TraceHull, origin, origin, 0, hullType, id, 0);
  770.     hitent = get_tr2(0, TraceResult:TR_pHit);
  771.     if (!get_tr2(0, TraceResult:TR_StartSolid) && !get_tr2(0, TraceResult:TR_AllSolid) && get_tr2(0, TraceResult:TR_InOpen))
  772.     {
  773.         return true;
  774.     }
  775.     return false;
  776. }
  777.  
  778. // Unlimited clip stuff
  779. public message_cur_weapon(msg_id, msg_dest, msg_entity)
  780. {
  781.     if (!b_Unlimitedclip[msg_entity])
  782.     {
  783.         return;
  784.     }
  785.     if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
  786.     {
  787.         return;
  788.     }
  789.     static weapon, clip;
  790.     weapon = get_msg_arg_int(2);
  791.     clip = get_msg_arg_int(3);
  792.     if (MAXCLIP[weapon] > 2)
  793.     {
  794.         set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]);
  795.         if (clip < 2)
  796.         {
  797.             static wname[32], weapon_ent;
  798.             get_weaponname(weapon, wname, 31);
  799.             weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity);
  800.             fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon]);
  801.         }
  802.     }
  803. }
  804.  
  805. stock fm_set_weapon_ammo(entity, amount)
  806. {
  807.     set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
  808. }
  809.  
  810. // Open jail function
  811. public open_jail(id)
  812. {
  813.     // Get the user name
  814.     new name[32];
  815.     get_user_name(id, name, 31);
  816.    
  817.     new ent, target[32], ent2;
  818.     for (new i = 0; i < sizeof entlist; i++)
  819.     {
  820.         ent = 0;
  821.         ent2 = 0;
  822.         while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", entlist[i])))
  823.         {
  824.             if (pev_valid(ent))
  825.             {
  826.                 pev(ent, pev_target, target, 31);
  827.                 while((ent2 = engfunc(EngFunc_FindEntityByString, ent2, "targetname", target)))
  828.                 {
  829.                     dllfunc(DLLFunc_Use, ent2, id);
  830.                     write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "Jail Opener");
  831.                     return PLUGIN_HANDLED;
  832.                 }
  833.             }
  834.         }
  835.     }
  836.     write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_CANT_FIND");
  837.     return PLUGIN_HANDLED;
  838. }

_________________
viewtopic.php?f=101&t=25611#p184899
viewtopic.php?f=114&t=29544&p=209471#p209431


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 24 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