#include <amxmodx>
#include <codmod>
#include <fakemeta>
new const nev[] = "[ADMIN] XYZ";
new const leiras[] = "ADMIN KASZT";
new const fegyver = 1<<CSW_M4A1 | 1<<CSW_AK47 | 1<<CSW_AWP;
new const elet = 0;
new const speed = 0;
new const inteligencia = 0;
new const ugyesseg = 0;
new bool:admin_csoport[33];
new bool:duppla_ugras[33];
new const MaxLoszer[31] = { -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 };
public plugin_init() {
register_plugin(nev, "1.0", "QTM_Peyote");
cod_register_class(nev, leiras, fegyver, elet, speed, inteligencia, ugyesseg);
register_forward(FM_CmdStart, "CmdStart");
register_event("DeathMsg", "DeathMsg", "ade");
}
public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_H))
{
client_print(id, print_chat, "[ADMIN] Ez a kaszt csak Adminoknak.")
return COD_STOP;
}
admin_csoport[id] = true;
return COD_CONTINUE;
}
public cod_class_disabled(id)
admin_csoport[id] = false;
public CmdStart(id, uc_handle)
{
if(!admin_csoport[id])
return FMRES_IGNORED;
new button = get_uc(uc_handle, UC_Buttons);
new oldbutton = pev(id, pev_oldbuttons);
new flags = pev(id, pev_flags);
if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && duppla_ugras[id])
{
duppla_ugras[id] = false;
new Float:velocity[3];
pev(id, pev_velocity, velocity);
velocity[2] = random_float(265.0,285.0);
set_pev(id, pev_velocity, velocity);
}
else if(flags & FL_ONGROUND)
duppla_ugras[id] = true;
return FMRES_IGNORED;
}
public DeathMsg()
{
new killer = read_data(1);
new victim = read_data(2);
if(!is_user_connected(killer))
return PLUGIN_CONTINUE;
if(admin_csoport[victim] && !admin_csoport[killer])
cod_set_user_xp(killer, cod_get_user_xp(killer)+10);
if(admin_csoport[killer])
{
new cur_health = pev(killer, pev_health);
new Float:max_health = 100.0+cod_get_user_health(killer);
new Float:new_health = cur_health+20.0<max_health? cur_health+20.0: max_health;
set_pev(killer, pev_health, new_health);
new weapon = get_user_weapon(killer);
if(MaxLoszer[weapon] != -1)
set_user_clip(killer, MaxLoszer[weapon]);
}
return PLUGIN_CONTINUE;
}
stock set_user_clip(id, ammo)
{
new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
get_weaponname(weapon, weaponname, 31);
while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0)
if (pev(weaponid, pev_owner) == id) {
set_pdata_int(weaponid, 51, ammo, 4);
return weaponid;
}
return 0;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1250\\ deff0\\ deflang1038{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/