Ban - Dont Work!
#2

PHP код:
dcmd_testban(playeridparams[]) // BAN
{
  new 
Target;
  new 
Reason[100];
  if(
PlayerInfo[playerid][pAdmin] >= 1339)
  {
    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)",tnameTarget,Reason);
        
ShowPlayerDialog(playerid1000DIALOG_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(playeridparams[]) // UNBAN
{
  if(
PlayerInfo[playerid][pAdmin] >= 1339)
  {
     new 
ip[32], dformat[64];
     if(
sscanf(params,"s[32]",ip)) return SendClientMessage(playerid,-1,"/test [ip]");
     
format(dformatsizeof(dformat),"unban %s",ip);
     
SendRconCommand(dformat);
  }
  return 
1;

Reply


Messages In This Thread
Ban - Dont Work! - by Akcent_Voltaj - 09.11.2012, 10:00
Re : Ban - Dont Work! - by yusei - 09.11.2012, 10:10
Re: Ban - Dont Work! - by Konstantinos - 09.11.2012, 10:23

Forum Jump:


Users browsing this thread: 1 Guest(s)