AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   warning 217 (https://forums.alliedmods.net/showthread.php?t=232946)

Toshkoo 01-07-2014 05:14

warning 217
 
Hello guys!
Since i've started to make a classic mode, i'm having problems with scripting for the gag plugin.

So, the errors are:
plmenu.sma(93) : warning 217: loose indentation
plmenu.sma(94) : warning 217: loose indentation
plmenu.sma(99) : warning 217: loose indentation
plmenu.sma(100) : warning 217: loose indentation

And here's my lines:
PHP Code:

register_clcmd("amx_gagmenu""cmdGagMenu"ADMIN_KICK"- displays gag menu")
    
register_clcmd("amx_kickmenu""cmdKickMenu"ADMIN_KICK"- displays kick menu")
    
register_clcmd("amx_banmenu""cmdBanMenu"ADMIN_BAN"- displays ban menu")
    
register_clcmd("amx_slapmenu""cmdSlapMenu"ADMIN_SLAY"- displays slap/slay menu")
    
register_clcmd("amx_teammenu""cmdTeamMenu"ADMIN_LEVEL_A"- displays team menu")
    
register_clcmd("amx_clcmdmenu""cmdClcmdMenu"ADMIN_LEVEL_A"- displays client cmds menu")
    
register_menucmd(register_menuid("Gag Menu"), 1023"actionGagMenu")
    
register_menucmd(register_menuid("Ban Menu"), 1023"actionBanMenu"

I've looked for the problem, since i can't compile the whole file for those 4 lines, but i still cannot find my problem. I will be very grateful, if you help a bit :)

Cheers

ddhoward 01-07-2014 05:37

Re: warning 217
 
1) Those are not errors, those are warnings. You should be able to ignore them.
2) You have posted in the Sourcemod section, but appear to be working on an AMX MOD X plugin.
3) Loose indentation just means that you are using inconsistent indentation at the beginning of your lines. You can safely ignore these warnings, or preferably fix them by using a more consistent indentation style. FOR EXAMPLE:

This is an example of a plugin that is indented consistently:
PHP Code:

#include <sourcemod>
#include <sdktools>
 
public Plugin:myinfo =
{
    
name "My First Plugin",
    
author "Me",
    
description "My first plugin ever",
    
version "1.0.0.0",
    
url "http://www.sourcemod.net/"
}
 
public 
OnPluginStart()
{
    
RegAdminCmd("sm_myslap"Command_MySlapADMFLAG_SLAY);
}
 
public 
Action:Command_MySlap(clientargs)
{
    new 
String:arg1[32], String:arg2[32];
    new 
damage;
 
    
/* Get the first argument */
    
GetCmdArg(1arg1sizeof(arg1));
 
    
/* If there are 2 or more arguments, and the second argument fetch 
     * is successful, convert it to an integer.
     */
    
if (args >= && GetCmdArg(2arg2sizeof(arg2)))
    {
        
damage StringToInt(arg2);
    }
 
    
/* Try and find a matching player */
    
new target FindTarget(clientarg1);
    if (
target == -1)
    {
        
/* FindTarget() automatically replies with the 
         * failure reason.
         */
        
return Plugin_Handled;
    }
 
    
SlapPlayer(targetdamage);
 
    new 
String:name[MAX_NAME_LENGTH];
 
    
GetClientName(targetnamesizeof(name));
    
ReplyToCommand(client"[SM] You slapped %s for %d damage!"namedamage);
 
    return 
Plugin_Handled;


And this is that same plugin, but indented inconsistently. Note that, after compiling, the two plugins are IDENTICAL.
PHP Code:

            #include <sourcemod>
   #include <sdktools>
 
public Plugin:myinfo =
{
name "My First Plugin",
        
author "Me",
description "My first plugin ever",
                         
version "1.0.0.0",
    
url "http://www.sourcemod.net/"
}
 
 public 
OnPluginStart()
           {
 
RegAdminCmd("sm_myslap"Command_MySlapADMFLAG_SLAY);
}
 
public 
Action:Command_MySlap(clientargs)
 {
  new 
String:arg1[32], String:arg2[32];
         new 
damage;
 
 
/* Get the first argument */
  
GetCmdArg(1arg1sizeof(arg1));
 
  
/* If there are 2 or more arguments, and the second argument fetch 
         * is successful, convert it to an integer.
        */
if (args >= && GetCmdArg(2arg2sizeof(arg2)))
    {
        
damage StringToInt(arg2);
    }
 
    
/* Try and find a matching player */
    
new target FindTarget(clientarg1);     
            if (
target == -1)
    {
           
/* FindTarget() automatically replies with the 
    * failure reason.
     */
                
return Plugin_Handled;
    }
 
                                                            
SlapPlayer(targetdamage);
 
                new 
String:name[MAX_NAME_LENGTH];
 
         
GetClientName(targetnamesizeof(name));
ReplyToCommand(client"[SM] You slapped %s for %d damage!"namedamage);
 
return 
Plugin_Handled;
                                                                            } 



All times are GMT -4. The time now is 10:04.

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