AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Warning: Unreachable code on line ... (https://forums.alliedmods.net/showthread.php?t=183141)

bazhenov93 04-18-2012 00:00

Warning: Unreachable code on line ...
 
PHP Code:

public menu(id) {
    if(!
is_user_alive(id) && is_user_connected(id))
    
ColorChat(idBLUE"You must be alive to use this function")
    return 
PLUGIN_HANDLED;

    

    new 
menu menu_create("title...""handler")  
    
    
menu_additemmenu"some function...""1" )
    
menu_display(idmenu0)
    return 
PLUGIN_HANDLED 


if I remove the colorchat message, i don't get this error.. can anyone explain the difference and why? thanks:oops:

also using { and } i get errors

rak 04-18-2012 00:02

Re: Warning: Unreachable code on line ...
 
-.-

GOD!

READ TUTORIAL!

PHP Code:

 if(!is_user_alive(id) && is_user_connected(id)) {
    
ColorChat(idBLUE"You must be alive to use this function")
    return 
PLUGIN_HANDLED;



fysiks 04-18-2012 03:58

Re: Warning: Unreachable code on line ...
 
Quote:

Originally Posted by bazhenov93 (Post 1691514)
also using { and } i get errors

Lies!

bazhenov93 04-18-2012 04:01

Re: Warning: Unreachable code on line ...
 
Quote:

Originally Posted by fysiks (Post 1691596)
Lies!

Don't talk to me in that tone

my mistake was this->

menu_additem( menu, "some function...", "1" )
menu_display(id, menu, 0)
return
PLUGIN_HANDLED
}
}
}


All times are GMT -4. The time now is 07:55.

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