Hey, guys... I have been wondering for lot of time about this, but I couldn't find the reason. The problem is one goddamn annoying stack error (run time error 3). The code:
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <fun>
#define PLUGIN "Admin Extras"
#define VERSION "1.0"
#define AUTHOR "Flicker"
#define ACCESS ADMIN_RCON
new g_msgMoney, g_hookMoneyMsg
new g_iNewUserMoney
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg", "onDeathMsgEvent", "a")
g_msgMoney = get_user_msgid("Money")
}
public onDeathMsgEvent()
{
new atk = read_data(1)
new hs = read_data(3)
set_user_health(atk, clamp(get_user_health(atk) + hs ? 30 : 15, 0, 150))
set_user_armor(atk, clamp(get_user_armor(atk) + hs ? 20 : 10, 0, 200))
give_item(atk, "weapon_hegrenade")
cs_set_user_bpammo(atk, CSW_HEGRENADE, hs ? 2 : 1)
g_iNewUserMoney = clamp(cs_get_user_money(atk) + hs ? 500 : 300, 0, 16000)
g_hookMoneyMsg = register_message(g_msgMoney, "onMoneyMessage")
}
public onMoneyMessage(msgid, msgdest, id)
{
unregister_message(g_msgMoney, g_hookMoneyMsg)
set_pdata_int(id, 115, g_iNewUserMoney, 5)
set_msg_arg_int(1, ARG_LONG, g_iNewUserMoney)
}
Really, no lines, nothing. Just
Code:
L 07/21/2014 - 22:01:24: Start of error session.
L 07/21/2014 - 22:01:24: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20140721.log")
L 07/21/2014 - 22:01:24: [AMXX] Displaying debug trace (plugin "AdminExtras.amxx")
L 07/21/2014 - 22:01:24: [AMXX] Run time error 3: stack error
and server dies..
__________________