Raised This Month: $ Target: $400
 0% 

optimisation


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-26-2013 , 07:03   Re: optimisation
Reply With Quote #2

PHP Code:
public fw_player_killed(victimattackershouldgib)
{
    if(    
attacker == victim
    
||    !IsPlayer(attacker)
    ||    
get_playersnum() < 4
    
||    cs_get_user_team(attacker) != CS_TEAM_T
    
||    cs_get_user_team(victim) != CS_TEAM_CT    )
    {
        return 
HAM_IGNORED
    
}

    new 
isVip get_user_flags(attacker) & ADMIN_LEVEL_H
    
new neededjbpacks isVip get_pcvar_num(g_maxjbpacks) * get_pcvar_num(g_maxjbpacks) - g_jbpacks[attacker]
    new 
previousjbpacks g_jbpacks[attacker]
    if( 
neededjbpacks )
    {
        
g_jbpacks[attacker] += min(isVip get_pcvar_num(g_killjp) * get_pcvar_num(g_killjp), neededjbpacks)
    }

    if(
get_pdata_int(victimm_LastHitGroup) == HIT_HEAD)
    {
        if( 
g_jbpacks[attacker] < maxjbpacks )
        {
            
g_jbpacks[attacker] += min(isVip get_pcvar_num(g_killhsjp) * get_pcvar_num(g_killhsjp), neededjbpacks)
        }
        
client_print_color(attackerRed"%L"attackerisVip "PTS_GIVEHS_VIP" "PTS_GIVEHS"g_jbpacks[attacker] - previousjbpacks)
    }
    else
    {
        
client_print_color(attackerRed"%L"attackerisVip "PTS_GIVE_VIP" "PTS_GIVE"g_jbpacks[attacker] - previousjbpacks)
    }

    return 
HAM_IGNORED

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-26-2013 at 07:04.
ConnorMcLeod 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 16:20.


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