Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2006 ITB CompuPhase, AMX Mod X Team
adeptklasa.sma(78) : error 017: undefined symbol "weapon"
1 Error.
Could not locate output file adeptklasa.amx (compile failed).
ERROR: Your plugin failed to compile, see above.
A oto ten plugin:
#include <amxmodx>
#include <codmod>
#include <hamsandwich>
#include <engine>
#include <cstrike>
#define DMG_BULLET (1<<1)
new bool:ma_klase[33];
new const nazwa[] = "Adept Ninja";
new const opis[] = "1/2 szansy na natychmiastowe zabicie z noża, mniejsza grawitacja, mniejsza widocznosc z nozem,ubranie wroga";
new const bronie = 1<<CSW_DEAGLE;
new const zdrowie = 0;
new const kondycja = 10;
new const inteligencja = 5;
new const wytrzymalosc = 0;
public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
register_event("CurWeapon","CurWeapon","be", "1=1");
register_event("ResetHUD", "ResetHUD", "abe");
}
public plugin_precache()
{
precache_model("models/v_knifee.mdl");//ścieszka do modelu knife
precache_model("models/p_knife.mdl");//ścieszka do modelu knife
precache_model("models/w_knife.mdl");//ścieszka do modelu knife
}
public cod_class_enabled(id)
{
ZmienUbranie(id, 0)
entity_set_float(id, EV_FL_gravity, 380.0/800.0);
ma_klase[id] = true;
}
public cod_class_disabled(id)
{
ZmienUbranie(id, 1)
entity_set_float(id, EV_FL_gravity, 800.0/800.0);
set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 255);
ma_klase[id] = false;
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(damagebits & DMG_BULLET)
{
new weapon = get_user_weapon(idattacker);
if(weapon == CSW_KNIFE && damage > 20.0 && random_num(1,2) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}
public CurWeapon(id)
{
if(!ma_klase[id] && weapon == CSW_KNIFE)
{
entity_set_string(id, EV_SZ_viewmodel, "models/v_knifee.mdl")//ścieszka do modelu knife
entity_set_string(id, EV_SZ_weaponmodel, "models/p_knife.mdl")//ścieszka do modelu knife
entity_set_string(id, EV_SZ_model, "models/w_knife.mdl")//ścieszka do modelu knife
}
if(!ma_klase[id])
return PLUGIN_CONTINUE;
if(get_user_weapon(id) == CSW_KNIFE)
set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 55);
else
set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 255);
return HAM_IGNORED;
}
public ResetHUD(id)
{
if(ma_klase[id])
entity_set_float(id, EV_FL_gravity, 380.0/800.0);
}
public ZmienUbranie(id,reset)
{
if (id<1 || id>32 || !is_user_connected(id))
return PLUGIN_CONTINUE;
if (reset)
cs_reset_user_model(id);
else
{
new Ubrania_CT[4][] = {"sas","gsg9","urban","gign"},
Ubrania_Terro[4][] = {"arctic","leet","guerilla","terror"};
new num = random_num(0,3);
switch(get_user_team(id))
{
case 1: cs_set_user_model(id, Ubrania_CT[num]);
case 2:cs_set_user_model(id, Ubrania_Terro[num]);
}
}
return PLUGIN_CONTINUE;
}
Użytkownik Arturro edytował ten post 16.05.2012 18:14