/admins Command Help
#1

When I edit my CMD:admins like this >

PHP Code:
CMD:admins(playerid,params[])
{
    new 
string[128];
    new 
n[MAX_PLAYER_NAME];
        
SendClientMessage(playerid,COLOR_GREEN,"___________|- Online Admins -|___________");
        for(new 
0MAX_PLAYERSi++)
        {
            if(
PlayerInfo[i][Level] == 1)
            {
                
GetPlayerName(i,Name,sizeof(Name));
                
format(string128"Trial Moderator - %s[ID: %d]",n,i);
                
SendClientMessage(playeridCOLOR_GREEN1string);
            }
            if(
PlayerInfo[i][Level] == 2)
            {
                
GetPlayerName(i,Name,sizeof(Name));
                
format(string128"Moderator - %s[ID: %d]"Namei);
                
SendClientMessage(playeridCOLOR_FORESTGREENstring);
            }
            if(
PlayerInfo[i][Level] == 3)
            {
                
GetPlayerName(i,Name,sizeof(Name));
                
format(string128"Guard - %s[ID: %d]"Namei);
                
SendClientMessage(playeridyellowstring);
            }
            if(
PlayerInfo[i][Level] == 4)
            {
                
GetPlayerName(i,Name,sizeof(Name));
                
format(string128"Officer - %s[ID: %d]"Namei);
                
SendClientMessage(playeridCOLOR_BLACKstring);
            }
            if(
PlayerInfo[i][Level] == 5)
            {
                
GetPlayerName(i,Name,sizeof(Name));
                
format(string128"Captain - %s[ID: %d]"Namei);
                
SendClientMessage(playeridbluestring);
            }
            if(
PlayerInfo[i][Level] == 6)
            {
                   
GetPlayerName(i,Name,sizeof(Name));
                
format(string128"Elite Admin - %s[ID: %d]"Namei);
                
SendClientMessage(playeridgreystring);
            }
            if(
PlayerInfo[i][Level] == 7)
            {
                
GetPlayerName(i,Name,sizeof(Name));
                
format(string128"General - %s[ID: %d]"Namei);
                
SendClientMessage(playeridredstring);
            }
            if(
PlayerInfo[i][Level] == 8)
            {
                
GetPlayerName(i,Name,sizeof(Name));
                
format(string128"Director - %s[ID: %d]"Namei);
                
SendClientMessage(playeridCOLOR_ROYALBLUEstring);
            }
        }
        return 
1;
 } 
PHP Code:
It's Error and send me this errormessage >
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31137) : warning 217: loose indentation
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31142) : error 035: argument type mismatch (argument 2)
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31142) : error 039: constant symbol has no size
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31148) : error 035: argument type mismatch (argument 2)
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31148) : error 039: constant symbol has no size
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31149) : warning 213: tag mismatch
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31154) : error 035: argument type mismatch (argument 2)
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31154) : error 039: constant symbol has no size
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31155) : warning 213: tag mismatch
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31160) : error 035: argument type mismatch (argument 2)
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31160) : error 039: constant symbol has no size
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31161) : warning 213: tag mismatch
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31166) : error 035: argument type mismatch (argument 2)
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31166) : error 039: constant symbol has no size
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31167) : warning 213: tag mismatch
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31172) : error 035: argument type mismatch (argument 2)
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31172) : error 039: constant symbol has no size
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31173) : warning 213: tag mismatch
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31178) : error 035: argument type mismatch (argument 2)
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31178) : error 039: constant symbol has no size
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31179) : warning 213: tag mismatch
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31184) : error 035: argument type mismatch (argument 2)
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31184) : error 039: constant symbol has no size
D:\Data\Filbert\SA-MP Server\BDR Server\Gamemodes\BBTDM~RP.pwn(31185) : warning 213: tag mismatch
Pawn compiler 3.2.3664              Copyright © 1997-2006, ITB CompuPhase
16 Errors. 


Pls Help Me Who Know My Problem Solution...
Thanks For Reading And Waiting For Reply
God Bless You All
Reply
#2

You didn't mention from which lines those errors/warnings come from though. I'll assume that something is wrong with "Name" even though is not used and you declared "n" for the player's name which you used in the format too.

Assuming that all colors are integers too, using constant arrays find it a better way myself:
PHP Code:
CMD:admins(playeridparams[])
{
    static const
        
p_R[][] = {"Trial Moderator""Moderator""Guard""Officer""Captain""Elite Admin""General""Director"},
        
p_C[] = {COLOR_GREEN1COLOR_FORESTGREENyellowCOLOR_BLACKbluegreyredCOLOR_ROYALBLUE};
    new
        
string[50],
        
n[MAX_PLAYER_NAME];
        
    
SendClientMessage(playerid,COLOR_GREEN,"___________|- Online Admins -|___________");
    
    for(new 
0GetPlayerPoolSize(); <= ji++) // foreach(new i : Player)
    
{
        if (!
IsPlayerConnected(i)) continue;
        if(
<= PlayerInfo[i][Level] <= 8)
        {
            
GetPlayerName(insizeof(n));
            
format(stringsizeof string"%s - %s[ID: %d]"p_R[PlayerInfo[i][Level] - 1], ni);
            
SendClientMessage(playeridp_C[PlayerInfo[i][Level] - 1], string);
        }
    }
    return 
1;

foreach is also recommended but if you don't want to use it, atleast use GetPlayerPoolSize. Resetting variables on disconnect will also be better so we won't have to check if the player is connected.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)