AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved small error (https://forums.alliedmods.net/showthread.php?t=320153)

Sanjay Singh 12-07-2019 03:31

small error
 
Error
PHP Code:

automix.sma(881) : warning 225unreachable code 

Code
PHP Code:

public EndBanVote(id)

    
g_VoteProg false
    show_menu
(00"^n"1); 
    if(
g_bVotes[0] >= g_bVotes[1]) 
    { 
        
client_print_color(00"^4%s ^3Ban ^1vote ^4succeed^1."PREFIX)
        
set_hudmessage(255000.320.7006.012.0)
        
        if ( 
id 32 )
        {
            
server_cmd("amx_banip #%d 5 ^"^3%^1Voted to be ^4banned ^1for ^4abusing^1.^""get_user_userid(id), PREFIX)
            
            new 
nameofp[50]
            
            
get_user_name(idnameofp49)
            
ShowSyncHudMsg(0g_MsgSync6"%s ^1was voted to be ^4BANNED"nameofp)
        }        
        else
        {
            
server_cmd("amx_banip ^"%s^" 15"g_LeftBansIPs[id-32])
            
ShowSyncHudMsg(0g_MsgSync6"%s ^1was voted to be ^4BANNED"g_LeftBans[id-32])
            
copy(g_LeftBans[id-32], charsmax(g_LeftBans[]), "")
            
copy(g_LeftBansIPs[id-32], charsmax(g_LeftBansIPs[]), "")
            
g_RoundsLeft[id-32] = -1
        
}        
        
g_bVotes[0] = 0
        g_bVotes
[1] = 0
        
return PLUGIN_HANDLED
    

    else 
    { 
        
client_print_color(00"^4%s ^3Ban ^1vote ^4failed^1."PREFIX)    
        
        if ( 
id >= 32 )
        {
            
copy(g_LeftBans[id-32], charsmax(g_LeftBans[]), "")
            
copy(g_LeftBansIPs[id-32], charsmax(g_LeftBansIPs[]), "")
            
g_RoundsLeft[id-32] = -1
        
}    
        else
        {
            
g_bVotes[0] = 0
            g_bVotes
[1] = 0
            g_LeftKills
[id] = 0
        
}
        return 
PLUGIN_HANDLED
    
}     
    return 
PLUGIN_HANDLED



^SmileY 12-07-2019 06:30

Re: small error in func
 
Do not need two first return PLUGIN_HANDLED, only at the end

Sanjay Singh 12-07-2019 06:51

Re: small error in func
 
Quote:

Originally Posted by ^SmileY (Post 2676010)
Do not need two first return PLUGIN_HANDLED, only at the end

thanks.


All times are GMT -4. The time now is 02:49.

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