09.11.2012, 10:23
(
Последний раз редактировалось Konstantinos; 10.11.2012 в 10:32.
Причина: I had [code] tag, lol
)
pawn Код:
dcmd_testban(playerid, params[]) // BAN
{
if(PlayerInfo[playerid][pAdmin] >= 1339)
{
new
Target,
Reason[100]
;
if(!sscanf(params, "us[100]", Target, Reason))
{
if(Target == playerid) return SendClientMessage(playerid, -1, "lol want to ban your self?");
new
tname[MAX_PLAYER_NAME],
pname[MAX_PLAYER_NAME],
MyString[128],
rbandate[3],
ip[50]
;
GetPlayerName(Target, tname, sizeof(tname));
GetPlayerName(playerid, pname, sizeof(pname));
getdate(rbandate[0], rbandate[1], rbandate[2]);
format(MyString, sizeof(MyString), "You Have Banned %s(%d)! (Reason %s)", tname, Target, Reason);
SendClientMessage(playerid, -1, MyString);
format(MyString, sizeof(MyString), "You Have Been Banned from Admin %s! (Reason %s)", pname, Reason);
ShowPlayerDialog(Target, 1000, DIALOG_STYLE_MSGBOX, "You Have Been Banned :(", MyString, "OK", "");
format(MyString, sizeof(MyString), "Admin %s has banned player %s(%d)! Reason(%s)", pname, tname, Target, Reason);
SendClientMessageToAll(-1, MyString);
GetPlayerIp(Target, ip, sizeof(ip));
strdel(ip, strlen(ip)-4, strlen(ip));
format(ip, sizeof(ip), "%s**.**", ip);
format(ip, sizeof(ip), "banip %s", ip);
SendRconCommand(ip);
Ban(Target);
return 1;
}
else return SendClientMessage(playerid, -1, "Syntax: /ban [ID/Part Of Name] [Reason]");
}
return 1;
}
dcmd_test(playerid, params[]) // UNBAN
{
if(PlayerInfo[playerid][pAdmin] >= 1339)
{
new
ip[32],
dformat[64]
;
if(sscanf(params, "s[32]", ip)) return SendClientMessage(playerid, -1, "/test [ip]");
format(dformat, sizeof(dformat),"unban %s",ip);
SendRconCommand(dformat);
}
return 1;
}