AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need to complete one part of plugin (small and easy) (https://forums.alliedmods.net/showthread.php?t=95634)

spiN- 06-25-2009 14:38

Need to complete one part of plugin (small and easy)
 
Hey. :wink:

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. :cry:

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?

hleV 06-25-2009 15:04

Re: Need to complete one part of plugin (small and easy)
 
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);
        }



spiN- 06-25-2009 15:40

Re: Need to complete one part of plugin (small and easy)
 
Thanks man, you helped me again. :)


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

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