Raised This Month: $ Target: $400
 0% 

Please help code dosent works


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
xDoctor
Member
Join Date: Jul 2013
Old 07-05-2014 , 16:29   Re: Please help code dosent works
Reply With Quote #5

Quote:
Originally Posted by mottzi View Post
Why? You posted in scripting help and I gave you an example. You could try to modify it yourself now. If things don't work you can ask again here.


Then You need to do
PHP Code:
new iPlayers[32], iNum 
get_players
(iPlayersiNum"ae""CT"

if(
iNum == 1

    
iLastCT iPlayers[0

    
//return HAM_IGNORED 

on the newround event. You might also want do check for last CT on client_disconnect().



For each kill you get 10% bonus damage. You can get a max. of 200% bonus damage.

1 kill -> 1.1 * damage (110% damage)
2 kills -> 1.2 * damage (120% damage)
.
.
.
10 kills -> 2.0 * damage (200% damage)
.
.
.
19 kills -> 2.9 * damage (290%)
20 kills -> 3.0 * damage (300%)

You can modify it in this line:
PHP Code:
if(attacker == iLastCT && iLastCTKills 20 && cs_get_user_team(victim) == CS_TEAMS_T
is that alright ?

PHP Code:
#include < amxmodx > 
#include < cstrike > 
#include < hamsandwich > 

new iLastCTKillsiLastCT

public plugin_init() 
{
    
RegisterHam(Ham_Killed"player""hamKilledPost"true )
    
    
RegisterHam(Ham_TakeDamage"player""hamTakeDamagePre"false )

    
register_logevent("eventRoundStart"2"1=Round_Start")
}

public 
client_putinserverclient )
    
set_task1.0"Information"client );
    
public 
eventRoundStartclient )
{
    
iLastCT = -1
    
    iLastCTKills 
0
    
    
new iPlayers[32], iNum  
    
    get_players
(iPlayersiNum"ae""CT")  

    if(
iNum == 1)  
    {  
        
iLastCT iPlayers[0]  

    }
}

public 
hamKilledPost(victimattackershouldgib)
{
    if(
iLastCT == -&& cs_get_user_team(victim) == CS_TEAM_CT )
    {
        new 
iPlayers[32], iNum
        
        get_players
(iPlayersiNum"ae""CT")

        if(
iNum == 1)
        {
            
iLastCT iPlayers[0]

            return 
HAM_IGNORED
        
}
    }
    
    if( 
attacker == iLastCT && iLastCTKills 10 && cs_get_user_team(victim) == CS_TEAM_T )
    {
        
iLastCTKills += 1;
    }
    
    return 
1;
}

public 
hamTakeDamagePre(const victim, const inflictor, const attackerFloat:damage, const iDamageType
{
    if( 
victim == attacker )
        return 
HAM_IGNORED

    
if(attacker != iLastCT )
        return 
HAM_IGNORED
    
    SetHamParamFloat
(4damage * (iLastCTKills 0.1 ) )
        
    return 
HAM_IGNORED;
}  

public 
Informationclient )
{
    if( !
is_user_aliveclient ) )
        return 
1;
        
    if( 
client == iLastCT )
    {
        
set_hudmessage025500.300.7806.01.0 )
                    
        
show_hudmessageclient"Power Attack [ %i% ]^n [ %s%s%s%s%s%s%s%s%s%s ]"100 iLastCTKills 10,
        
iLastCTKills "-" "+",
        
iLastCTKills "-" "+",
        
iLastCTKills "-" "+",
        
iLastCTKills "-" "+",
        
iLastCTKills "-" "+",
        
iLastCTKills "-" "+",
        
iLastCTKills "-" "+",
        
iLastCTKills "-" "+",
        
iLastCTKills "-" "+",
        
iLastCTKills 10 "-" "+" )
    }
    
    else if( 
client != iLastCT )
    
    {
        
set_hudmessage025500.300.7806.01.0 )
        
        
show_hudmessageclient"Health: [ %i ]^n Armor: [ %i ]"get_user_healthclient ), get_user_armorclient ) );
    }
    
    return 
1;

xDoctor 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 21:14.


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