/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
#2

same porblem
Reply
#3

Any suggestions?
Reply
#4

Would be nice if someone help? I really need help.
Reply
#5

Maybe its the script your using? Some scripts may already have an unban command?
Reply
#6

I used to use that method for user files, I did manage to write an /unban [name] command. It worked perfect in windows but often crashed the server in Linux.

I think it was something about the file permissions.

I can post what I made if you want, but like I said, it did crash the server a lot.
Reply
#7

What did you do? Any ideas of what's causing this bug? By the way, I am using fopen for my registration.
Reply
#8

Sorry for the late reply, was kinda busy.

This is a very old version of the command i wrote for my gamemode, i now use dcmd, sscanf and for user accounts i use sqlite, which makes unbanning and account editing work perfectly.

Anyway, i couldn't figure out why it was making it crash, the only thing i changed this time was "io_append" because i was using "io_write" before.

Maybe that was causing a problem, i dont know.

http://pastebin.com/X06Jia38

Good luck
Reply
#9

Thanks, I'll test it in game and see what happens.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)