[Help] Don't know why... [+Rep]
#1

i just want this command to show the admins (VIP Level 2's) that are online:

top of script:
PHP код:
enum PLAYER_INFO
{
        
PLAYER_MONEY,
        
PLAYER_SKIN,
        
LOCATION,
        
DEATHS,
        
INTERIOR,
        
VIRTUALWORLD,
        
Float:HEALTH,
        
LOGGED,
        
ACTIVEREPORT,
        
REPORTED,
        
CHOUSEID,
        
VIP,
}
new 
PlayerInfo[MAX_PLAYERS][PLAYER_INFO]; 
command:

PHP код:
CMD:adminsplayeridparams[ ] )
{
SendClientMessage(playeridCOLOR_GREEN,"||Online Administrators||");
for(new 
i=0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i) && PlayerInfo[i][VIP] >= 2)
            {
                new 
name[MAX_PLAYER_NAME], string[180 MAX_PLAYER_NAME];
                
GetPlayerName(inamesizeof(name));
                new 
level PlayerInfo[i][VIP];
                
format(stringsizeof(string), ""BLUE"%s"ORANGE"(%d)"WHITE" Admin Level: "ORANGE"%d",name,i,level);
                
SendClientMessage(playerid0x1E90FFAAstring);
            }
            else if(!
IsPlayerConnected(i) && PlayerInfo[i][VIP] >= 2)
            {
                
SendClientMessage(i,COLOR_RED,"No Online Admins");
            }
    }
return 
1;

it compilies fine, but in game it just shows ||Online Administrators||
even if none are online, also doesnt show if they are...
Reply
#2

try this:

pawn Код:
CMD:admins( playerid, params[ ])
{
    SendClientMessage(playerid, COLOR_GREEN,"||Online Administrators||");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][VIP] >= 2)
        {
            new name[MAX_PLAYER_NAME], string[180 + MAX_PLAYER_NAME];
            GetPlayerName(i, name, sizeof(name));
            new level = PlayerInfo[i][VIP];
            format(string, sizeof(string), ""BLUE"%s"ORANGE"(%d)"WHITE" Admin Level: "ORANGE"%d",name,i,level);
            SendClientMessage(playerid, 0x1E90FFAA, string);
        }
    }
    return 1;
}
Reply
#3

that doesnt do anything =/ still just get the client message || Online Admins ||
you just took out an else statement which has no problem lol...
more experinced scripers please...

helpppp
Reply
#4

The are no problems in the command. Are you sure your VIP- variable is set to at least 2?

pawn Код:
CMD:admins(playerid, params[])
{
SendClientMessage(playerid, COLOR_GREEN,"||Online Administrators||");
new count = 0;
    for(new i=0; i < MAX_PLAYERS; i++)
    {
            if(IsPlayerConnected(i) && PlayerInfo[i][VIP] >= 2)
            {
               new name[MAX_PLAYER_NAME], string[180 + MAX_PLAYER_NAME];
               GetPlayerName(i, name, sizeof(name));
               new level = PlayerInfo[i][VIP];
               format(string, sizeof(string), ""BLUE"%s"ORANGE"(%d)"WHITE" Admin Level: "ORANGE"%d",name,i,level);
               SendClientMessage(playerid, 0x1E90FFAA, string);
               count++;
            }

    }
    if (count == 0) SendClientMessage(playerid, 0x1E90FFAA, "No admins online");
return 1;
}
Reply
#5

im not sure if, i being an admin then test the command it wont show myself ? even if im online i want it to show myself, its hard to test because i cant have two GTA's open...

and yes i already checked my VIP level is saved at 2. =/ ive even tried setting my VIP level to 2 in game to see if that will make it work, but the same result.
Reply
#6

Erm.. its a problem in the message, try to write the message without colors, remove blue orange etc.
Reply
#7

It shows you too. Check your variable, I'm sure that's the problem.


Quote:
Originally Posted by wildcookie007
Посмотреть сообщение
Erm.. its a problem in the message, try to write the message without colors, remove blue orange etc.
Possible
Reply
#8

there are no problems with the colors in the format string
PHP код:
format(stringsizeof(string), "%s (%d) Admin Level: %d",name,i,level); 
even with out the colors like above, it still doesnt work.
Reply
#9

correction still having this problem...
Reply
#10

need to bump sorry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)