Raised This Month: $ Target: $400
 0% 

bullet damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cin3k
New Member
Join Date: Jun 2011
Old 06-14-2011 , 15:07   bullet damage
Reply With Quote #1

hello, could someone convert bullet damage plugin for the player with the flag T cvar amx_bulletdamage was a 1 and for a player without a flag T cvar amx_bulletdamage was 2
I tried but it's not running
it's sma with my chances

Quote:
if(get_user_flags(id) & ADMIN_LEVEL_H)
{g_enabled=1;
}
else
{g_enabled=2;
}
}
it's my added chances
Attached Files
File Type: sma Get Plugin or Get Source (bulletVIP.sma - 840 views - 2.1 KB)
Cin3k is offline
Dolph_Ziggler
BANNED
Join Date: Jun 2011
Old 06-15-2011 , 07:08   Re: bullet damage
Reply With Quote #2

her ya go try this it should be work
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>

#define PLUGIN "Bullet Damage VIP"
#define VERSION "1.0"
#define AUTHOR "Cinek"

#define VIP ADMIN_LEVEL_H

new g_type g_enabledg_recievedbool:g_showrecievedg_hudmsg1g_hudmsg2
new maxplayers
new id
public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("Damage""on_damage""b""2!0""3=0""4!0")    
    
register_event("HLTV""on_new_round""a""1=0""2=0")
    
maxplayers get_maxplayers()
    
g_type register_cvar("amx_bulletdamage","1")
    
g_recieved register_cvar("amx_bulletdamage_recieved","1")    
    
    
g_hudmsg1 CreateHudSyncObj()    
    
g_hudmsg2 CreateHudSyncObj()
}

public 
on_new_round()
{
    
g_enabled get_pcvar_num(g_type)
    if(
get_pcvar_num(g_recieved)) g_showrecieved true    
    
for(id id <= maxplayers id++)
    {
        if(
is_user_connected(id))
        {
            if(
get_user_flags(id) & VIP)
            {
                
g_enabled=1;
            }
            else
            {
                
g_enabled=2;
            }
        }
    }
}

public 
on_damage(id)
{
    if(
g_enabled)
    {        
        static 
attackerattacker get_user_attacker(id)
        static 
damagedamage read_data(2)        
        if(
g_showrecieved)
        {            
            
set_hudmessage(255000.450.5020.14.00.10.1, -1)
            
ShowSyncHudMsg(idg_hudmsg2"%i^n"damage)        
        }
        if(
is_user_connected(attacker))
        {
            switch(
g_enabled)
            {
                case 
1: {
                    
set_hudmessage(0100200, -1.00.5520.14.00.020.02, -1)
                    
ShowSyncHudMsg(attackerg_hudmsg1"%i^n"damage)                
                }
                case 
2: {
                    if(
fm_is_ent_visible(attacker,id))
                    {
                        
set_hudmessage(0100200, -1.00.5520.14.00.020.02, -1)
                        
ShowSyncHudMsg(attackerg_hudmsg1"%i^n"damage)                
                    }
                }
            }
        }
    }

Dolph_Ziggler is offline
Send a message via MSN to Dolph_Ziggler
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-15-2011 , 14:22   Re: bullet damage
Reply With Quote #3

Here is the quick and easy method:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>

#define PLUGIN "Bullet Damage VIP"
#define VERSION "1.0"
#define AUTHOR "Cinek"

new g_type g_enabledg_recievedbool:g_showrecievedg_hudmsg1g_hudmsg2

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("Damage""on_damage""b""2!0""3=0""4!0")    
    
register_event("HLTV""on_new_round""a""1=0""2=0")

    
g_type register_cvar("amx_bulletdamage","1")
    
g_recieved register_cvar("amx_bulletdamage_recieved","1")    
    
    
g_hudmsg1 CreateHudSyncObj()    
    
g_hudmsg2 CreateHudSyncObj()
}

public 
on_new_round()
{
    
g_enabled get_pcvar_num(g_type)
    if(
get_pcvar_num(g_recieved))
        
g_showrecieved true    
}

public 
on_damage(id)
{
    if(
g_enabled)
    {        
        static 
attackerattacker get_user_attacker(id)
        static 
damagedamage read_data(2)        
        if(
g_showrecieved)
        {            
            
set_hudmessage(255000.450.5020.14.00.10.1, -1)
            
ShowSyncHudMsg(idg_hudmsg2"%i^n"damage)        
        }
        if(
is_user_connected(attacker))
        {
            if( 
get_user_flags(attacker) & ADMIN_LEVEL_H )
            {
                
set_hudmessage(0100200, -1.00.5520.14.00.020.02, -1)
                
ShowSyncHudMsg(attackerg_hudmsg1"%i^n"damage)
            }
            else
            {
                if(
fm_is_ent_visible(attacker,id))
                {
                    
set_hudmessage(0100200, -1.00.5520.14.00.020.02, -1)
                    
ShowSyncHudMsg(attackerg_hudmsg1"%i^n"damage)                
                }
            }
        }
    }




Quote:
Originally Posted by Dolph_Ziggler View Post
her ya go try this it should be work
PHP Code:
#define VIP ADMIN_LEVEL_H

public on_new_round()
{
    
g_enabled get_pcvar_num(g_type)
    if(
get_pcvar_num(g_recieved)) g_showrecieved true    
    
for(id id <= maxplayers id++)
    {
        if(
is_user_connected(id))
        {
            if(
get_user_flags(id) & VIP)
            {
                
g_enabled=1;
            }
            else
            {
                
g_enabled=2;
            }
        }
    }

You didn't change anything, you just made it look cleaner. I've seen you do this a couple times now.
__________________

Last edited by fysiks; 06-15-2011 at 14:30.
fysiks is online now
quark
Veteran Member
Join Date: Oct 2011
Location: Your mind.
Old 10-14-2011 , 04:05   Re: bullet damage
Reply With Quote #4

look, i changed that flag to ADMIN_RESERVATION and it doesn't work
quark is offline
Reply


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 23:30.


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