AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Warnings in my plugin (https://forums.alliedmods.net/showthread.php?t=120681)

Legend 03-07-2010 07:34

Warnings in my plugin
 
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <fun>
#include <fakemeta_util>

#define PLUGIN "NadeSelector"
#define VERSION "1.1"
#define AUTHOR "Fixed"

new boolg_AlreadyUsed[33]


public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /grenades""cmdSelectItem")
    
register_clcmd("say_team /grenades""cmdSelectItem")
    
register_event"HLTV""EventNewRound""a""1=0""2=0" )
    
register_logevent("round_start"2"1=Round_Start");
    
}



public 
EventNewRound()
{
    new 
Players[32
    new 
playerCountiplayer 
    get_players
(PlayersplayerCount
    for (
i=0i<playerCounti++) 
    {    
        
player Players[i
        
g_AlreadyUsed[player] = false
    
}
}

public 
round_start(id)
{
    
ColorChat(0RED"[NadeSelector] Type /grenades to choose your grenades!");
}





public 
cmdSelectItem(id)
{
    new 
menu menu_create("\rChoose Item:""playerMenu_ShowSelectionHandler");
    
    
menu_additem(menu"\wFrostnade""1"0);
    
menu_additem(menu"\w2 Flashbangs +50 Health""2"0);
    
menu_additem(menu"\wHE grenade +75 Health""3"0);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    if( 
get_user_team(id) == )
    if(!
g_AlreadyUsed[id])
        
menu_display(idmenu0);
    else
        
ColorChat(idRED"[NadeSelector] You already choosed a grenade this round.")
    else
    
ColorChat(idRED"[NadeSelector] You need to be a hider, to choose grenades!")
    return 
PLUGIN_CONTINUE;
    
}

public 
client_connect(idg_AlreadyUsed[id] = false
public playerMenu_ShowSelectionHandler(idmenuitem)


{
    new 
accesscallbackname[64], data[6]
    
    
menu_item_getinfomenuitemaccessdata5name63callback )
    
    new 
choice str_to_numdata )
    
    switch( 
choice )
    {
        case 
1// FrostNade
        
{
       
ColorChat(idRED"[NadeSelector] You received a FrostNade!");
            
give_itemid"weapon_smokegrenade" 
       
g_AlreadyUsed[id] = true
        
        
}
        
        case 
2// FLASH
        
{
            
give_itemid"weapon_flashbang" )
       
give_itemid"weapon_flashbang" )
       
set_user_health(id150)
            
g_AlreadyUsed[id] = true
       ColorChat
(idRED"[NadeSelector] You received 2 flashbangs and 150 health!");
        }
    case 
3// HE
    
{
    
give_itemid"weapon_hegrenade" )
    
set_user_healthid175)
    
g_AlreadyUsed[id] = true
    ColorChat
(idRED"[NadeSelector] You received 1 HE grenade and 175 health!");
    }
    
    
    }
    
    
    


Warnings:

Warning: Loose indentation on line 82 = give_item( id, "weapon_smokegrenade" )
Warning: Loose indentation on line 83 = g_AlreadyUsed[id] = true
Warning: Loose indentation on line 90 = give_item( id, "weapon_flashbang" )
Warning: Loose indentation on line 92 = g_AlreadyUsed[id] = true
Warning: Loose indentation on line 93 = ColorChat(id, RED, "[NadeSelector] You received 2 flashbangs and 150 health!");
Header size: 772 bytes
Code size: 4048 bytes
Data size: 2960 bytes
Stack/heap size: 16384 bytes; max. usage is unknown, due to recursion
Total requirements: 24164 bytes

5 Warnings.
Done.

Arkshine 03-07-2010 07:59

Re: Warnings in my plugin
 
It means you have badly indented your code. It's easy to see your code is not well aligned, because you have mixed spaces and tabs.

wrecked_ 03-07-2010 13:16

Re: Warnings in my plugin
 
Use the indent tool. :roll:

Arkshine 03-07-2010 13:22

Re: Warnings in my plugin
 
No, it should not.


All times are GMT -4. The time now is 08:44.

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