/unban Cmd question
#1

Hello, when i use /unban cmd the variable "pBanned" will be reseting to 0 also unbanned, but it open a complete new file, it didnt write in the playerfile, how can i fix that?

Код:
CMD:unban(playerid, params[])
{
	if(pInfo[playerid][pLogged] == 1)
	{
		if(pInfo[playerid][pAdminLevel] >= 3)
		{
				new id, targetid, string[128];
				if(sscanf(params,"u", id)) return SendClientMessage(playerid, -1,""chat""COL_RED" Usage: /unban [playername]");
				else
				{
					SendClientMessage(playerid,-1,""chat""COL_RED" The user has been unbanned.");
                    format(string, 256, "/Users/%s.ini", targetid);
                    new INI:File = INI_Open(UserPath(playerid));
                    INI_SetTag(File,"data");
                    INI_WriteInt(File, "pBanned", 0);
                    INI_Close(File);
					pInfo[targetid][pBanned] = 0;
			    }
			    
	    }
	    	else {
		SendClientMessage(playerid,-1,""chat""COL_WHITE" SERVER: Unknown command.");
			}
	}
	else {
	    SendClientMessage(playerid,-1,""chat" You are not logged in!");
	    Kick(playerid);
	}
	return 1;
}
Reply


Messages In This Thread
/unban Cmd question - by Blackazur - 07.07.2013, 17:56
Re : /unban Cmd question - by yusei - 07.07.2013, 19:11

Forum Jump:


Users browsing this thread: 1 Guest(s)