#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <nvault>
#include <fakemeta>
new g_vault
new pontok[33]
new name[33][32]
new vipo
new admino
new bool:m4ak = true
new bool:awp = true
new bool:granat = true
new bool:recoil = true
public plugin_init()
{
register_event("DeathMsg", "eDeath", "a", "1>0");
set_task(4.9, "hud", 0, "", 0, "b", 0);
register_clcmd("team_say shop", "shopmenu")
register_clcmd("team_say /shop", "shopmenu")
register_clcmd("say shop", "shopmenu")
register_clcmd("say /shop", "shopmenu")
g_vault = nvault_open("Ido")
}
public shopmenu(id)
{
new menu = menu_create("\rValasz a menumbol:", "menu_handler");
menu_additem(menu, "\wM4A1 + AK47 (50p)", "1", 0);
menu_additem(menu, "\wAwp + Magozo(15p)", "2", 0);
menu_additem(menu, "\wNo recoilos fegyo(450p)","3",0);
menu_additem(menu, "\wOsszes Granat(15p)", "4", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
}
public menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], szName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
if(pontok[id] << 50)
{
client_print(id,print_chat,"Nincs eleg pontod!")
}
else if(m4ak == false)
{
client_print(id,print_chat,"Mar van ilyen targyad!")
}
else
{
give_item(id, "weapon_ak47")
give_item(id, "weapon_m4a1")
pontok[id] -= 50
m4ak = false
}
}
case 2:
{
if(pontok[id] << 30)
{
client_print(id,print_chat,"Nincs eleg pontod!")
}
else if(awp == false)
{
client_print(id,print_chat,"Mar van ilyen targyad!")
}
else
{
give_item(id, "weapon_awp")
pontok[id] -= 15
awp = false
}
}
case 3:
{
if(pontok[id] >= 400)
{
client_print(id,print_chat,"Nincs eleg pontod!")
}
else if(recoil == false)
{
client_print(id,print_chat,"Mar van ilyen targyad!")
}
else
{
set_pev(id,pev_punchangle,{0.0 , 0.0 , 0.0});
pontok[id] -= 400
recoil = false
}
}
case 4:
{
if(pontok[id] >= 15)
{
client_print(id,print_chat,"Nincs eleg penzed!")
}
else if(granat == false)
{
client_print(id,print_chat,"Mar van ilyen targyad!")
}
else
{
give_item(id,"weapon_flashbang")
give_item(id,"weapon_hegrenade")
give_item(id,"weapon_smokegrenade")
pontok[id] -= 15
granat = false
}
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public mentes(id)
{
new vaultkey[64],vaultdata[256]
format(vaultkey,63,"%s-PONTOK", name[id])
format(vaultdata,255,"%s", pontok[id])
nvault_set(g_vault,vaultkey,vaultdata)
return PLUGIN_CONTINUE
}
public betoltes(id)
{
new vaultkey[64],vaultdata[256]
format(vaultkey,63,"%s-PONTOK", name[id])
nvault_get(g_vault,vaultkey,vaultdata,255)
copy(pontok[id], 8, vaultdata)
return PLUGIN_CONTINUE
}
public client_disconnect(id)
{
mentes(id)
}
public client_connect(id)
{
{
get_user_name(id, name[id], 31)
betoltes(id)
}
{
set_task(300.0, "otpenz",id)
set_task(900.0, "tizpenz",id)
set_task(1800.0, "harmincpenz",id)
}
}
public otpenz(id)
{
client_print(id, print_chat, "Kaptal 5 pontot mert jatszotal 5 percet a szerveren!")
pontok[id] += 10
}
public tizpenz(id)
{
client_print(id, print_chat, "Kaptal 10 Pontot mert jatszotal 10percet a szerveren!")
pontok[id] += 20
}
public harmincpenz(id)
{
client_print(id, print_chat, "Kaptal 30 pontot mert jatszotal 30 percet a szerveren!")
pontok[id] += 60
}
public hud(id)
{
new id,maxplayers
for(id = 1 ; id <= maxplayers ; id++)
if(is_user_connected(id))
if(get_user_flags(id) & ADMIN_BAN)
{
admino++
}
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
vipo++
}
set_hudmessage(0, 170, 255, 0.5, 0.0, 0, 6.0, 5.0)
show_hudmessage(id,"[Pont: %d]^n[VIP: %d]^n[ADMIN: %d]",pontok[id],vipo,admino)
}
public eDeath(id)
{
new attacker = read_data(1);
new hs = read_data(3);
if(hs)
{
pontok[id] += 10
client_print(id,print_chat,"+10 pontot kaptal a fejlovesert")
}
if(attacker)
{
pontok[id] += 5
client_print(id,print_chat,"+5 pontot kaptal az olesert")
}
}