SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Thread Tools Display Modes
Old 12/12/2013, 04:25 PM   #1
Join Date: Oct 2013
Posts: 181
Reputation: 20
Default unban help pls

can any body type to me commands to unban this is the ban cmd
CMD:ban(playerid,params[]) {
	if(PlayerInfo[playerid][LoggedIn] == 1) {
		if(PlayerInfo[playerid][Level] >= 3) {
		    new tmp[128], tmp2[128], Index;		tmp = strtok(params,Index), tmp2 = strtok(params,Index);
		    if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /ban [playerid] [reason]");
			if(isnull(tmp2)) return SendClientMessage(playerid, red, "ERROR: You must give a reason");
	    	new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
			player1 = strval(tmp);
		 	if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) {
				GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
				new year,month,day,hour,minuite,second; getdate(year, month, day); gettime(hour,minuite,second);
				format(string,sizeof(string),"%s has been banned by Administrator %s [Reason: %s] [Date: %d/%d/%d] [Time: %d:%d]",playername,adminname,params[2],day,month,year,hour,minuite);
                format( string, sizeof(string), "%s has been banned by Administrator %s [Reason: %s]", playername,adminname,params[2] );
                GameTextForAll( string, 5000, 3 );
				if(udb_Exists(PlayerName2(player1)) && PlayerInfo[player1][LoggedIn] == 1) dUserSetINT(PlayerName2(player1)).("banned",1);
				format(string,sizeof(string),"banned by Administrator %s. Reason: %s", adminname, params[2] );
				return BanEx(player1, string);
			} else return SendClientMessage(playerid, red, "Player is not connected or is yourself or is the highest level admin");
		} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
	} else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
MORJAN1122 is offline   Reply With Quote
Old 12/12/2013, 04:40 PM   #2
xVIP3Rx's Avatar
Join Date: Feb 2013
Location: Egypt
Posts: 1,098
Reputation: 96
Default Re: unban help pls

What method do you use to save the bans ?
Can you post "SaveToFile("BanLog",string);" ?
xVIP3Rx is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ban & Unban Configuration Scripting Help 1 23/06/2013 05:03 PM
how Unban Slim_b Client Support 5 21/02/2013 10:26 AM
Unban? GhostyXL General 4 03/02/2013 05:16 PM
[Ajuda] unban s4kuL PortuguÍs/Portuguese 22 30/08/2012 10:44 PM
Help unban c0smin Scripting Help 0 01/04/2012 11:14 PM

All times are GMT. The time now is 09:50 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.