[HELP]dcmd_admins
#1

Код:
dcmd_admins(playerid, params[])
{
	#pragma unused params
	new string[128],AdminName[MAX_PLAYER_NAME], count = 0;
	
	SendClientMessage(playerid, COLOR_GREEN3, " ");
	SendClientMessage(playerid, COLOR_GREEN3, "Online Administrators:");
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	 	if (IsPlayerConnected(i))
 		{
			if(PlayerInfo[i][AdminLevel] > 1)
	 		{
			GetPlayerName(i, AdminName, sizeof(AdminName));
			format(string, sizeof(string), "%s (ID:%d)", AdminName[i], i);
			SendClientMessage(playerid, COLOR_WHITE, string);
			count++;
			}
		}
	}
	if (count == 0) SendClientMessage(playerid,COLOR_WHITE,"No administrators online in the list, try /mods to see online moderators.");

return 1;
}
When i type "/admins" in game, it shows as (my nick: Lastrace, second player's nick: Firstrace):

Online Administrators:

astrace(ID:0)
rstrace(ID:1)


It eats my first letter (L), and at second it eats his first two letter (F and i), whats wrong there?
Reply
#2

pawn Код:
format(string, sizeof(string), "%s (ID:%d)", AdminName[i], i);
should be
pawn Код:
format(string, sizeof(string), "%s (ID:%d)", AdminName, i);
Reply
#3

Remove [i] from AdminName[i] =D
PS: Admins level 1 aren't shown because you haven't >= 1 but you probably know that =D

Post over me was faster xD
Reply
#4

1= mod
2 =< admin

its ok, ty mates
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)