This code make crashes server
#1

pawn Код:
forward HealthArmourCheat();
public HealthArmourCheat()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        new Float:health,Float:armour;
        GetPlayerHealth(i,health);
        GetPlayerArmour(i,armour);
        if(health == 100.0 || armour == 100.0)
        {
            new string[128],pName[MAX_PLAYER_NAME],reason[32];
            GetPlayerName(i, pName, sizeof(pName));
            if(health == 100.0) { reason = "Health"; }
            else if(armour == 100.0) { reason = "Armour"; }
            format(string,sizeof string,"0,4AC (ID: 505) - %s has been banned for %s hacks. - 100 %s. ",pName,reason,reason);
            IRC_GroupSay(IRC_Group, EchoChan,string);
            Ban(i);
            Blacklist(pName);
            new b[128];
            format(b, sizeof(b), "%s has been banned for %s hacks. - 100 %s.",pName,reason,reason);
            SendClientMessageToAll(0xFF0000FF, b);
            BanLog(b);
            new sss[128];
            format(sss, sizeof(sss), "You have Been Banned by ANTICHEAT. Reason: %s hacks. - 100 %s.", reason,reason);
            SendClientMessage(i,COLOR_LIGHTBLUE, sss);
            SendClientMessage(i,COLOR_RED, "To Get Unbanned Post an Unban Request at Our Forums:");
            SendClientMessage(i,COLOR_LIGHTRED, "Don't Evade, Otherwise you wont get unbanned.");
            TotalACBans++;
        }
    }
    return 1;
}
It doesn't ban,and when he does,the server crashes,that's wrong?
Reply
#2

it's possibly something in Blacklist or BanLog, add prints in parts after the first if statement, after Blacklist, after IRC_GroupSay, after Ban, after BanLog and after TotalACBans and see where the server crashes, alternatively use the crash detector plugin.
Reply
#3

Quote:
Originally Posted by cessil
Посмотреть сообщение
it's possibly something in Blacklist or BanLog, add prints in parts after the first if statement, after Blacklist, after IRC_GroupSay, after Ban, after BanLog and after TotalACBans and see where the server crashes, alternatively use the crash detector plugin.
Well,i adapted this code like the rest of anticheat piece and i don't think the BanLog and Blacklist are the causes of the crashes.BanLog logs the ban in a file (and i've that file),Blacklist is a sort of antievade and logs all (i've that log file too).
Reply
#4

did you at least try using the prints or using the crash detect plugin
Reply
#5

Quote:
Originally Posted by cessil
Посмотреть сообщение
did you at least try using the prints or using the crash detect plugin
Yes,already tried 2 times and it prints what it does,no signal of crash or something..
Reply
#6

what did it print last?
Reply
#7

You ban him before he gets the message, try and ban him after your actions or else its useless you have those messages just a tip
Reply
#8

Quote:
Originally Posted by cessil
Посмотреть сообщение
what did it print last?
%s added to blacklist log.
%s banned.
Updated TotalACBans.
Sent msg to IRC_GroupSay at #IRC_CHANNEL.
Reply
#9

he should actually run a timer to kick the player, 2 seconds should do it.

so if it prints everything, how do you know its that script that's crashing them?
Reply
#10

Quote:
Originally Posted by cessil
Посмотреть сообщение
he should actually run a timer to kick the player, 2 seconds should do it.
Ye,forgot to paste it.

Btw i fixed that,i just need to store the "pName" value in the blacklist file,thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)