Raised This Month: $ Target: $400
 0% 

Plugin crash "get_user_weapon"


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-30-2013 , 10:55   Re: Plugin crash "get_user_weapon"
Reply With Quote #10

PHP Code:
new g_iMaxPlayers

{
    
// [...]
    
register_event("DeathMsg""eDeath""a""1>0")
    
// [...]
    
g_iMaxplayers get_maxplayers()
    
// [...]
}
// [...]
public eDeath() {
    new 
killer read_data(1)
    if( 
killer g_iMaxPlayers )
    {
        return
    }
    new 
iWeapon get_user_weapon(killer
Btw, your usage of 'switch' in completely not appropriated, check directly value, for example instead of :
PHP Code:
    switch(iAchLevel[read_data(2)][DIES]) {  
        case 
500: {  
            
TotalAchievements[read_data(2)]++  
            
ColorChat(read_data(2), GREEN"[SWE-KUNG]^1 Congratulations! You have unlocked the achievement:^3 Anti-GodMode!")  
            
emit_sound(read_data(2), CHAN_STATICszAchievementSound1.0ATTN_NORM0PITCH_NORM)  
        }  
    } 
->
PHP Code:
    if(iAchLevel[read_data(2)][DIES] == 500) {   
        
TotalAchievements[read_data(2)]++  
        
ColorChat(read_data(2), GREEN"[SWE-KUNG]^1 Congratulations! You have unlocked the achievement:^3 Anti-GodMode!")  
        
emit_sound(read_data(2), CHAN_STATICszAchievementSound1.0ATTN_NORM0PITCH_NORM)  
    } 

Also, do never use read_data(2) more than 1 time, it won't change, do :

new victim = read_data(2), and then use victim in the rest of the function.
__________________
- tired and retired -

- my plugins -
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 15:48.


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