09.11.2012, 10:00
a friend made me a ban permanent thingy please help!the cmd doesent work!
PHP код:
dcmd_testban(playerid, params[]) // BAN
{
if(PlayerInfo[playerid][pAdmin] >= 1339)
{
new Target;
new 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];
GetPlayerName(Target,tname,sizeof(tname));
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
new MyString[256];
new TargetString[256];
new rbandate[3];
getdate(rbandate[0],rbandate[1],rbandate[2]);
format(MyString,sizeof(MyString),"You Have Banned %s(%d)! (Reason %s)",tname, Target,Reason);
ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_MSGBOX,"You Have Been Banned :(",TargetString, "OK", "");
SendClientMessageToAll(-1,MyString);
new AllString[256];
format(AllString,sizeof(AllString),"Admin %s has banned player %s(%d)! Reason(%s)", pname,tname,Target,Reason);
SendClientMessageToAll(-1,AllString);
new ip[50];
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;
}
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;
}