Raised This Month: $ Target: $400
 0% 

[VIP] Show Damage - weird result


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
SEnergyable
Junior Member
Join Date: Oct 2011
Old 07-04-2012 , 20:15   [VIP] Show Damage - weird result
Reply With Quote #1

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;
}

Last edited by SEnergyable; 07-04-2012 at 20:19.
SEnergyable is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode