Help with "INI_WriteInt"
#3

Quote:
Originally Posted by Troydere
Посмотреть сообщение
You forgot to set the [data] tag.

Код:
INI_SetTag(ACCOUNT, "data");
EDIT: If you did not know, in your case it goes right before INI_WriteInt, right after the opening of the file.
Ok i solve the issue , but now i would like to add reason to the obanacc command but each time i try to /obanacc IG is returns an error saying the player name is not registered.

Код:
CMD:obanacc(playerid, params[])
{
   	if(IsPlayerAdmin(playerid) || pInfo[playerid][Admin] >= 4)
	{
		new Name,file[100],reason[100];
		if(sscanf(params, "us[50]", Name, reason)) return SendClientMessage(playerid, error, "Usage: /obanacc <Player Name> <Reason>");
   		format(file, 100, PATH, Name);
        if (!fexist(file)) return SendClientMessage(playerid,error,"Error: This player doesn't have an account!");
      	new INI:ACCOUNT = INI_Open(file);
        INI_SetTag(ACCOUNT,"data");
		INI_WriteInt(ACCOUNT, "Banned", 1);
		INI_Close(ACCOUNT);
	    format(astring, sizeof(astring),"Account '%s has been successfully banned!",Name);
        SendClientMessage(playerid,-1,astring);
        format(astring, sizeof(astring),"AdmCmd: An Administrator has Banned Account '%s'. [Reason: %s]",Name,reason);
        SendClientMessageToAll(red,astring);
        format(astring,sizeof(astring),"[OBAN]: %s has banned account name %s. [Reason: %s] ",GetName(playerid),Name,reason);
		WriteToLog(astring,"oBans");
        CommandToAdmins(playerid,"obanacc");
		return 1;
	}
	else return ShowMessage(playerid, error, 1);
}
Reply


Messages In This Thread
Help with "INI_WriteInt" - by 1fret - 05.03.2017, 22:52
Re: Help with "INI_WriteInt" - by Toroi - 05.03.2017, 23:20
Re: Help with "INI_WriteInt" - by 1fret - 06.03.2017, 01:31
Re: Help with "INI_WriteInt" - by Toroi - 06.03.2017, 01:35
Re: Help with "INI_WriteInt" - by 1fret - 06.03.2017, 01:59

Forum Jump:


Users browsing this thread: 1 Guest(s)