Quote:
Originally Posted by Bugsy
You forgot to delete xDamage in xOnDamge. "static xAttacker , xDamage" , delete ", xDamage"
And everywhere else you see xDamage in xOnDamage, you need to change it to xDamage[ xAttacker ]. This will reflect the total damage issued, not the single amount of damage.
|
like this
PHP Code:
#include <amxmodx>
#define PLUGIN "CS Revo: Danos causados"
#define VERSION "1.0"
#define AUTHOR "Wilian M."
new xMsgSync[2]
new xDamage[ MAX_PLAYERS + 1 ]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("Damage", "xOnDamage", "b", "2!0", "3=0", "4!0")
xMsgSync[0] = CreateHudSyncObj()
xMsgSync[1] = CreateHudSyncObj()
}
public xOnDamage(id)
{
static xAttacker
xAttacker = get_user_attacker(id)
xDamage[ xAttacker ] += read_data( 2 )
set_hudmessage(255, 0, 0, 0.45, 0.50, 0, 0.1, 3.0, 0.1, 0.1)
ShowSyncHudMsg(id, xMsgSync[1], "%i", xDamage [xAttacker])
if(is_user_connected(xAttacker))
{
set_hudmessage(0, 100, 200, -1.0, 0.55, 0, 0.1, 3.0, 0.02, 0.02)
ShowSyncHudMsg(xAttacker, xMsgSync[0], "%i", xDamage [xAttacker])
}
}