#include <amxmodx>
#include <engine>
#include <nvault>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "Kes"
#define VERSION "1.0"
#define AUTHOR "asd"
new oles[33], kes[33], vault
public plugin_precache() {
precache_model("models/keso/alap.mdl")
precache_model("models/keso/masodik.mdl")
precache_model("models/keso/harmadik.mdl")
precache_model("models/keso/negyedik.mdl")
precache_model("models/keso/otodik.mdl")
precache_model("models/keso/hatodik.mdl")
precache_model("models/keso/hetedik.mdl")
precache_model("models/keso/nyolcadik.mdl")
}
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg","death","a")
register_clcmd("say /kes","menu")
vault = nvault_open("kes_olessert")
register_event("CurWeapon", "ecw", "be", "1=1")
set_task(0.1, "kijelzo", 0, _, _, "b")
}
public ecw(id)
{
new fegyver = get_user_weapon(id)
if(kes[id] == 0 && fegyver == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/keso/alap.mdl")
}
if(kes[id] == 1 && fegyver == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/keso/masodik.mdl")
}
if(kes[id] == 2 && fegyver == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/keso/harmadik.mdl")
}
if(kes[id] == 3 && fegyver == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/keso/negyedik.mdl")
}
if(kes[id] == 4 && fegyver == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/keso/otodik.mdl")
}
if(kes[id] == 5 && fegyver == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/keso/hatodik.mdl")
}
if(kes[id] == 6 && fegyver == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/keso/hetedik.mdl")
}
if(kes[id] == 7 && fegyver == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/keso/nyolcadik.mdl")
}
}
public death(){
new killer = read_data(1)
new victim = read_data(2)
if(killer == victim)
{
return PLUGIN_HANDLED
}
oles[killer]++
return PLUGIN_HANDLED
}
public menu(id) {
new cim[121]
format(cim, charsmax(cim), "w.:[PRO]:. - Ölések:r %d",oles[id])
new menu = menu_create(cim, "menu_h" )
menu_additem(menu,"\y.:[PRO]:. Alap Késr [Megszerezve] ","1",0)
if(oles[id] >= 200)
menu_additem(menu,"\y.:[PRO]:. Elso Késr [Megszerezve]","2",0)
else
menu_additem(menu,"\d.:[PRO]:. Elso Kés [50]","2",0)
if(oles[id] >= 500)
menu_additem(menu,"\y.:[PRO]:. Második Késr [Megszerezve]","3",0)
else
menu_additem(menu,"\d.:[PRO]:. Második Kés [100]","3",0)
if(oles[id] >= 700)
menu_additem(menu,"\d.:[PRO]:. Harmadik Kés [Megszerezve]","4",0)
else
menu_additem(menu,"\d.:[PRO]:. Harmadik Kés [150]","4",0)
if(oles[id] >= 900)
menu_additem(menu,"\d.:[PRO]:. Negyedik Kés [Megszerezve]","5",0)
else
menu_additem(menu,"\d.:[PRO]:. Negyedik Kés [200]","5",0)
if(oles[id] >= 1000)
menu_additem(menu,"\d.:[PRO]:. Ötödik Kés [Megszerezve]","6",0)
else
menu_additem(menu,"\d.:[PRO]:. Ötödik Kés [250]","6",0)
if(oles[id] >= 1200)
menu_additem(menu,"\d.:[PRO]:. Hatokdik Kés [Megszerezve]","7",0)
else
menu_additem(menu,"\d.:[PRO]:. Hatodik Kés [300]","7",0)
if(oles[id] >= 1400)
menu_additem(menu,"\d.:[PRO]:. Hetedik Kés [Megszerezve]","8",0)
else
menu_additem(menu,"\d.:[PRO]:. Hetedik Kés [350]","8",0)
if(oles[id] >= 1500)
menu_additem(menu,"\d.:[PRO]:. Nyolcadik Kés [Megszerezve]","9",0)
else
menu_additem(menu,"\d.:[PRO]:. Nyolcadik Kés [400]","9",0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
}
public menu_h(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[9], 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(oles[id] >= 0)
kes[id] = 0
}
case 2:{
if(oles[id] >= 50)
kes[id] = 1
else
client_print(id,print_chat,"Túl kevés ölésed van")
}
case 3:{
if(oles[id] >= 100)
kes[id] = 2
else
client_print(id,print_chat,"Túl kevés ölésed van")
}
case 4:{
if(oles[id] >= 150)
kes[id] = 3
else
client_print(id,print_chat,"Túl kevés ölésed van")
}
case 5:{
if(oles[id] >= 200)
kes[id] = 4
else
client_print(id,print_chat,"Túl kevés ölésed van")
}
case 6:{
if(oles[id] >= 250)
kes[id] = 5
else
client_print(id,print_chat,"Túl kevés ölésed van")
}
case 7:{
if(oles[id] >= 300)
kes[id] = 6
else
client_print(id,print_chat,"Túl kevés ölésed van")
}
case 8:{
if(oles[id] >= 350)
kes[id] = 6
else
client_print(id,print_chat,"Túl kevés ölésed van")
}
case 9:{
if(oles[id] >= 400)
kes[id] = 7
else
client_print(id,print_chat,"Túl kevés ölésed van")
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
public mentes(id)
{
new vaultkey[64],vaultdata[256], name[32]
get_user_name(id, name, 31)
format(vaultkey,63,"%s-KES", name)
format(vaultdata,255,"%d", oles[id])
nvault_set(vault,vaultkey,vaultdata)
return PLUGIN_CONTINUE
}
public betoltes(id)
{
new vaultkey[64],vaultdata[256], name[32]
get_user_name(id, name, 31)
format(vaultkey,63,"%s-KES", name)
nvault_get(vault,vaultkey,vaultdata,255)
oles[id] = str_to_num(vaultdata)
return PLUGIN_CONTINUE
}
public client_disconnect(id)
{
mentes(id)
}
public client_connect(id)
{
betoltes(id)
}
public kijelzo(){
new players[32], szam, id
get_players(players, szam)
for(new i; i<szam; i++){
id = players[i]
set_hudmessage(255, 255, 255, 0.02, 0.24, 0, 6.0, 12.0)
}
}