AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   adv tk system (https://forums.alliedmods.net/showthread.php?t=181193)

DarkT1 03-26-2012 08:18

adv tk system
 
hi i need code that its tk system like this

(CT) (Name) attacked (Name) (13 HP)

(T) (Name) attacked (Name) (13 HP)

(spawn) (Name) attacked (Name) (how much HP)

Thanks:)

CreePs 03-26-2012 15:13

Re: adv tk system
 
i did like you ask for but i not tested it give it a try and tell me.

PHP Code:

#include <amxmodx>
#include <hamsandwich>

public plugin_init( ) {
    
register_plugin"TK Info""0.1""CreePs" )
    
    
RegisterHamHam_TakeDamage"player""bacon_takedamage_player" );
}

public 
bacon_takedamage_playervictiminflictorattackerFloat:damagedamage_type )
{
    if( 
get_user_teamattacker ) == get_user_teamvictim 
    && 
victim != attacker 
    
&& get_user_weaponattacker ) != CSW_HEGRENADE 
    {
        new 
vName32 ], aName32 ];
        
get_user_namevictimvNamesizeofvName ) - );
        
get_user_nameattackeraNamesizeofaName ) - );
        
        static const 
TeamName[ ][ ] =
        {
            
"UNASSIGNED",
            
"T",
            
"CT",
            
"SPEC"
        
}
            
        
client_printprint_chat"(%s) (%s) attacked (%s) (%f HP)"TeamNameget_user_teamvictim ) ], aNamevNamefloatrounddamage ) );
    }

    return 
HAM_IGNORED;



DarkT1 03-27-2012 04:16

Re: adv tk system
 
it work but when someone planted the bomb and the bomb "killed" him.

its type like this
(T) (dH_MaN) attacked (dH_Man) (388.89 HP)

and when i take damge for self with grenade HG.

it type

(T) (dH_MaN) attacked (dH_Man) (68 HP)

can u do that it no type nothing
can u fix it?

CreePs 03-27-2012 05:25

Re: adv tk system
 
Quote:

Originally Posted by DarkT1 (Post 1676533)
it work but when someone planted the bomb and the bomb "killed" him.

its type like this
(T) (dH_MaN) attacked (dH_Man) (388.89 HP)

and when i take damge for self with grenade HG.

it type

(T) (dH_MaN) attacked (dH_Man) (68 HP)

can u do that it no type nothing
can u fix it?

fixed look at the code now

DarkT1 03-27-2012 06:26

Re: adv tk system
 
not work..

its dont show and it dont take damge.. when i drop on me hg

CreePs 03-27-2012 06:42

Re: adv tk system
 
Quote:

Originally Posted by DarkT1 (Post 1676588)
not work..

its dont show and it dont take damge.. when i drop on me hg

try now

DarkT1 03-27-2012 15:30

Re: adv tk system
 
work but can u bulit somethink that he disable the meesage
name attacked a teammat

and the end message i mean the (13.99 HP)

can u do it be only (13 HP) without .55 cuz it no super market lol (:

CreePs 03-27-2012 18:22

Re: adv tk system
 
Quote:

Originally Posted by DarkT1 (Post 1676910)
work but can u bulit somethink that he disable the meesage
name attacked a teammat

and the end message i mean the (13.99 HP)

can u do it be only (13 HP) without .55 cuz it no super market lol (:

i disable the msg for HE Nade and i think the .55 will be removed now but im not sure need to check that

DarkT1 03-28-2012 05:24

Re: adv tk system
 
(T) (name) attacked (XS? dH) (0.000000 HP)
(T) (name) attacked (XS? dH) (0.000000 HP)

CreePs 03-28-2012 07:35

Re: adv tk system
 
here i have added block tk msg by coonormcleod and fixed the float and fixed the fake damage but this not 100% true it could be 1-3 hp less/more
PHP Code:

#include <amxmodx>
#include <hamsandwich>

public plugin_init( ) {
    
register_plugin"TK Info""0.1""CreePs" )
    
    
RegisterHamHam_TakeDamage"player""bacon_takedamage_player" );
    
    
// block teamattck msg by coonormcleod
    
register_message(get_user_msgid("TextMsg"), "Message_TextMsg")
}

public 
bacon_takedamage_playervictiminflictorattackerFloat:damagedamage_type )
{
    if( 
get_user_teamattacker ) == get_user_teamvictim )
    && 
victim != attacker
    
&& get_user_weaponattacker ) != CSW_HEGRENADE
    
&& get_cvar_num"mp_friendlyfire" ) )
    {
        new 
vName32 ], aName32 ];
        
get_user_namevictimvNamesizeofvName ) - );
        
get_user_nameattackeraNamesizeofaName ) - );
        
        static const 
TeamName[ ][ ] =
        {
            
"UNASSIGNED",
            
"T",
            
"CT",
            
"SPEC"
        
}
        
        
damage = ( damage 2.9 );
        new 
iDamage floatrounddamage );

        
client_printprint_chat"(%s) (%s) attacked (%s) (%d HP)"TeamNameget_user_teamvictim ) ], aNamevNameiDamage );
    }

    return 
HAM_IGNORED;
}

public 
Message_TextMsg(iMsgIdiMsgDestid)
{
    if( 
id )
    {
        new 
szMsg[23]
        
get_msg_arg_string(2szMsgcharsmax(szMsg))
        
// http://www.amxmodx.org/funcwiki.php?search=et_msg_arg&go=search
        
return equal(szMsg"#Game_teammate_attack")
        
// http://www.amxmodx.org/funcwiki.php?search=equal&go=search
    
}
    return 
PLUGIN_CONTINUE




All times are GMT -4. The time now is 20:53.

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