SA-MP Forums Archive
Ban CMD - 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: Ban CMD (/showthread.php?tid=608633)



Ban CMD - Loinal - 03.06.2016

hey guys iam using jamin3 and when i found a hacker and banned he can join with onther name and play why

Codesss:

PHP код:
CMD:ban(playeridparams[])
{
    
LoginCheck(playerid);
    
LevelCheck(playerid3);
    new
        
string[128],
        
id,
        
reason[128],
        
when[128],
        
ban_hrban_minban_secban_monthban_daysban_years
    
;
    
gettime(ban_hrban_minban_sec);
    
getdate(ban_yearsban_monthban_days);
    if(
sscanf(params"uS(No Reason)[128]"idreason)) return SendClientMessage(playeridCOLOR_RED"<!> Syntax Error: /ban [playerid] [reason(Default: No Reason)]");
    if(
id == INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_RED"Syntax Error: Player not connected.");
    if(
id == playerid) return SendClientMessage(playeridCOLOR_RED"Syntax Error: You cannot use this command to yourself.");
    if(
User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playeridCOLOR_RED"Syntax Error: You cannot use this command on higher admin.");
    
format(when128"%02d/%02d/%d %02d:%02d:%02d"ban_monthban_daysban_yearsban_hrban_minban_sec);
    
format(stringsizeof(string), "** %s(ID:%d) has been banned by Administrator %s(%d) (Reason: %s)"pName(id), idpName(playerid), playeridreason);
    
SendClientMessageToAll(COLOR_GREYstring);
    
printf(string);
    
#if LOG == true
        
SaveLog("banlog.txt"string);
    
#endif
    
format(stringsizeof(string), "You have banned %s(%d) for %s."pName(id), idreason);
    
SendClientMessage(playeridCOLOR_YELLOWstring);
    
format(stringsizeof(string), "You have been banned by Administrator %s(%d) (Reason: %s)"pName(playerid), playeridreason);
    
SendClientMessage(idCOLOR_YELLOWstring);
    
BanAccount(idpName(playerid), reason);
    
ShowBan(idpName(playerid), reasonwhen);
    
KickDelay(id);
    return 
1;




Re: Ban CMD - ColdGamePlay - 03.06.2016

if he changed his ip, he is able to connect again


Re: Ban CMD - Loinal - 03.06.2016

in the game if he dont chage his ip and change name he can join


Re: Ban CMD - ColdGamePlay - 03.06.2016

Add this to your ban CMD

new string [128], ip[128];
GetPlayerIp(pName,ip,sizeof(ip));
format(string, sizeof(string),"banip %s", ip);
SendRconCommand(string);
SendRconCommand("reloadbans");


Re: Ban CMD - Darrenr - 03.06.2016

Hackers can change their IP address and connect as much a they want.

for a final solution:

Download or script an Anti-Hack system. the server will ban hackers when the script detects certain things. Like hackers spawning guns, spawning money, teleporting across the map, health hacks etc...

Also build a strong admin team across the different timezones!