Raised This Month: $ Target: $400
 0% 

Another Bullet damage...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
dyablows
Junior Member
Join Date: Sep 2008
Location: Iasi,Romania
Old 07-11-2013 , 19:01   Another Bullet damage...
Reply With Quote #1

Hello everybody.
I love to play CS with abd plugin on my server.
But not all players like the bullet damage .
So i want to make it on/off for every person , for me to be on if i say /command and for another player to be off if he say /command.
And default the bullet damage to be off.


I've tryed to make something...but right now it`s like cvar command accesible to everybody.
Look at modified code from original plugin by Sn!ff3r : http://forums.alliedmods.net/showthread.php?p=789735

PHP Code:
/* Plugin generated by AMXX-Studio */

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

#define PLUGIN "Advanced Bullet Damage"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

new g_typeg_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")

    
register_clcmd"say /damage""Say_damage" )
    
    
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 
Say_damageid 
{
    if(
g_enabled)
    {
        
g_enabled false
        client_print
idprint_chat"Bullet damage %s is now : Off"VERSION )
        return;
    }
    
    
client_printidprint_chat"Bullet damage %s is now : On"VERSION )
    
g_enabled 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))
        {
            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)                
                    }
                }
            }
        }
    }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/ 

Last edited by dyablows; 07-11-2013 at 19:10. Reason: Specification
dyablows is offline
 



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


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