My mod is ZPA.
Here is error in logs ??
Code:
[CSTRIKE] Non-player entity -1 out of range
[AMXX] Displaying debug trace (plugin "xxx.amxx")
[AMXX] Run time error 10: native error (native "cs_set_weapon_ammo")
[AMXX] [0] xxx.sma::fm_cs_get_current_weapon_ent (line 12030)
[AMXX] [1] xxx.sma::message_cur_weapon (line 5038)
PHP Code:
// Max Clip for weapons
new const MAXCLIP[] = { -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, -1, 7, 30, 30, -1, 50 }
PHP Code:
// Message hooks
register_message(g_msgCurWeapon, "message_cur_weapon")
PHP Code:
/*================================================================================
[Message Hooks]
=================================================================================*/
// Current Weapon info
public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
// Not alive or zombie
if (!g_isalive[msg_entity] || g_zombie[msg_entity])
return;
// Not an active weapon
if (get_msg_arg_int(1) != 1)
return;
// Unlimited clip disabled for class
if (g_survivor[msg_entity] ? get_pcvar_num(cvar_survinfammo) <= 1 : get_pcvar_num(cvar_infammo) <= 1 && g_sniper[msg_entity] ? get_pcvar_num(cvar_sniperinfammo) <= 1 : get_pcvar_num(cvar_infammo) <= 1)
return;
// Get weapon's id
static weapon
weapon = get_msg_arg_int(2)
// Unlimited Clip Ammo for this weapon?
if (MAXBPAMMO[weapon] > 2)
{
// Max out clip ammo
cs_set_weapon_ammo(fm_cs_get_current_weapon_ent(msg_entity), MAXCLIP[weapon])
// HUD should show full clip all the time
set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon])
}
}
PHP Code:
// Get User Current Weapon Entity
stock fm_cs_get_current_weapon_ent(id)
{
return get_pdata_cbase(id, OFFSET_ACTIVE_ITEM, OFFSET_LINUX);
}
__________________