AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   2 Warnings (https://forums.alliedmods.net/showthread.php?t=168772)

enjoi. 10-03-2011 17:04

2 Warnings
 
How do I remove the warnings on line 25 and 28. Its both loose indenation
PHP Code:

#include <amxmodx> 

#define PLUGIN "Menu" 
#define VERSION "1.5" 
#define AUTHOR "Redux + -dINk^1d" 

public plugin_init() 

    
register_plugin(PLUGINVERSIONAUTHOR
    
register_clcmd("say /menu","mymenu"); 




public 
mymenu(id

    new 
MyMenu=menu_create("\wServer Menu [\rDeathrun\w]""cbMyMenu"); 

    
menu_additem(MyMenu"Change Server"); //item=0 
    
menu_additem(MyMenu"Deathrun Shop"); //item=1 
    
menu_additem(MyMenu"Turn off CT Visibility"); //item=2 
    
menu_additem(MyMenu"Deathrun Points"); //item=3 
    
menu_additem(MyMenu"Admin Menu", .paccess=ADMIN_BAN); //item=4 
    
menu_additem(MyMenu"Turn Off/On Round Sound"); //item=5 
    
menu_additem(MyMenu"Close"); //item=6
    

    
menu_setprop(MyMenuMPROP_EXITNAME"Close") ; 
    
menu_setprop(MyMenuMPROP_EXITMEXIT_ALL); 
    
menu_setprop(MyMenuMPROP_NUMBER_COLOR"\y"); 


    
menu_display(idMyMenu,0); 
    return 
PLUGIN_HANDLED


public 
cbMyMenu(idmenuitem

    switch(
item
    { 
        case 
0
        { 
            
client_cmd(id"say /server"); 

        } 
        case 
1
        { 
            
client_cmd(id"say /drshop"); 

        } 
        case 
2
        { 
            
client_cmd(id"say /invis"); 

        } 
        case 
3
        { 
            
client_cmd(id"say /points"); 

        } 
        case 
4
        { 
            
client_cmd(id"amxmodmenu"); 

        } 
        case 
5
        { 
            
client_cmd(id"say /roundsound"); 

        } 

    } 
    
menu_destroy(menu); 
    return 
PLUGIN_HANDLED



Gooogle 10-03-2011 17:06

Re: 2 Warnings
 
Quote:

Originally Posted by enjoi. (Post 1567914)
Its both loose indenation

Really? Because I compiled it and it had no errors.

enjoi. 10-03-2011 17:13

Re: 2 Warnings
 
I said warnings not errors. My bad I must of had the wrong code in.

drekes 10-03-2011 17:16

Re: 2 Warnings
 
To prevent loose indentions, use only tabs or spaces to indent your code.

Stereo 10-03-2011 17:17

Re: 2 Warnings
 
loose indentation is due to the misalignment of the code:

loose indentation:

PHP Code:

give_item(id"weapon_knife")
         return 
PLUGIN_HANDLED 


no warnings:

PHP Code:

give_item(id"weapon_knife")
return 
PLUGIN_HANDLED 


codysermina 10-04-2011 12:26

Re: 2 Warnings
 
Quote:

How do I remove the warnings on line 25 and 28. Its both loose indenation
- Auto Indenter! -

Napoleon_be 10-04-2011 12:55

Re: 2 Warnings
 
AMXx Studio --> Tools --> Identer

Fixed.

Xellath 10-04-2011 15:19

Re: 2 Warnings
 
Lousy way to fix indentation. Not that reliable either.

Simply put:
Use ONLY one of the following; Tabs or multiple spaces. Using it consistently and not mixing them, no errors (warnings) will occur.

enjoi. 10-04-2011 15:30

Re: 2 Warnings
 
Ok thanks. For some reason when I copied the code I posted here into the sma it worked. Must of been something wrong idk.


All times are GMT -4. The time now is 19:31.

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