help please
#1

man i have included this

#include <foreach>

and this is my command

Код:
CMD:admins(playerid,params[])
{
    new Count = 0;
    new string[100], n[MAX_PLAYER_NAME];
    foreach(new i : Player)
    {
        if(PlayerInfo[i][Level] > 0)
        {
            GetPlayerName(i,n,sizeof(n));
            format(string,sizeof(string),"Level %d: %s (ID: %d) - %s", PlayerInfo[i][Level], n, i, GetRankFromLevel(i));
			ShowPlayerDialog(playerid, 7, DIALOG_STYLE_MSGBOX, "Online Admins...", string, "ok", "");
            Count++;
        }
    }
    if(Count == 0)
    {
			ShowPlayerDialog(playerid, 7, DIALOG_STYLE_MSGBOX,"Online Admins...", "There Are No Administrators Online.", "ok", "");
    }
    return 1;
}
and showing me this error please help me

Код:
C:\Users\AyushSekhari\Desktop\RevolutionX sa-mp server\gamemodes\gamemode\RGXTDM.pwn(31208) : error 017: undefined symbol "foreach"
C:\Users\AyushSekhari\Desktop\RevolutionX sa-mp server\gamemodes\gamemode\RGXTDM.pwn(31208) : error 029: invalid expression, assumed zero
C:\Users\AyushSekhari\Desktop\RevolutionX sa-mp server\gamemodes\gamemode\RGXTDM.pwn(31208) : error 017: undefined symbol "i"
C:\Users\AyushSekhari\Desktop\RevolutionX sa-mp server\gamemodes\gamemode\RGXTDM.pwn(31208) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
please help me the line

Код:
foreach(new i : Player)
Reply
#2

Delete the foreach include, and install this includes, the name of the inc is y_iterate
It should do the work..
Reply
#3

pawn Код:
CMD:admins(playerid,params[])
{
    new Count = 0;
    new string[100], n[MAX_PLAYER_NAME];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][Level] > 0)
        {
            GetPlayerName(i,n,sizeof(n));
            format(string,sizeof(string),"Level %d: %s (ID: %d) - %s", PlayerInfo[i][Level], n, i, GetRankFromLevel(i));
            ShowPlayerDialog(playerid, 7, DIALOG_STYLE_MSGBOX, "Online Admins...", string, "ok", "");
            Count++;
        }
    }
    if(Count == 0)
    {
            ShowPlayerDialog(playerid, 7, DIALOG_STYLE_MSGBOX,"Online Admins...", "There Are No Administrators Online.", "ok", "");
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
pawn Код:
CMD:admins(playerid,params[])
{
    new Count = 0;
    new string[100], n[MAX_PLAYER_NAME];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][Level] > 0)
        {
            GetPlayerName(i,n,sizeof(n));
            format(string,sizeof(string),"Level %d: %s (ID: %d) - %s", PlayerInfo[i][Level], n, i, GetRankFromLevel(i));
            ShowPlayerDialog(playerid, 7, DIALOG_STYLE_MSGBOX, "Online Admins...", string, "ok", "");
            Count++;
        }
    }
    if(Count == 0)
    {
            ShowPlayerDialog(playerid, 7, DIALOG_STYLE_MSGBOX,"Online Admins...", "There Are No Administrators Online.", "ok", "");
    }
    return 1;
}
Why are you changing the code, if that guy want to use foreach(y_iterate) let him use it..
Reply
#5

Quote:
Originally Posted by Roach_
Посмотреть сообщение
Why are you changing the code, if that guy want to use foreach(y_iterate) let him use it..
I fixed his code mind your own business.
Reply
#6

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
I fixed his code mind your own business.
You are very irritating..
Reply
#7

Quote:
Originally Posted by Roach_
Посмотреть сообщение
You are very irritating..
You're a kid, and look who's talking about irritating,maybe you should keep your own business since sticking your nose in other's will get you in uncomfortable situations, i won't reply to your none sense crap childish talking after this, if you wish to keep'on the bla bla PM.
/cry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)