SA-MP Forums Archive
ZCMD /admins command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: ZCMD /admins command (/showthread.php?tid=387003)



ZCMD /admins command - Fiore - 22.10.2012

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])



Re: ZCMD /admins command - SchurmanCQC - 22.10.2012

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.


Re: ZCMD /admins command - WizBoy - 22.10.2012

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


Re: ZCMD /admins command - Red_Dragon. - 22.10.2012

Define the "i" string


Re: ZCMD /admins command - Fiore - 22.10.2012

Where do i define it?


Re: ZCMD /admins command - Alex Magaсa - 22.10.2012

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


Re : ZCMD /admins command - yusei - 22.10.2012

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++)


Re: ZCMD /admins command - Fiore - 22.10.2012

I've no enum pHelper, what to do?


Re : ZCMD /admins command - yusei - 22.10.2012

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

try this in one player connect