help please - 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: help please (
/showthread.php?tid=410141)
help please -
CBCandyBoy - 24.01.2013
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)
Re: help please -
Roach_ - 24.01.2013
Delete the foreach include, and install
this includes, the name of the inc is y_iterate
It should do the work..
Re: help please -
DaRk_RaiN - 24.01.2013
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;
}
Re: help please -
Roach_ - 24.01.2013
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..
Re: help please -
DaRk_RaiN - 24.01.2013
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.
Re: help please -
Roach_ - 24.01.2013
Quote:
Originally Posted by DaRk_RaiN
I fixed his code mind your own business.
|
You are very irritating..
Re: help please -
DaRk_RaiN - 24.01.2013
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