View Single Post
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-08-2022 , 22:45   Re: Can anyone check if there is a better way to do this?
Reply With Quote #7

Declaring those variables as static is not required at all. It is a trivial optimization that will not make any appreciable difference any in regard. The two exceptions are very large arrays or for large/many variables that are called very often (like on a think forward).

Quote:
Originally Posted by Alahmoh View Post
the plugin is private ... btw you dont need to test it because it works perfectly i only want to get rid of warnings.
I understand that some people don't want to post their whole plugin but if people do post it it makes it much easier for us to compile it ourselves to see the actual warnings. It's not always easy to see errors/warnings by scanning random source code.

So, having the errors/warnings along with the corresponding lines of code is important to make things easier and quicker for everybody.

In the event that you're wanting to only post a little code, it is helpful to post the code snippets with call outs to indicate the line numbers. One nice and easy way to do this is to post your code in [php][/php] tags (to get syntax highlighting) and then add a comment on the lines that have errors. For example:

[php]
ShowHud( player ) {
new R,G,B,X,Y; // Line 1394
[/php]

gives this:
PHP Code:
ShowHudplayer ) {
        new 
R,G,B,X,Y// Line 1394 
__________________
fysiks is offline