Quote:
Originally Posted by Bugsy
You should have posted in Suggestions/Requests if you are not trying to code this yourself.
Here's what I just said, see if you can figure out where it goes.
PHP Code:
//Make this global (placed towards the top of the plugin, delete xDamage in the xOnDamage function new xDamage[ MAX_PLAYERS + 1 ]
//Replace xDamage = read_data(2) //with xDamage[ xAttacker ] += read_data( 2 )
|
it would look something 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, xDamage
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)
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)
}
}