SA-MP Forums Archive
[HELP] /unban command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] /unban command (/showthread.php?tid=110357)



[HELP] /unban command - kukars22 - 25.11.2009

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.


Re: [HELP] /unban command - LarzI - 25.11.2009

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


Re: [HELP] /unban command - kukars22 - 25.11.2009

Ehmm... Give me example.


Re: [HELP] /unban command - LarzI - 26.11.2009

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


Re: [HELP] /unban command - Daniel_Truk - 26.11.2009

ASK in LARP topic

/Cake


Re: [HELP] /unban command - kukars22 - 26.11.2009

Quote:
Originally Posted by Cake.
ASK in LARP topic

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


Re: [HELP] /unban command - Eazy_Efolife - 26.11.2009

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.