/unban
#1

guys, who can make a /unban command for me?
thank you.
Reply
#2

When you post topics like this atleast tell us GM info so we can know is it zcmd,strpccmd..etc
So you get the right code not the un-compatible code
Reply
#3

If you would like someone to create a command for you please post it in the correct place.

Edit: Never mind you might want to start up a new request thread as #7
Reply
#4

Rp Gm
Reply
#5

Well, each gamemode has its scripting standarts..you need to be specific with the GM. (ex. zgaming, ng, ugrp, etc.)
Reply
#6

Here you go;


CMD:ban(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 2)
{
if(PlayerInfo[playerid][pAdminDuty] != 1) return SendClientMessageEx(playerid, COLOR_GREY, "You can't attempt this action while you're off your duty");
new string[128], giveplayerid, reason[64];
if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /ban [playerid] [reason]");

if(IsPlayerConnected(giveplayerid))
{
if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin])
{
format(string, sizeof(string), "AdmCmd: %s has been auto-banned, reason: Trying to /ban a higher admin.", GetPlayerNameEx(playerid));
ABroadCast(COLOR_YELLOW,string,2);
PlayerInfo[playerid][pBanned] = 1;
new ip[32];
GetPlayerIp(playerid,ip,sizeof(ip));
AddBan(ip);
Kick(playerid);
return 1;
}
else
{
new year, month,day;
getdate(year, month, day);
new playerip[32];
GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
format(string, sizeof(string), "AdmCmd: %s(IP:%s) has been banned by %s, reason: %s (%d-%d-%d)", GetPlayerNameEx(giveplayerid), playerip, GetPlayerNameEx(playerid), reason,month,day,year);
Log("logs/ban.log", string);
format(string, sizeof(string), "AdmCmd: %s has been banned from the community by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
SendClientMessageToAllEx(COLOR_LIGHTRED, string);
PlayerInfo[giveplayerid][pBanned] = 1;
format(PlayerInfo[giveplayerid][pFlag], 128, "");
new ip[32];
GetPlayerIp(giveplayerid,ip,sizeof(ip));
AddBan(ip);
Kick(giveplayerid);
return 1;
}

}
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
return 1;
}
Reply
#7

You got now Zcmd by Surgeon.
Coz you are newbie and i guess you don't know what is wich language i will give you old dcmd.

Код:
dcmd_unban(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 4)
	    return SendClientMessage(playerid, COLOR_GREY, "You are not autorized to use this command!");

	new rcmsg[80], acct[24], file[64],name[24],string[128],otherfile[64];
	GetPlayerName(playerid, name, sizeof(name));

	if(sscanf(params, "s", acct))
		return SendClientMessage(playerid, COLOR_GREY, "Usage: /unban [account name]");

	format(file, sizeof(file),"Location of your accounts/%s.ini", acct);

	if(!dini_Exists(file))
	    return SendClientMessage(playerid, COLOR_LIGHTRED,"Error: account doesn't exists!");

	dini_IntSet(file, "Banned", 0);

	format(ipFILE, 128, "Location of your accounts Aliases/%s.txt", acct);

	format(rcmsg, sizeof(rcmsg), "unbanip %s", dini_Get(ipFILE,"NameIp"));
	SendRconCommand(rcmsg);
	SendRconCommand("reloadbans");

	format(otherfile,sizeof(otherfile),"BAN FOLDER/%s.ban",dini_Get(ipFILE,"NameIp"));
	fremove(otherfile);

	format(string, sizeof(string), "[ADMIN]: %s has unbanned The account of %s.", name,acct);
	ABroadCast(COLOR_LIGHTRED,string, 5);
	format(string, sizeof(string), "[ADMIN]: IP %s has been removed by the ban list by %s.", dini_Get(ipFILE,"NameIp"), name);
	ABroadCast(COLOR_WHITE,string, 5);
	format(string, sizeof(string), "* Administrator %s Has Unbanned the account of %s", name,acct);
	SendClientMessageToAll(COLOR_NICERED,string);
	format(string, sizeof(string), "* Successfuly Unbanned %s's account & removed %s from the ban list", name,dini_Get(ipFILE,"NameIp"));
	SendClientMessage(playerid,TEAM_GROVE_COLOR,string);

	new y, m, d;
	new h,mi,s;
	getdate(y,m,d);
	gettime(h,mi,s);
	format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Unbanned the Account of %s (%s)",d,m,y,h,mi,s,name,acct,dini_Get(ipFILE,"NameIp"));
	LoginLog(string);
	return 1;
}
I guess you will need to set up your enums if you use this kind of cmd.
You need to see how are your cmd's in wich language.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)