Create command /admins in dialog [ERROR]
#1

CMD:admins()
{
new string[300], fstring[64], adminname[25];
for(new i=0; i<MAX_PLAYERS; i++)
{

if(Admin i=0; && IsPlayerConnected(i))
{
GetPlayerName(i,adminname, sizeof(adminname));
format(fstring, sizeof(fstring),"%s (%i) - {FF0000}Level: %i{FFFFFF}\n", adminname, i,Admin[i]);
strcat(string, fstring, sizeof(string));
}
}
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"O nline Admins",string,"OK","");
return 1;
}

Please Help me Change declaration or Function
Reply
#2

Copy paste the errors line
Reply
#3

the one I give the red mark is ERROR
Reply
#4

Try this:

CMD:admins()
{
new string[300], fstring[64], adminname[25];
for(new i=0; i<MAX_PLAYERS; i++)
{
if(Admin[i] == 0 && IsPlayerConnected(i))
{
GetPlayerName(i,adminname, sizeof(adminname));
format(fstring, sizeof(fstring),"%s (%i) - {FF0000}Level: %i{FFFFFF}\n", adminname, i,Admin[i]);
strcat(string, fstring);
}
}
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"O nline Admins",string,"OK","");
return 1;
}
Reply
#5

Quote:
Originally Posted by Tihoy232
Посмотреть сообщение
CMD:admins()
{
new string[300], fstring[64], adminname[25];
for(new i=0; i<MAX_PLAYERS; i++)
{

if(Admin i=0; && IsPlayerConnected(i))
{
GetPlayerName(i,adminname, sizeof(adminname));
format(fstring, sizeof(fstring),"%s (%i) - {FF0000}Level: %i{FFFFFF}\n", adminname, i,Admin[i]);
strcat(string, fstring, sizeof(string));
}
}
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"O nline Admins",string,"OK","");
return 1;
}

Please Help me Change declaration or Function
Код:
CMD:admins()
{
	new string[1000],adminname[MAX_PLAYER_NAME], AdminsOnLine;
	for(new i=0; i<MAX_PLAYERS; i++){
		if(!IsPlayerConnected(i) && Admin[i] == 0) continue;
		AdminsOnLine++;
	}
	if(AdminsOnLine > 0){
		format(string, sizeof(string),"Admins is online (%d)", AdminsOnLine);
	}else format(string, sizeof(string),"Admins are not online!", AdminsOnLine);

	for(new i=0; i<MAX_PLAYERS; i++)
	{
		if(!IsPlayerConnected(i) && Admin[i] == 0) continue;
		GetPlayerName(i,adminname, sizeof(adminname));
format(string, sizeof(string),"%s\n %s(ID:%i) - {FF0000}Level: %i{FFFFFF}\n",string, adminname, i,Admin[i]);
}
return ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"O nline Admins",string,"OK","");
}
Reply
#6

You guys are making such a simple command to look like the most complex one when it doesn't have to be so difficult.
Reply
#7

Quote:
Originally Posted by ForCop
Посмотреть сообщение
Код:
CMD:admins()
{
	new string[1000],adminname[MAX_PLAYER_NAME], AdminsOnLine;
	for(new i=0; i<MAX_PLAYERS; i++){
		if(!IsPlayerConnected(i) && Admin[i] == 0) continue;
		AdminsOnLine++;
	}
	if(AdminsOnLine > 0){
		format(string, sizeof(string),"Admins is online (%d)", AdminsOnLine);
	}else format(string, sizeof(string),"Admins are not online!", AdminsOnLine);

	for(new i=0; i<MAX_PLAYERS; i++)
	{
		if(!IsPlayerConnected(i) && Admin[i] == 0) continue;
		GetPlayerName(i,adminname, sizeof(adminname));
format(string, sizeof(string),"%s\n %s(ID:%i) - {FF0000}Level: %i{FFFFFF}\n",string, adminname, i,Admin[i]);
}
return ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"O nline Admins",string,"OK","");
}
CMD:admins(playerid) - player command
Reply
#8

Quote:
Originally Posted by UFF
Посмотреть сообщение
CMD:admins(playerid) - player command
he's already big, he knows how to put it "playerid"
Reply
#9

Quote:
Originally Posted by Tihoy232
Посмотреть сообщение
CMD:admins()
{
new string[300], fstring[64], adminname[25];
for(new i=0; i<MAX_PLAYERS; i++)
{

if(Admin i=0; && IsPlayerConnected(i))
{
GetPlayerName(i,adminname, sizeof(adminname));
format(fstring, sizeof(fstring),"%s (%i) - {FF0000}Level: %i{FFFFFF}\n", adminname, i,Admin[i]);
strcat(string, fstring, sizeof(string));
}
}
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"O nline Admins",string,"OK","");
return 1;
}

Please Help me Change declaration or Function
Quote:
Originally Posted by ForCop
Посмотреть сообщение
he's already big, he knows how to put it "playerid"
i see, then he could have did that instead of posting here.

Anyhow, his problem got fixed!
Reply
#10

Quote:
Originally Posted by UFF
Посмотреть сообщение
i see, then he could have did that instead of posting here.

Anyhow, his problem got fixed!
yes
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)