ZCMD /admins command
#1

In this code:

pawn Код:
CMD:admins(playerid, params[])
{
    new online, string[128], file[32];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 5)
    {
        foreach(Player, i)
        {
            if(PlayerInfo[i][pAdmin] && aDuty[i])
            {
                online ++;
            }
        }
        format(string, sizeof(string), "<> --- Administrators --- <>");
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        foreach(Player, i)
        {
            if(PlayerInfo[i][pAdmin] && aDuty[i])
            {
                format(string, sizeof(string), "- %s %s", RPALN(i), RPN(i));
                SendClientMessage(playerid, COLOR_IRC, string);
            }
        }
    }
    else
    {
        foreach(Player, i)
        {
            if(PlayerInfo[i][pAdmin])
            {
                online ++;
            }
        }
        format(string, sizeof(string), "<> --- Administrators --- <>");
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        foreach(Player, i)
        {
            if(PlayerInfo[i][pAdmin])
            {
                if(!aDuty[i])
                {
                    format(file, sizeof(file), "users/%s.ini",RPNU(i));
                    format(string, sizeof(string), "- %s %s", RPALN(i), RPN(i));
                }
                else
                {
                    format(file, sizeof(file), "users/%s.ini",RPNU(i));
                    format(string, sizeof(string), "- %s %s", RPALN(i), RPN(i));
                }
                if(PlayerInfo[i][pGangMod]) strcat(string, " [Gang Mod]");
                SendClientMessage(playerid, COLOR_IRC, string);
            }
        }
    }
    if(PlayerInfo[i][pHelper])
        {
            online ++;
        }
    format(string, sizeof(string), "<> --- Helpers --- <>");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    foreach(Player, i)
    {
        if(PlayerInfo[i][pHelper])
        {
            format(string, sizeof(string), "- %s %s", RPHLN(i), RPN(i));
            SendClientMessage(playerid, COLOR_IRC, string);
        }
    }
    return 1;
}
I get this error:

Quote:

C:\Users\Fiore\Desktop\zGaming GM\zGaming RP\gamemodes\ZRP.pwn(8755) : error 017: undefined symbol "i"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

This is the line error:

Quote:
if(PlayerInfo[i][pHelper])
Reply
#2

Put the code in [pawn][/pawn] or because
Quote:
removes indentation. And I DO NOT, AND WILL NOT EVER read code and fix code with bad/no indentation.
Reply
#3

Dude you have not defined this "i" which you have in every string
Reply
#4

Define the "i" string
Reply
#5

Where do i define it?
Reply
#6

Do you have this script :OnPlayerConnect\
for(new i = 0; i < MAX_PLAYERS; i++)
foreach(Player, i)
Reply
#7

sherch for

enum pHelper
{
//your code
}
and add this line
new PlayerInfo[i][pHelper];


add this in one player connect for(new i = 0; i < MAX_PLAYERS; i++)
Reply
#8

I've no enum pHelper, what to do?
Reply
#9

for(new i = 0; i < sizeof(Objects); i++) PlayerInfo[playerid][pHelper][i] = 0;

try this in one player connect
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)