Raised This Month: $51 Target: $400
 12% 

Need to complete one part of plugin (small and easy)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
spiN-
Member
Join Date: Jul 2008
Location: Lithuania
Old 06-25-2009 , 14:38   Need to complete one part of plugin (small and easy)
Reply With Quote #1

Hey.

I need that this plugin (bullet damage) should show and received damage, not only done, but I'm not so good at it and asking for help.

Here is the code:
Code:
#include <amxmodx>
 
new g_HudSyncObj;
 
public plugin_init()
    register_event("Damage", "Damage", "b", "2!0", "3=0", "4!0");
 
public plugin_cfg()
    g_HudSyncObj = CreateHudSyncObj();
 
public Damage(Cl)
{
    static Attacker;
    Attacker = get_user_attacker(Cl);
 
    if (get_user_flags(Attacker) & ADMIN_LEVEL_H)
    {
            set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, 7);
            ShowSyncHudMsg(Attacker, g_HudSyncObj, "%d^n", read_data(2));
    }
}
I tryed to fill with this code in the end:
Code:
#else
 if ( is_user_connected(attacker) && if (get_user_flags(attacker) & ADMIN_LEVEL_H) )
 {
  new damage = read_data(2)
#endif
  set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
  ShowSyncHudMsg(id, g_MsgSync2, "%i^n", damage)
And it looks like this:
Code:
#include <amxmodx>
 
new g_HudSyncObj;
 
public plugin_init()
    register_event("Damage", "Damage", "b", "2!0", "3=0", "4!0");
 
public plugin_cfg()
    g_HudSyncObj = CreateHudSyncObj();
 
public Damage(Cl)
{
    static Attacker;
    Attacker = get_user_attacker(Cl);
 
    if (get_user_flags(Attacker) & ADMIN_LEVEL_H)
    {
            set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, 7);
            ShowSyncHudMsg(Attacker, g_HudSyncObj, "%d^n", read_data(2));
#else
 if ( is_user_connected(attacker) && if (get_user_flags(attacker) & ADMIN_LEVEL_H) )
 {
  new damage = read_data(2)
#endif
  set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
  ShowSyncHudMsg(id, g_MsgSync2, "%i^n", damage)
But I get 5 or 6 errors... Whats wrong?
spiN- is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-25-2009 , 15:04   Re: Need to complete one part of plugin (small and easy)
Reply With Quote #2

PHP Code:
#include <amxmodx>
 
new g_iChan;
 
public 
plugin_init()
{
        
register_event("Damage""eventDmg""b""2!0""3=0""4!0");
 
        
g_iChan CreateHudSyncObj();
}
 
public 
eventDmg(iVictim)
{
        static 
iAtkiDmg;
        
iAtk get_user_attacker(iVictim);
        
iDmg read_data(2);
 
        if (
get_user_flags(iAtk) & ADMIN_LEVEL_H)
        {
                
set_hudmessage(0128255, -1.00.5520.14.00.00.0);
                
ShowSyncHudMsg(iAtkg_iChan"%d"iDmg);
        }
 
        if (
get_user_flags(iVictim) & ADMIN_LEVEL_H)
        {
                
set_hudmessage(25500, -1.00.5520.14.00.00.0);
                
ShowSyncHudMsg(iVictimg_iChan"%d"iDmg);
        }

__________________
hleV is offline
spiN-
Member
Join Date: Jul 2008
Location: Lithuania
Old 06-25-2009 , 15:40   Re: Need to complete one part of plugin (small and easy)
Reply With Quote #3

Thanks man, you helped me again.
spiN- is offline
Reply



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 02:11.


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