AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] LOOSE IDENTATION (https://forums.alliedmods.net/showthread.php?t=125872)

flamin 05-02-2010 21:53

[SOLVED] LOOSE IDENTATION
 
1 Attachment(s)
Hi! This time i come to assist me to settle these warnings in this code:

PHP Code:

public handle_say(id)
{
    static 
arg[192]
    
read_args(arg,191)
    
remove_quotes(arg)

    new 
sw 0
    
new i0
    
new j
    
new g_words[][] ={ "ready","gaben","notready","dmg","sum","hp","help" }

    if ( 
arg[0] == '.' || arg[0] == '!' )
        { 
          do{    
           
            if( 
equal(arg], g_words]) )
            {
                    
sw 1
                    j 
0
                    client_cmd
(id,arg); 
                    return 
PLUGIN_CONTINUE
            }
            else{
                    
sw 0
                    i
++
            }
              }while(
sw || sizeof(g_words))

            
client_cmd(id,arg); 
            return 
PLUGIN_HANDLED;
        }
    return 
PLUGIN_CONTINUE;


The warnings are in the image...

Kreation 05-02-2010 22:01

Re: WARNINGS COMPILE
 
You're setting sw = 0 and to 1 but you do nothing with it. You just set it. What is the point? Or is there more code that you are just not providing that uses the variable sw and j?

fysiks 05-02-2010 22:19

Re: WARNINGS COMPILE
 
It's because he is using inefficient code that was posted in another thread. Do you know liryck? He speak english much much better than you.

flamin 05-02-2010 22:27

Re: WARNINGS COMPILE
 
Quote:

Originally Posted by Kreation (Post 1168726)
You're setting sw = 0 and to 1 but you do nothing with it. You just set it. What is the point? Or is there more code that you are just not providing that uses the variable sw and j?

Only the i'm using in that part of the code

Quote:

It's because he is using inefficient code that was posted in another thread. Do you know liryck? He speak english much much better than you.
Which is the problem who speaks English better than i do?

Kreation 05-02-2010 22:29

Re: WARNINGS COMPILE
 
Quote:

Originally Posted by flamin (Post 1168745)
Only the i'm using in that part of the code

Well, I tried to make sense of why you are even using pointless variables if they do nothing and got a headache. *Sigh of Depression*

Just delete the variables sw and j if they do ABSOLUTELY nothing..

flamin 05-02-2010 22:41

Re: WARNINGS COMPILE
 
1 Attachment(s)
Thanks kreation tapeworms reason i have already eliminated the variables...

Now i have is a problem of loose identation, here is the image...

And this is the line where this error:

PHP Code:

              }while( sizeof(g_words))

            
client_cmd(id,arg); 
            return 
PLUGIN_HANDLED;
        } 


fysiks 05-02-2010 22:53

Re: WARNINGS COMPILE
 
I already posted a much better loop in the thread by liryck in Scripting Help.

flamin 05-02-2010 23:10

Re: WARNINGS COMPILE
 
Fysiks i have already tested the code that will make provided to lyrick and does not work in this code only faltaria fix the problem of loose identation you can help to finish?

fysiks 05-03-2010 00:09

Re: WARNINGS COMPILE
 
Quote:

Originally Posted by flamin (Post 1168779)
can help to finish?

Tihs is the olny prat I udnersotod. The asnwer is "It's impossible."

flamin 05-03-2010 08:51

Re: WARNINGS COMPILE
 
Fysiks because they always write bad think that i do not understand?

What i meant with "can help to finish" I have just such a mistake in the plugin and i have given several laps to the code and always says the same...

You can help to fix the code?


All times are GMT -4. The time now is 03:52.

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