Code:
#include <amxmodx>
new PLUGIN[]="Forward Test"
new VERSION[]="0.1"
new AUTHOR[]="Orangutanz"
new player_died
new player_died_ret
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg", "DeathMsg_event", "a")
player_died = CreateMultiForward("player_died", ET_IGNORE, FP_CELL)
}
public DeathMsg_event()
{
new id = read_data(2)
ExecuteForward(player_died, player_died_ret, id)
}
As for is it more resourceful its debatable, since it depends what you are doing. A simple forward like this seems pretty pointless, but its a good example to see how it works. If you was hooking DeathMsg and was carrying out vasts checking etc and returning more than just the ID then yes its more resourceful.
How to add on the killer:
Code:
player_died = CreateMultiForward("player_died", ET_IGNORE, FP_CELL, FP_CELL)
public DeathMsg_event()
{
new killer = read_data(1)
new id = read_data(2)
new ret
ExecuteForward(player_died, player_died_ret, id, killer)
}
Regards,
Orange Monkey