SA-MP Forums Archive
Name Unban Scripting help - 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)
+--- Thread: Name Unban Scripting help (/showthread.php?tid=645588)



Name Unban Scripting help - Espressino - 30.11.2017

Код:
CMD:nameunban(playerid,params[])
{
if(PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid,red, "You Cant Use This Command !!!");
if(IsPlayerAdmin(playerid))
{
		new tmp[256], Index;        tmp = strtok(params,Index);
		if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /nameunban [name]");
		new adminname[MAX_PLAYER_NAME], string[128], unbanname[256];
		unbanname = tmp;
		if(udb_Exists(unbanname))
		{
			dUserSetINT(unbanname).("Banned", 0);
			GetPlayerName(playerid, adminname, sizeof(adminname));
			CMDMessageToAdmins(playerid,"NAMEUNBAN");
			SaveToFile("UnBanNameLog",string);
            SendRconCommand("reloadbans");
			print(string);
			return 1;
    	}
	    else return SendClientMessage(playerid, red, "ERROR: No player with this name.");
	}
    else return SendClientMessage(playerid,red,"ERROR: You Need To Be A High Level Admin To Use This Command");
}
this CMD need login /rcon login password
, i want use this ,if(PlayerInfo[playerid][Level] < 2) this only,how
i dont want use rcon to unban player,i just want level 2+ can unban player,how?


Re: Name Unban Scripting help - xTURBOx - 30.11.2017

Код:
CMD:nameunban(playerid,params[])
{
if(PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid,red, "You Cant Use This Command !!!");
	new tmp[256], Index;        tmp = strtok(params,Index);
	if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /nameunban [name]");
	new adminname[MAX_PLAYER_NAME], string[128], unbanname[256];
	unbanname = tmp;
	if(udb_Exists(unbanname))
	{
		dUserSetINT(unbanname).("Banned", 0);
		GetPlayerName(playerid, adminname, sizeof(adminname));
		CMDMessageToAdmins(playerid,"NAMEUNBAN");
		SaveToFile("UnBanNameLog",string);
        SendRconCommand("reloadbans");
		print(string);
		return 1;
   	}
    else return SendClientMessage(playerid, red, "ERROR: No player with this name.");
}



Re: Name Unban Scripting help - Espressino - 30.11.2017

Код:
C:\Users\aiman\Desktop\Server\ADADA\LTFDM.pwn(19421) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.



Re: Name Unban Scripting help - Espressino - 30.11.2017

Quote:
Originally Posted by xTURBOx
Посмотреть сообщение
Код:
CMD:nameunban(playerid,params[])
{
if(PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid,red, "You Cant Use This Command !!!");
	new tmp[256], Index;        tmp = strtok(params,Index);
	if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /nameunban [name]");
	new adminname[MAX_PLAYER_NAME], string[128], unbanname[256];
	unbanname = tmp;
	if(udb_Exists(unbanname))
	{
		dUserSetINT(unbanname).("Banned", 0);
		GetPlayerName(playerid, adminname, sizeof(adminname));
		CMDMessageToAdmins(playerid,"NAMEUNBAN");
		SaveToFile("UnBanNameLog",string);
        SendRconCommand("reloadbans");
		print(string);
		return 1;
   	}
    else return SendClientMessage(playerid, red, "ERROR: No player with this name.");
}
it work,but i got Loose identition

Код:
	new tmp[256], Index;        tmp = strtok(params,Index);
here is the loost identition


Re: Name Unban Scripting help - Ritzy2K - 30.11.2017

Код:
CMD:nameunban(playerid, params[])
{
	if(PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid,red, "You Cant Use This Command !!!");
	
		new tmp[256], Index;
		tmp = strtok(params,Index);
		
		if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /nameunban [name]");
		new adminname[MAX_PLAYER_NAME], string[128], unbanname[256];
		unbanname = tmp;
		
		if(udb_Exists(unbanname))
		{
			dUserSetINT(unbanname).("Banned", 0);
			GetPlayerName(playerid, adminname, sizeof(adminname));
			CMDMessageToAdmins(playerid,"NAMEUNBAN");
			SaveToFile("UnBanNameLog",string);
            SendRconCommand("reloadbans");
			print(string);
			return 1;
    	}
	    else return SendClientMessage(playerid, red, "ERROR: No player with this name.");
    
}
Tip: Use dini2 by Gammix, and use sscanf by ****** for params or use isnull


Re: Name Unban Scripting help - Espressino - 30.11.2017

Quote:
Originally Posted by Ritzy
Посмотреть сообщение
Код:
CMD:nameunban(playerid, params[])
{
	if(PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid,red, "You Cant Use This Command !!!");
	
		new tmp[256], Index;
		tmp = strtok(params,Index);
		
		if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /nameunban [name]");
		new adminname[MAX_PLAYER_NAME], string[128], unbanname[256];
		unbanname = tmp;
		
		if(udb_Exists(unbanname))
		{
			dUserSetINT(unbanname).("Banned", 0);
			GetPlayerName(playerid, adminname, sizeof(adminname));
			CMDMessageToAdmins(playerid,"NAMEUNBAN");
			SaveToFile("UnBanNameLog",string);
            SendRconCommand("reloadbans");
			print(string);
			return 1;
    	}
	    else return SendClientMessage(playerid, red, "ERROR: No player with this name.");
    
}
Tip: Use dini2 by Gammix, and use sscanf by ****** for params or use isnull
Код:
CMD:unban(playerid,params[])
{
if(PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid,red, "ERROR: You are not a high enough level to use this command");
new tmp[256], Index;        tmp = strtok(params,Index);
if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /unban [name]");
new adminname[MAX_PLAYER_NAME], string[128], unbanname[256];
unbanname = tmp;
if(udb_Exists(unbanname))
	{
		dUserSetINT(unbanname).("Banned", 0);
		GetPlayerName(playerid, adminname, sizeof(adminname));
		CMDMessageToAdmins(playerid,"UNBAN");
		SaveToFile("UnBanNameLog",string);
        SendRconCommand("reloadbans");
		print(string);
		return 1;
   	}
    else return SendClientMessage(playerid, red, "ERROR: No player with this name.");
}
it done,i did it,thanks tu Turbo

can anyone help me for this

i did /nameunban and /offline ban

now,i need this

Код:
CMD:unbanip(playerid, params[])
{
if(PlayerInfo[playerid][Level] < 5) return SendClientMessage(playerid,red, "You Cant Use This Command !!!");
if(IsPlayerAdmin(playerid))
{
    new integ;if(sscanf(params,"u", integ)) return SendClientMessage(playerid, red, "Usage: /unban [IP: ADDRESS]");
    if(integ >=32) return SendClientMessage(playerid, red, "IP ADDRESS IS TOO LONG");
	new UnBanIp[80],IpAdd[128];format(UnBanIp,sizeof(UnBanIp),"unbanip %s",integ);
	SendRconCommand(UnBanIp);
	format(IpAdd,sizeof(IpAdd),"You Have Unbanned IP: %d",integ);
	SendClientMessage(playerid,red,IpAdd);
}
return 1;
}
how to remove Rcon ,i dont want /rcon login password,i just wanna make lvl 2 + can ban player


Re: Name Unban Scripting help - ShadowMortar - 30.11.2017

Код:
CMD:unbanip(playerid, params[])
{
if(PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid,red, "You Cant Use This Command !!!");
{
    new integ;if(sscanf(params,"u", integ)) return SendClientMessage(playerid, red, "Usage: /unban [IP: ADDRESS]");
    if(integ >=32) return SendClientMessage(playerid, red, "IP ADDRESS IS TOO LONG");
	new UnBanIp[80],IpAdd[128];format(UnBanIp,sizeof(UnBanIp),"unbanip %s",integ);
	SendRconCommand(UnBanIp);
	format(IpAdd,sizeof(IpAdd),"You Have Unbanned IP: %d",integ);
	SendClientMessage(playerid,red,IpAdd);
}
return 1;
}