public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /lada", "kesmenu")
register_clcmd("say_team /lada", "kesmenu")
register_clcmd("lada", "ladas")
register_clcmd("say","handlesay")
register_clcmd("say_team","handlesay")
vault = nvault_open("Relive_rangk_kesek")
register_event("CurWeapon", "Event_Change_Weapon", "be", "1=1")
register_event("DeathMsg","death","a")
register_touch("BonusDoboz", "player", "touchdoboz")
register_touch("BonusKulcs", "player", "touchkulcs")
}
public ladas(id){
lada[id]++
kulcs[id]++
oles[id]++
ColorChat(id, RED, "\rExeWaRRiorS \w|\yPaintball\w| ^1Sikeresen Hozzáadva ^1+1 ^4Láda^1,^1+1 ^4Kulcs^4,^1+1 ^4Ölés.")
}
public plugin_precache() {
precache_model(doboz_model)
precache_model(kulcs_model)
}
public death(){
if(read_data(1) == read_data(2))
return PLUGIN_HANDLED
new victim = read_data(2)
switch(random_num(1,2)) {
case 1: { //lada
static origin[3]
pev(victim, pev_origin, origin)
new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
origin[2] -= 36
engfunc(EngFunc_SetOrigin, ent, origin)
if(!pev_valid(ent))
{
return PLUGIN_HANDLED
}
set_pev(ent, pev_classname, "BonusDoboz" )
engfunc(EngFunc_SetModel, ent, doboz_model)
dllfunc(DLLFunc_Spawn, ent)
set_pev(ent, pev_solid, SOLID_BBOX)
set_pev(ent, pev_movetype, MOVETYPE_NONE)
engfunc(EngFunc_SetSize, ent, MEDKIT_MINSZ, MEDKIT_MAXSZ)
engfunc(EngFunc_DropToFloor, ent)
message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2]+60)
message_end()
}
case 2: { //kulcs
static origin[3]
pev(victim, pev_origin, origin)
new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
origin[2] -= 36
engfunc(EngFunc_SetOrigin, ent, origin)
if(!pev_valid(ent))
{
return PLUGIN_HANDLED
}
set_pev(ent, pev_classname, "BonusKulcs" )
engfunc(EngFunc_SetModel, ent, kulcs_model)
dllfunc(DLLFunc_Spawn, ent)
set_pev(ent, pev_solid, SOLID_BBOX)
set_pev(ent, pev_movetype, MOVETYPE_NONE)
engfunc(EngFunc_SetSize, ent, MEDKIT_MINSZ, MEDKIT_MAXSZ)
engfunc(EngFunc_DropToFloor, ent)
message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2]+60)
message_end()
}
}
return PLUGIN_HANDLED
}
public touchdoboz(ent, toucher) {
if (!is_user_alive(toucher) || !pev_valid(ent))
return FMRES_IGNORED
new classname[32]
pev(ent, pev_classname, classname, 31)
if (!equal(classname, "BonusDoboz"))
return FMRES_IGNORED
set_pev(ent, pev_effects, EF_NODRAW)
set_pev(ent, pev_solid, SOLID_NOT)
lada[toucher]++
remove_ent(ent)
return FMRES_IGNORED
}
public touchkulcs(ent, toucher) {
if (!is_user_alive(toucher) || !pev_valid(ent))
return FMRES_IGNORED
new classname[32]
pev(ent, pev_classname, classname, 31)
if (!equal(classname, "BonusKulcs"))
return FMRES_IGNORED
set_pev(ent, pev_effects, EF_NODRAW)
set_pev(ent, pev_solid, SOLID_NOT)
kulcs[toucher]++
remove_ent(ent)
return FMRES_IGNORED
}
public kesmenu(id) {
new cim[121]
format(cim, charsmax(cim), "\rExeWaRRiorS \w|\yPaintball\w| \wOleseid:\r%d \y^n\yLadaid: \r%d \w| \yKulcsaid: \r%d", oles[id], lada[id], kulcs[id])
new menu = menu_create(cim, "kesmenu_hl" )
menu_additem(menu,"\wLadak","3",0)
menu_display(id,menu,0)
}
public kesmenu_hl(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 3: {
ladikok(id)
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public hus(id){
new cim[121]
format(cim, charsmax(cim), "\rExeWaRRiorS \w|\yPaintball\w| \wOleseid:\r%d \y^n\yLadaid:\r%d \w| \yKulcsaid:\r%d", oles[id], lada[id], kulcs[id])
new menu = menu_create(cim, "handler" )
menu_additem(menu,"\\rHusveti \\ykes [60 lada]^n^n^n \\rKellemes \\yOlest!","1",0)
menu_display(id,menu,0)
}
public handler(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(lada[id] >= 60)
{
lada[id] -= 60
kesek[id] = -2
ColorChat(id, RED, "^4[eXe] » ^x01Sikeres valasztas.")
}
else {
ColorChat(id, RED, "^1Nincs eleg ^4ladad!")
}
}
}
return PLUGIN_HANDLED
}
public ladikok(id){
new cim[121]
format(cim, charsmax(cim), "\rExeWaRRiorS \wOleseid:\r%d \y^n\yLadaid:\r%d \w| \yKulcsaid:\r%d", oles[id], lada[id], kulcs[id])
new menu = menu_create(cim, "lada_nyitas" )
menu_additem(menu,"\wLadanyitas^nKell hozza \y[\w1 kulcs,1 lada\y]","1",0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_setprop(menu, MPROP_PERPAGE, 6);
menu_setprop(menu, MPROP_BACKNAME, "Vissza");
menu_setprop(menu, MPROP_NEXTNAME, "Kovetkezo");
menu_setprop(menu, MPROP_EXITNAME, "Kilepes");
menu_display(id, menu, 0)
}
public lada_nyitas(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);
switch(random_num(1,8)) {
case 1:
{
if(lada[id] >= 1 && kulcs[id] >= 1)
{
ColorChat(id, RED, "^4Lada ^1ures volt!")
lada[id] -= 1
kulcs[id] -= 1
ladikok(id)
}