17.07.2014, 16:04
So i've been trying all day to make a /makeadmin command and i've resulted in nothing new,
So here's my command
Now i've tried changing the %d to %s to display what level they were set too, also it doesn't set the admin level in their user file, don't know why.
If anyone can help, that would be great.
So here's my command
Код:
CMD:makeadmin(playerid, params[]) { new PID, str[128], param; new PName[MAX_PLAYER_NAME], AName[MAX_PLAYER_NAME]; GetPlayerName(playerid, AName, sizeof(AName)); GetPlayerName(PID, PName, sizeof(PName)); if(PlayerInfo[playerid][pAdminLevel] >=5) { if(sscanf(params, "us[64]", PID, pAdminLevel)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /makeadmin [playerid] [Admin Level]"); if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_RED, "Player is not connected!"); format(str, sizeof(str), "%s Has set %s 's Administrator level to %d", AName, PName, param); new INI:File = INI_Open(UserPath(PID)); INI_SetTag(File,"data"); INI_WriteInt(File,"AdminLevel", param); INI_Close(File); foreach(Player, i) { if(PlayerInfo[i][pAdminLevel] > 0){ SendClientMessage(i,COLOR_YELLOW,str);}} } else { SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use that command"); } return 1; }
If anyone can help, that would be great.