Raised This Month: $51 Target: $400
 12% 

Solved small error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 12-07-2019 , 03:31   small error
Reply With Quote #1

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

__________________

Last edited by Sanjay Singh; 12-07-2019 at 06:52.
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 12-07-2019 , 06:30   Re: small error in func
Reply With Quote #2

Do not need two first return PLUGIN_HANDLED, only at the end
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 12-07-2019 , 06:51   Re: small error in func
Reply With Quote #3

Quote:
Originally Posted by ^SmileY View Post
Do not need two first return PLUGIN_HANDLED, only at the end
thanks.
__________________
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
Reply



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:27.


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