21.01.2016, 12:56
Hey guys, im trying to make a simple /admins command,
What this should do is get all connected players, see who has a level that equals or is higher then 1 and then send a clientmessage showing all the connected admins.
i've made the code, but its a bit buggy for some reason.
If i'm connected it sends a clientmessage saying " : "
any idea on how to fix this, and is this a good way of doing this?
What this should do is get all connected players, see who has a level that equals or is higher then 1 and then send a clientmessage showing all the connected admins.
i've made the code, but its a bit buggy for some reason.
Код:
CMD:admins(playerid) { new admincount = 0, string[128]; for(new i, j = GetMaxPlayers(); i != j; i++) { if(pData[playerid][Admin] >= 1 && IsPlayerConnected(i)) admincount ++; format(string,sizeof(string),"{FF00FF}%s : %s - %s",GetName(i),pData[playerid][Admin],AdminsLevelS(i)); if(admincount <= 0) return SendClientMessage(playerid,-1,"Error:{FF0000} No admin online"); } SendClientMessage(playerid,-1,string); return 1; }
any idea on how to fix this, and is this a good way of doing this?