Raised This Month: $ Target: $400
 0% 

warning 217


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Toshkoo
New Member
Join Date: Jan 2014
Old 01-07-2014 , 05:14   warning 217
Reply With Quote #1

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

Last edited by Toshkoo; 01-07-2014 at 05:33.
Toshkoo is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 01-07-2014 , 05:37   Re: warning 217
Reply With Quote #2

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;
                                                                            } 
__________________

Last edited by ddhoward; 01-07-2014 at 05:42.
ddhoward is offline
Reply


Thread Tools
Display Modes

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 10:04.


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