SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 04/02/2011, 12:00 PM   #1
stefanel9944
Big Clucker
 
stefanel9944's Avatar
 
Join Date: Dec 2010
Location: Buzau Romania
Posts: 126
Reputation: 1
Default Unban Command

Any1 cand make me 1 unban command for this bann command
Code:
	if(strcmp(cmd, "/ban", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	    	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /bans [playerid/PartOfName] [reason]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 1338)
			{
			    if(IsPlayerConnected(giveplayerid))
			    {
			        if(giveplayerid != INVALID_PLAYER_ID)
			        {
					    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						new length = strlen(cmdtext);
						while ((idx < length) && (cmdtext[idx] <= ' '))
						{
							idx++;
						}
						new offset = idx;
						new result[64];
						while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
						{
							result[idx - offset] = cmdtext[idx];
							idx++;
						}
						result[idx - offset] = EOS;
						if(!strlen(result))
						{
							SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /bans [playerid/PartOfName] [reason]");
							return 1;
						}
						new year, month,day;
						getdate(year, month, day);
						format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
						BanLog(string);
						format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, (result));
						SendClientMessageToAll(COLOR_LIGHTRED, string);
						PlayerInfo[giveplayerid][pAdmin] = PlayerInfo[giveplayerid][pLevel];
						PlayerInfo[giveplayerid][pBlocat] = 1;
                        new playersip[256];
						GetPlayerIp(giveplayerid,playersip, sizeof(playersip));
					    SendClientMessage(giveplayerid,COLOR_DBLUE,"|___________[BAN INFO]___________|");
			            format(string, sizeof(string), "Numele tau este: %s.",giveplayer);
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "IP-ul tau este: %s.",playersip);
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "Ai fost banat de: %s.",sendername);
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "Ai fost banat pentru urmatorul motiv: %s.",(result));
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "Ai fost banat pe data de: %d/%d/%d (Ziua-Luna-Anul)",day,month,year);
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                        SendClientMessage(giveplayerid,COLOR_DBLUE,"|___________[BAN INFO]___________|");
                        SendClientMessage(giveplayerid,COLOR_LIGHTRED,"[BAN INFO]: Poti face o cerere de unban pe forumul nostru.Forumul este www.blackrockk.eu Succes !");
                        SendClientMessage(giveplayerid,COLOR_WHITE,"[HINT]: Te sfatuim sa faci o poza la aceste informatii,si sa o postezi cand faci cerere unban.Apasa F8 pentru a face poza !");
						Ban(giveplayerid);
						return 1;
					}
				}//not connected
			}
			else
			{
				format(string, sizeof(string), "   %d is not an active player.", giveplayerid);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}
stefanel9944 is offline  
Old 04/02/2011, 01:12 PM   #2
stefanel9944
Big Clucker
 
stefanel9944's Avatar
 
Join Date: Dec 2010
Location: Buzau Romania
Posts: 126
Reputation: 1
Default Re: Unban Command

UP zz
stefanel9944 is offline  
Old 04/02/2011, 02:17 PM   #3
Steven Paul
Huge Clucker
 
Steven Paul's Avatar
 
Join Date: Jan 2011
Location: Dallas
Posts: 307
Reputation: 0
Default Re: Unban Command

just delete the Ban(giveplayerid);
__________________
Steven Paul is offline  
Old 04/02/2011, 02:40 PM   #4
stefanel9944
Big Clucker
 
stefanel9944's Avatar
 
Join Date: Dec 2010
Location: Buzau Romania
Posts: 126
Reputation: 1
Default Re: Unban Command

plz post comand again working
stefanel9944 is offline  
Old 04/02/2011, 02:46 PM   #5
Steven Paul
Huge Clucker
 
Steven Paul's Avatar
 
Join Date: Jan 2011
Location: Dallas
Posts: 307
Reputation: 0
Default Re: Unban Command

use rcon unbanip
__________________
Steven Paul is offline  
Old 04/02/2011, 03:06 PM   #6
stefanel9944
Big Clucker
 
stefanel9944's Avatar
 
Join Date: Dec 2010
Location: Buzau Romania
Posts: 126
Reputation: 1
Default Re: Unban Command

no man i need 1 unban comand for set in user .dini at Blocat =1 to change in blocat =0
stefanel9944 is offline  
Old 04/02/2011, 04:14 PM   #7
stefanel9944
Big Clucker
 
stefanel9944's Avatar
 
Join Date: Dec 2010
Location: Buzau Romania
Posts: 126
Reputation: 1
Default Re: Unban Command

up xd
stefanel9944 is offline  
Old 30/05/2011, 10:30 PM   #8
gabitzu4ever
Gangsta
 
Join Date: Sep 2010
Posts: 739
Reputation: 8
Default Re: Unban Command

upppp
__________________
pawn Code:
#define MAX_IDIOT 999999999999
new Query[MAX_IDIOTS];
format(Query,sizeof(Query),"SELECT `idiots` FROM `country` WHERE `IQ` ='-999999999'");
mysql_query(Query);
gabitzu4ever is offline  
Old 30/05/2011, 10:33 PM   #9
Tachibana
Huge Clucker
 
Tachibana's Avatar
 
Join Date: May 2011
Posts: 455
Reputation: 14
Default Re: Unban Command

Stop bumping the topic and wait for someone to respond to you...
Tachibana is offline  
Old 30/05/2011, 11:08 PM   #10
Donya
Gangsta
 
Join Date: Mar 2011
Posts: 798
Reputation: 31
Default Re: Unban Command

first off, if you want an unban command by name, you have to make your own file/sql etc ban system.

if you want to use the default system by sa-mp, then simply make it with SendRconCommand("unban ip theip"); etc

heres a nice example i found that can be used with [name] if you save their ip and their names etc

pawn Code:
if(!strcmp(cmd, "/unban", true))
{
        new tmp[256], idx;
        new string[128];
 
        tmp = strtok(cmdtext, idx);
 
        if(!strlen(tmp))
                return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unban [name]");
 
        new Accstring[128];
        format(Accstring, sizeof(Accstring), "accounts/%s.ini", tmp);
        if(!fexist(Accstring))
        {
                SendClientMessage(playerid, COLOR_RED, "***[Error] The account name you entered does not exist in the database.");
                SendClientMessage(playerid, COLOR_RED, "Please check the name and try again, type it EXACTLY as it appears.");
                return 1;
        }
 
        new pass[128],plIp[128],level,warns,kills,deaths,money,bank,pPoints,pAccount,skin,plHours,plMins,jailtime;
        new banned = 0;
        new File: pFile = fopen(Accstring, io_read);
        if (pFile)
        {
                format(pass, 128, dini_Get(Accstring, "Password"));
                format(plIp, 128, dini_Get(Accstring, "IP"));
                level = dini_Int(Accstring, "AdminLevel");
                warns = dini_Int(Accstring, "Warnings");
                kills = dini_Int(Accstring, "Kills");
                deaths = dini_Int(Accstring, "Deaths");
                money = dini_Int(Accstring, "Money");
                bank = dini_Int(Accstring, "Bank");
                pPoints = dini_Int(Accstring, "PremPoints");
                pAccount = dini_Int(Accstring, "PremAccount");
                skin = dini_Int(Accstring, "Skin");
                plHours = dini_Int(Accstring, "PlayingHours");
                plMins = dini_Int(Accstring, "PlayingMinutes");
                jailtime = dini_Int(Accstring, "JailTime");
                fclose(pFile);
        }
 
        new var[32];
        new File: hFile = fopen(Accstring, io_append);
 
        if(hFile)
        {
                format(var, 32, "Password=%s\n", pass);fwrite(pFile, var);
                format(var, 32, "IP=%s\n", plIp);fwrite(hFile, var);
                format(var, 32, "AdminLevel=%d\n",level);fwrite(hFile, var);
                format(var, 32, "Warnings=%d\n",warns);fwrite(hFile, var);
                format(var, 32, "Kills=%d\n",kills);fwrite(hFile, var);
                format(var, 32, "Deaths=%d\n",deaths);fwrite(hFile, var);
                format(var, 32, "Money=%d\n",money);fwrite(hFile, var);
                format(var, 32, "Bank=%d\n",bank);fwrite(hFile, var);
                format(var, 32, "PremPoints=%d\n",pPoints);fwrite(hFile, var);
                format(var, 32, "PremAccount=%d\n",pAccount);fwrite(hFile, var);
                format(var, 32, "Skin=%d\n",skin);fwrite(hFile, var);
                format(var, 32, "Banned=%d\n",banned);fwrite(hFile, var);
                format(var, 32, "PlayingHours=%d\n",plHours);fwrite(hFile, var);
                format(var, 32, "PlayingMinutes=%d\n",plMins);fwrite(hFile, var);
                format(var, 32, "JailTime=%d\n",jailtime);fwrite(hFile, var);
                fclose(hFile);
        }
 
        format(string,sizeof(string),"unbanip %s",pIp);
        SendRconCommand(string);
        SendRconCommand("reloadbans");
 
        format(string, 128, "You have successfully unbanned %s", tmp);
        SendClientMessage(playerid, COLOR_GREEN, string);
        return 1;
}

i'll make my own for you if i have time
Donya is offline  
 

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
Unban command help please darkknight123 Help Archive 3 13/01/2011 04:21 AM
/unban command [asg]davo Help Archive 7 01/06/2010 09:08 AM
/unban Command andyF Help Archive 8 01/04/2010 05:10 PM
Need /unban Command Dudits Help Archive 8 30/03/2010 04:17 PM
[HELP] /unban command kukars22 Help Archive 6 26/11/2009 01:08 PM


All times are GMT. The time now is 06:19 PM.


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