Try this:
PHP Code:
CMD:osetallgsf(playerid, params[])
{
? ? new gsflevel;
? ? if((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][AdminLevel] == 3) {
? ? ? ? if(sscanf(params, "i", gsflevel)) return SendClientMessage(playerid, COLOR_RED, "Syntax: /osetallgsf <level>");
? ? ? ? if(gsflevel > 13) return SendClientMessage(playerid, COLOR_RED, "ERROR: Max GSF level is 13");
? ? ? ? if(gsflevel < 0) return SendClientMessage(playerid, COLOR_RED, "ERROR: Cannot set lower than 0");
? ? ? ? new File: handle = fopen("allusers.txt", io_read), nick[MAX_PLAYER_NAME], INI: file, string[192], fstring[46], pname[MAX_PLAYER_NAME];
? ? ? ? GetPlayerName(playerid, pname, sizeof(pname));
? ? ? ? if(handle)
? ? ? ? {
? ? ? ? ? ? while(fread(handle, nick))
? ? ? ? ? ? {
? ? ? ? ? ? ? ? StripNewLine(nick);
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? format(fstring, 46, "Users/%s.ini", nick);
? ? ? ? ? ? if(INI_ParseFile(fstring, "LoadGSFLevel", .bPassTag = true)) {
? ? ? ? ? ? if(GSFLevelInfo >= 1) {
? ? ? ? ? ? ? ? format(string, sizeof(string), "[STAFF]: \"%s\" has issued the command: {FF0000}OSETALLGSF{00FFFF}.", pname);
? ? ? ? ? ? ? ? SendToRCON(COLOR_AQUA, string);
? ? ? ? ? ? ? ? format(string, sizeof(string), "[{FF0000}GSF{FFFFFF}]: Successfully offline set {FF0000}%s's{FFFFFF} GSF level to: %i.", nick, gsflevel);
? ? ? ? ? ? ? ? SendClientMessage(playerid, COLOR_WHITE, string);
? ? ? ? ? ? ? ? file = INI_Open(fstring);
? ? ? ? ? ? ? ? INI_SetTag(file, "=|PlayerData|=");
? ? ? ? ? ? ? ? INI_WriteInt(file, "GSFLevel", gsflevel);
? ? ? ? ? ? ? ? INI_Close(file);
? ? ? ? ? ? } else return SendClientMessage(playerid, COLOR_RED, "ERROR: No account was found having a GSF level.");
}
? ? ? ? ? ? }
? ? ? ? ? ? fclose(handle);
? ? ? ? } else return SendClientMessage(playerid, COLOR_RED, "ERROR: The file \"allusers.txt\" does not exist, therefore canceling the process.");
? ? ? ? return 1;
? ? } else return SendClientMessage(playerid, COLOR_RED, "ERROR: Authorization revoked.");
}