10.03.2012, 18:40
(
Последний раз редактировалось TimKen; 11.03.2012 в 10:55.
)
I am trying to put the command /admins on more lines when there are more admins.
For example if there are 3 admins everything is fine with the line.
If there are 4, the 4th's name is half-shown.
This is the command
For example if there are 3 admins everything is fine with the line.
If there are 4, the 4th's name is half-shown.
This is the command
Код:
dcmd_admins(playerid,params[]) { #pragma unused params if(AccInfo[playerid][LoggedIn] == 1) { if(AccInfo[playerid][Level] >= 0) { new bool:First2 = false; new Count, i; new string[128]; new adminname[MAX_PLAYER_NAME]; for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && AccInfo[i][Level] > 0) Count++; if(Count == 0) return SendClientMessage(playerid,red, "No admins online."); for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && AccInfo[i][Level] > 0) { if(AccInfo[i][Level] > 0) { switch(AccInfo[i][Level]) { case 1: AccType = "Tester"; case 2: AccType = "Mod"; case 3: AccType = "Admin"; case 4: AccType = "{05BDFA}Leader{FF0000}"; case 5: AccType = "{05BDFA}Manager/Owner{FF0000}"; } } GetPlayerName(i, adminname, sizeof(adminname)); if(!First2) { format(string, sizeof(string), "{05BDFA}Online admins:{FF0000} %s [%s]", PlayerName2(i),AccType); First2 = true; } else format(string,sizeof(string),"%s, %s [%s]",string, PlayerName2(i),AccType); } return SendClientMessage(playerid,red,string); } else return ErrorMessages(playerid, 1); } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands"); }