Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team codperk_gwodz.sma(41) : error 010: invalid function or declaration codperk_gwodz.sma(43) : error 010: invalid function or declaration codperk_gwodz.sma(44) : error 010: invalid function or declaration 3 Errors. Could not locate output file codperk_gwodz.amxx (compile failed).
A to perk:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fun>
#include <codmod>
#include <hamsandwich>
#include <engine>
#include <fakemeta>
#define DMG_BULLET (1<<1)
new const perk_name[] = "Gwozdziarka";
new const perk_desc[] = "Dostajesz m4(Gwozdziarke) 1/1 z niego ale 1 hp";
new bool:ma_perk[33];
public plugin_init()
{
register_plugin(perk_name, "1.0", "QTM_Peyote");
cod_register_perk(perk_name, perk_desc);
register_event("Health", "Health", "be")
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
register_event("CurWeapon", "CurWeapon", "be", "1=1")
register_forward(FM_SetModel, "fw_SetModel");
}
public cod_perk_enabled(id)
{
set_user_health(id, 1);
ma_perk[id] = true;
cod_give_weapon(id, CSW_M4A1)
}
public cod_perk_disabled(id)
{
ma_perk[id] = false;
cod_take_weapon(id, CSW_M4A1)
}
ublic Health(id)
{
if(is_user_alive(id))
if(ma_perk[id])
{
set_user_health(id, 1);
}
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_perk[idattacker])
return HAM_IGNORED;
if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_M4A1 && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
return HAM_IGNORED;
}
public plugin_precache()
{
precache_model("models/w_m4a1.mdl");
precache_model("models/p_m4a1.mdl");
precache_model("models/zohan/v_m4a1.mdl");
}
public CurWeapon(id)
{
new weapon = read_data(2);
if(ma_perk[id])
{
if(weapon == CSW_M4A1)
{
set_pev(id, pev_viewmodel2, "models/zohan/v_m4a1.mdl")
set_pev(id, pev_weaponmodel2, "models/p_m4a1.mdl")
}
}
}
public fw_SetModel(entity, model[])
{
if(!pev_valid(entity))
return FMRES_IGNORED
if(!equali(model, "models/w_m4a1.mdl"))
return FMRES_IGNORED;
new entityowner = pev(entity, pev_owner);
if(!ma_perk[entityowner])
return FMRES_IGNORED;
engfunc(EngFunc_SetModel, entity, "models/w_m4a1.mdl")
return FMRES_SUPERCEDE
}