Raised This Month: $ Target: $400
 0% 

Please help code dosent works


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
xDoctor
Member
Join Date: Jul 2013
Old 07-05-2014 , 12:37   Please help code dosent works
Reply With Quote #1

i builted a Power Attack for basebuilder.

when some one is the last human he gets +10% bonus damage for each kill

maximum 200%

i tested the plugin in my home private server with cmd.

the debug show non errors then why the plugin dosent work ?


Code :

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

#include < amxmodx >
#include < cstrike >
#include < fakemeta >
#include < hamsandwich >

new iHumanKills[33 ], IsLast 33 ];

public 
plugin_init()
{
    
register_plugin"Power Attack""1.0""Xdoctor" )
    
    
RegisterHamHam_TakeDamage"player""FwdHamTakeDamage" );
    
    
register_logevent"EventRoundStart"2"1=Round_Start" );
    
    
register_event"DeathMsg""evDeathMsg""a" );
    
    
register_forwardFM_PlayerPreThink"fw_Player_PreThink" )
}

public 
client_putinserverclient )    iHumanKillsclient ] = 0;

public 
client_disconnectclient )    iHumanKillsclient ] = 0;

public 
EventRoundStartclient )
    return 
iHumanKillsclient ] = 0;
    
    
public 
fw_Player_PreThinkclient )
{
    new 
Players32 ], iNum;
    
    
get_playersPlayersiNum"aceh""CT" );
    
    if( 
iNum == )
        return 
IsLastclient ] = true;
    else
        return 
IsLastclient ] = false;
        
    if( !
is_user_aliveclient ) || !IsLastclient ] )
        return 
1;
    
    if( 
is_user_aliveclient ) )
    {
        if( 
IsLastclient ] )
        {
            
set_hudmessage025500.300.7806.01.0 )
                    
            
show_hudmessageclient"Power Attack [ %i% ]^n [ %s%s%s%s%s%s%s%s%s%s ]"100 iHumanKillsclient ] * 10,
            
iHumanKillsclient ] < "-" "+",
            
iHumanKillsclient ] < "-" "+",
            
iHumanKillsclient ] < "-" "+",
            
iHumanKillsclient ] < "-" "+",
            
iHumanKillsclient ] < "-" "+",
            
iHumanKillsclient ] < "-" "+",
            
iHumanKillsclient ] < "-" "+",
            
iHumanKillsclient ] < "-" "+",
            
iHumanKillsclient ] < "-" "+",
            
iHumanKillsclient ] < 10 "-" "+" )

        }
    }
    
    return 
1;
}

public 
evDeathMsgclient )
{
    new 
iAttacker read_data);
    
    new 
iVictim read_data);
    
    if( !
is_user_connectediAttacker ) || !is_user_connectediVictim ) || !is_user_aliveiAttacker ) )
        return 
1;
        
    if( 
is_user_botiVictim ) || is_user_hltviVictim ) )
        return 
1;
        
    if( 
cs_get_user_teamiAttacker ) == CS_TEAM_CT && cs_get_user_teamiVictim ) == CS_TEAM_T )
    {
        if( 
IsLastiAttacker ] )
        {
            if( 
iHumanKillsiAttacker ] <= )
            {
                
iHumanKillsiAttacker ] += 1;
                
                
ColorChatiAttacker"You recived^4 10%^3 damage bonus^1 for ^3for^1 killing a^4 Zombie." );
            }
        }
    }
    
    return 
1;
}

public 
FwdHamTakeDamageiVictimInflicatoriAttackerFloatfDamageDamageBits )
{
    if( 
IsLastiAttacker ] && cs_get_user_teamiAttacker ) == CS_TEAM_CT )
    {
        if( 
iHumanKillsiAttacker ] <= 10 )
        {
            
SetHamParamFloat4fDamage iHumanKillsiAttacker ] * 0.2 );
        }
    }
    
    return 
1;
}            

stock ColorChat( const client, const string[ ], { FloatSqlResul} :... )
{
        new 
msg191 ], players32 ], count 1;
       
        static 
lenlen formatexmsgcharsmax(msg), "^1[ ^4BaseBuilder^1 ] " );
        
vformatmsglen ], charsmaxmsg ) - lenstring);
       
        if( 
client )  players] = client;
        else    
get_playersplayers,count"ch" );
       
        for( new 
0counti++ )
        {
                if( 
is_user_connectedplayers] ) )
                {
                        
message_beginMSG_ONE_UNRELIABLEget_user_msgid"SayText" ),_players] );
                        
write_byteplayers] );
                        
write_stringmsg );
                        
message_end( );
                }
        }

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