[HELP] /unban command
#1

Hello everyone.

I had a simple ban system with Ban(playerid);
Also I have pInfo where is pLocked.
Its taking too much my time to unban all those IPs, so I made /sban command, where player Info sets to pLocked = 1;
And after that Server kicks player. When hes trying to connect with this account, he cant. Server shows than account is locked and kick him. He can create new account with that IP so theres no problem. But I dont know how to unlock that player when hes not connected.

Heres my /unban command, but I dont know how to include, than it change pLocked = 1 to 0, so player can come back and play with same account.

Код:
if (strcmp(cmd, "/unban", true)==0)
	{
	  if((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >=3)
	  {
	    tmp = strtok(cmdtext, idx);
	    if(!strlen(tmp))
			{
		    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unban [PlayerName_PlayerLastName]");
	      return 1;
		 	}
		 	GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		 	GetPlayerName(playerid, sendername, sizeof(giveplayer));
		 	format(string, 256, "AdmWarning: %s has unbanned %s", sendername, tmp);
		 	ABroadCast(COLOR_YELLOW,string,1);
			format(string, 256, "AdmWarning: %s has unbanned %s", sendername, tmp);
			printf(string);
			format(string,sizeof(string),"users/%s.ini",tmp);
			fremove(string);
			SendClientMessage(playerid, COLOR_WHITE, "Player unbanned");
			SendRconCommand(string);
			SendRconCommand("reloadbans");
  			GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
			GetPlayerName(playerid, sendername, sizeof(sendername));
		}
		return 1;
	}
Thanks.
Reply
#2

Set the variable to false (or 0) then save it to the player file?
Reply
#3

Ehmm... Give me example.
Reply
#4

Depends on what file saving system you use (File Functions, dINI, dUDB etc...)
Reply
#5

ASK in LARP topic

/Cake
Reply
#6

Quote:
Originally Posted by Cake.
ASK in LARP topic

/Cake
So this is your help Man, thanks.
DO something useful to get posts.
Reply
#7

Quote:
Originally Posted by kukars22
Quote:
Originally Posted by Cake.
ASK in LARP topic

/Cake
So this is your help Man, thanks.
DO something useful to get posts.
He is right, you're supposed to post in the LA-RP topic.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)