Raised This Month: $ Target: $400
 0% 

Plugin warnings


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
erader
Senior Member
Join Date: Dec 2010
Old 08-13-2011 , 17:07   Plugin warnings
Reply With Quote #1

Hi, I have 2 warnings on this plugin:

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>

#pragma semicolon 1

#define RED 255
#define GREEN 0
#define BLUE 0
#define UPDATEINTERVAL 1.0

// Comment below if you do not want /speclist showing up on chat
#define ECHOCMD

// Admin flag used for immunity
#define FLAG ADMIN_IMMUNITY

new const PLUGIN[] = "SpecList";
new const 
VERSION[] = "1.2a";
new const 
AUTHOR[] = "FatalisDK";

new 
gMaxPlayers;
new 
gCvarOn;
new 
gCvarImmunity;
new 
bool:gOnOff[33] = { true, ... };

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_cvar(PLUGINVERSIONFCVAR_SERVER0.0);
    
gCvarOn register_cvar("amx_speclist""1"00.0);
    
gCvarImmunity register_cvar("amx_speclist_immunity""1"00.0);
    
    
register_clcmd("say /speclist""cmdSpecList", -1"");
    
    
gMaxPlayers get_maxplayers();
    
    
set_task(UPDATEINTERVAL"tskShowSpec"123094""0"b"0);
}

public 
cmdSpecList(id)
{
    if( 
gOnOff[id] )
    {
        
client_print(idprint_chat"Nu o sa mai vezi spectatorii.");
        
gOnOff[id] = false;
    }
    else
    {
        
client_print(idprint_chat"Acum o sa vezi spectatorii.");
        
gOnOff[id] = true;
    }
    
    
#if defined ECHOCMD
    
return PLUGIN_CONTINUE;
    
#else
    
return PLUGIN_HANDLED;
    
#endif
}

public 
tskShowSpec()
{
    if( !
get_pcvar_num(gCvarOn) )
    {
        return 
PLUGIN_CONTINUE;
    }
    
    static 
szHud[1102];//32*33+45
    
static szName[34];
    static 
bool:send;
    
    
// FRUITLOOOOOOOOOOOOPS!
    
for( new alive 1alive <= gMaxPlayersalive++ )
    {
        new 
bool:sendTo[33];
        
send false;
        
        if( !
is_user_alive(alive) )
        {
            continue;
        }
        
        
sendTo[alive] = true;
        
        
get_user_name(aliveszName32);
        
format(szHud45"Jucator: %s:^n"szName);
                                
format(szHud45"%s:^nMoney: %d | HP: %d"szNamecs_get_user_money(alive),    get_user_health(alive));
        
        for( new 
dead 1dead <= gMaxPlayersdead++ )
        {
            if( 
is_user_connected(dead) )
            {
                if( 
is_user_alive(dead)
                || 
is_user_bot(dead) )
                {
                    continue;
                }
                
                if( 
pev(deadpev_iuser2) == alive )
                {
                    if( !(
get_pcvar_num(gCvarImmunity)&&get_user_flags(dead0)&FLAG) )
                    {
                        
get_user_name(deadszName32);
                        
add(szName33"^n"0);
                        
add(szHud1101szName0);
                        
send true;
                    }

                    
sendTo[dead] = true;
                    
                }
            }
        }
        
        if( 
send == true )
        {
            for( new 
1<= gMaxPlayersi++ )
            {
                if( 
sendTo[i] == true
                
&& gOnOff[i] == true )
                {
                    
set_hudmessage(REDGREENBLUE,
                        
0.750.1500.0UPDATEINTERVAL 0.10.00.0, -1);
                    
                    
show_hudmessage(iszHud);
                }
            }
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
client_connect(id)
{
    
gOnOff[id] = true;
}

public 
client_disconnect(id)
{
    
gOnOff[id] = true;

Quote:
/tmp/textKCcJeA.sma(8 : warning 217: loose indentation
/tmp/textKCcJeA.sma(90) : warning 217: loose indentation
And a problem: the first spec player appear on the line with money and HP

How can I solve this ?
__________________
If you live for something, you're not alone my friend...
erader is offline
sader
Junior Member
Join Date: Aug 2011
Old 08-13-2011 , 17:23   Re: Plugin warnings
Reply With Quote #2

Its wrong number of tab spaces

http://forum.sa-mp.com/showthread.php?t=98464

You can set
Code:
#pragma tabsize 0
or just ignore
sader is offline
erader
Senior Member
Join Date: Dec 2010
Old 08-13-2011 , 17:49   Re: Plugin warnings
Reply With Quote #3

Quote:
Originally Posted by sader View Post
Its wrong number of tab spaces

http://forum.sa-mp.com/showthread.php?t=98464

You can set
Code:
#pragma tabsize 0
or just ignore
If I put this it will solve my problem?

->
Quote:
the first spec player appear on the line with money and HP
__________________
If you live for something, you're not alone my friend...
erader is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-13-2011 , 19:40   Re: Plugin warnings
Reply With Quote #4

Quote:
Originally Posted by sader View Post
Its wrong number of tab spaces

http://forum.sa-mp.com/showthread.php?t=98464

You can set
Code:
#pragma tabsize 0
or just ignore
It's better to just fix the problem than to change the rules (pragma changes the 'rules' btw)
__________________
fysiks is offline
deadman909
Veteran Member
Join Date: Oct 2008
Old 08-14-2011 , 01:00   Re: Plugin warnings
Reply With Quote #5

This fixes Loose Identitation
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>

#pragma semicolon 1

#define RED 255
#define GREEN 0
#define BLUE 0
#define UPDATEINTERVAL 1.0

// Comment below if you do not want /speclist showing up on chat
#define ECHOCMD

// Admin flag used for immunity
#define FLAG ADMIN_IMMUNITY

new const PLUGIN[] = "SpecList";
new const 
VERSION[] = "1.2a";
new const 
AUTHOR[] = "FatalisDK";

new 
gMaxPlayers;
new 
gCvarOn;
new 
gCvarImmunity;
new 
bool:gOnOff[33] = { true, ... };

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_cvar(PLUGINVERSIONFCVAR_SERVER0.0);
    
gCvarOn register_cvar("amx_speclist""1"00.0);
    
gCvarImmunity register_cvar("amx_speclist_immunity""1"00.0);
    
    
register_clcmd("say /speclist""cmdSpecList", -1"");
    
    
gMaxPlayers get_maxplayers();
    
    
set_task(UPDATEINTERVAL"tskShowSpec"123094""0"b"0);
}

public 
cmdSpecList(id)
{
    if( 
gOnOff[id] )
    {
        
client_print(idprint_chat"Nu o sa mai vezi spectatorii.");
        
gOnOff[id] = false;
    }
    else
    {
        
client_print(idprint_chat"Acum o sa vezi spectatorii.");
        
gOnOff[id] = true;
    }
    
    
#if defined ECHOCMD
    
return PLUGIN_CONTINUE;
    
#else
    
return PLUGIN_HANDLED;
    
#endif
}

public 
tskShowSpec()
{
    if( !
get_pcvar_num(gCvarOn) )
    {
        return 
PLUGIN_CONTINUE;
    }
    
    static 
szHud[1102];//32*33+45
    
static szName[34];
    static 
bool:send;
    
    
// FRUITLOOOOOOOOOOOOPS!
    
for( new alive 1alive <= gMaxPlayersalive++ )
    {
        new 
bool:sendTo[33];
        
send false;
        
        if( !
is_user_alive(alive) )
        {
            continue;
        }
        
        
sendTo[alive] = true;
        
        
get_user_name(aliveszName32);
        
format(szHud45"Jucator: %s:^n"szName);
        
format(szHud45"%s:^nMoney: %d | HP: %d"szNamecs_get_user_money(alive),    get_user_health(alive));
        
        for( new 
dead 1dead <= gMaxPlayersdead++ )
        {
            if( 
is_user_connected(dead) )
            {
                if( 
is_user_alive(dead)
                || 
is_user_bot(dead) )
                {
                    continue;
                }
                
                if( 
pev(deadpev_iuser2) == alive )
                {
                    if( !(
get_pcvar_num(gCvarImmunity)&&get_user_flags(dead0)&FLAG) )
                    {
                        
get_user_name(deadszName32);
                        
add(szName33"^n"0);
                        
add(szHud1101szName0);
                        
send true;
                    }

                    
sendTo[dead] = true;
                    
                }
            }
        }
        
        if( 
send == true )
        {
            for( new 
1<= gMaxPlayersi++ )
            {
                if( 
sendTo[i] == true
                
&& gOnOff[i] == true )
                {
                    
set_hudmessage(REDGREENBLUE,
                        
0.750.1500.0UPDATEINTERVAL 0.10.00.0, -1);
                    
                    
show_hudmessage(iszHud);
                }
            }
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
client_connect(id)
{
    
gOnOff[id] = true;
}

public 
client_disconnect(id)
{
    
gOnOff[id] = true;

__________________

deadman909 is offline
Send a message via MSN to deadman909 Send a message via Yahoo to deadman909
erader
Senior Member
Join Date: Dec 2010
Old 08-14-2011 , 06:50   Re: Plugin warnings
Reply With Quote #6

Thanks, but I have the same problem with
#pragma tabsize 0
Quote:
the first spec player appear on the line with money and HP
__________________
If you live for something, you're not alone my friend...
erader is offline
deadman909
Veteran Member
Join Date: Oct 2008
Old 08-14-2011 , 16:59   Re: Plugin warnings
Reply With Quote #7

Quote:
Originally Posted by erader View Post
Thanks, but I have the same problem with
#pragma tabsize 0
Show an Image
__________________

deadman909 is offline
Send a message via MSN to deadman909 Send a message via Yahoo to deadman909
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-14-2011 , 17:07   Re: Plugin warnings
Reply With Quote #8

Quote:
Originally Posted by erader View Post
Thanks, but I have the same problem with
#pragma tabsize 0
1. Don't use that. Actually fix your indentation. It will make yours and our lives easier.
2. This will not change how the plugin works so don't expect it to have any affect in-game.
3. You need to explain your problem in detail because you are too vague.
__________________
fysiks is offline
erader
Senior Member
Join Date: Dec 2010
Old 08-14-2011 , 17:58   Re: Plugin warnings
Reply With Quote #9

Well, look on this photo:

[IMG]http://img143.**************/img143/43/dsawv.png[/IMG]

The first player appear near the HP.
__________________
If you live for something, you're not alone my friend...
erader is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-14-2011 , 18:01   Re: Plugin warnings
Reply With Quote #10

You need to put a ^n in there.
__________________
fysiks 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 03:23.


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