/unban Command
#1

Код:
	if (strcmp(cmd, "/unban", true)==0)
	{
	  if((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >=4)
	  {
	    tmp = strtok(cmdtext, idx);
	    if(!strlen(tmp))
			{
		    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unban [PlayerName_LastName]");
	      return 1;
		 	}
		 	GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		 	GetPlayerName(playerid, sendername, sizeof(giveplayer));
		 	format(string, 256, "AdmWarning: %s has unbanned account %s", sendername, tmp);
		 	ABroadCast(COLOR_YELLOW,string,1);
			format(string, 256, "AdmWarning: %s has unbanned account %s", sendername, tmp);
			printf(string);
			format(string,sizeof(string),"users/%s.ini",tmp);
            dini_IntSet(string, "Banned", 0);
            dini_IntSet(string, "Warnings", 0);
			SendClientMessage(playerid, COLOR_WHITE, "Player Unbanned");
			SendRconCommand(string);
			SendRconCommand("reloadbans");
  			GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
			GetPlayerName(playerid, sendername, sizeof(sendername));
		}
		return 1;
	}
I am trying to script /unban command that would unban a player using his FirstName_LastName format, and would also set his warnings to 0 and set his banned status to 0. The command happens to work fine, however it messes up the Userfile format. If I unban anyone using this command it will mess up the userfile. For Example: On GodFather Script, we all know that Userfile functions come one after the one .. Like this: Level=1AdminLevel=0(and whatsoever). If I use /unban it will bug the account and change the format to this...
Level=1
AdminLevel=0
(and all other functions).

I have no clue what's causing this. Anyone experienced this problem before and fixed it? if so please help.
Reply


Messages In This Thread
/unban Command - by andyF - 31.03.2010, 01:25
Re: /unban Command - by jaheem - 31.03.2010, 15:58
Re: /unban Command - by andyF - 31.03.2010, 16:41
Re: /unban Command - by andyF - 01.04.2010, 04:30
Re: /unban Command - by Postalityjr - 01.04.2010, 04:54
Re: /unban Command - by Outbreak - 01.04.2010, 05:04
Re: /unban Command - by andyF - 01.04.2010, 05:07
Re: /unban Command - by Outbreak - 01.04.2010, 15:01
Re: /unban Command - by andyF - 01.04.2010, 17:10

Forum Jump:


Users browsing this thread: 1 Guest(s)