This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Menu help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-13-2024 , 17:04   Re: Menu help
Reply With Quote #3

Quote:
Originally Posted by tedaimlocks View Post
I made this, it works perfectly fine but i get a warning when compiling it

pvipshop.sma(35) : warning 209: function "PVIPMenu" should return a value

Could anyone help?
This warning is saying that you a explicitly returning a value in some but not all possible cases of code execution. This exists because there is, generally, a very good chance that you are creating unknown behavior of your code. All possible executions of a function should have an explicit return value. So, in this case, you return a value in the if statement at the beginning of the function but if that if statement doesn't get executed i.e. the menu is created and displayed, then there is no explicit return value. To fix this, you should either add a "return PLUGIN_CONTINUE" or "return PLUGIN_HANDLED" at the end of the function depending on how you want the function to behave. For chat commands like this, PLUGIN_CONTINUE will allow the original chat command to be shown to other players like a normal chat message but PLUGIN_HANDLED will suppress this message (i.e. your function gets executed but nobody sees who used the command).


Quote:
Originally Posted by WATCH_D0GS UNITED View Post
..
This is Scripting Help, people are here to learn. Explain what is actually wrong. It's not really helpful if you just post a plugin without any explanation.
__________________
fysiks 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 14:21.


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