L 06/15/2007 - 02:53:42: Start of error session.
L 06/15/2007 - 02:53:42: Info (map "aim_sk_ak_m4") (logfile "error_061507.log")
L 06/15/2007 - 02:53:42: Invalid weapon id 0
L 06/15/2007 - 02:53:42: [AMXX] Run time error 10 (plugin "admin_ammo.amxx") (native "get_weaponname") - debug not enabled!
L 06/15/2007 - 02:53:42: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
help me plz!
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#define PLUGIN "00"
#define VERSION "0"
#define AUTHOR "00"
new unlammo;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("CurWeapon", "event_weapon", "be");
unlammo = register_cvar("amx_unlammo","1");
}
public event_weapon(id) {
if( get_pcvar_num(unlammo) < 1){
return PLUGIN_HANDLED
}
if(cstrike_running())
{
new clip, ammo
new weapon = get_user_weapon(id,clip,ammo);
new weaponname[32]
get_weaponname(weapon,weaponname,31)
new weaponi = find_ent_by_owner(-1,weaponname,id);
if(weaponi)
{
new ammo = cs_get_weapon_ammo(weaponi);
if( ammo <= 1)
cs_set_weapon_ammo(weaponi,ammo + 253);
}
}
return 0;
}