Hello,
I'm trying to do custom VIP plugin, everything works fine so far except showing damage, I've tried the plugin that's everyone using and it's working fine, so there's something wrong with my code; when I damage someone it will show 0 as damage, HOWEVER I've tried to show it in chat (client_print) and got result of 2 client prints, first one was normal damage and second was 0, therefore my hud message is always changed to that 0 after normal damage
so I've got output like this when I shot someone:
Quote:
Damage Report: 20
Damage Report: 0
|
and my hud message showed only 0
what's weird is that with HEgrenade it's working normally
Grenade:
http://i.imgur.com/NfKem.png
Gun:
http://i.imgur.com/h9wyE.png
source: (not whole ofc, only damage)
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#define PLUGIN "VIP"
#define VERSION "1.0"
#define AUTHOR "SEnergy!"
new g_MsgSync;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("Damage","myDmg","b")
g_MsgSync = CreateHudSyncObj()
}
public myDmg(id)
{
new attacker = get_user_attacker(id);
if(is_user_connected(id) && is_user_connected(attacker))
{
if(get_user_team(id) != get_user_team(attacker))
{
if(get_user_flags(attacker) & ADMIN_LEVEL_C)
{
new damage = read_data(2);
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
ShowSyncHudMsg(attacker, g_MsgSync, "%i^n", damage)
client_print(attacker, print_chat, "Damage Report: %i", damage)
}
}
}
return PLUGIN_HANDLED;
}