SA-MP Forums Archive
This code make crashes server - 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: This code make crashes server (/showthread.php?tid=311348)



This code make crashes server - Face9000 - 16.01.2012

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?


Re: This code make crashes server - cessil - 16.01.2012

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.


Re: This code make crashes server - Face9000 - 16.01.2012

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).


Re: This code make crashes server - cessil - 16.01.2012

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


Re: This code make crashes server - Face9000 - 16.01.2012

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..


Re: This code make crashes server - cessil - 16.01.2012

what did it print last?


Re: This code make crashes server - Johndaonee - 16.01.2012

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


Re: This code make crashes server - Face9000 - 16.01.2012

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.


Re: This code make crashes server - cessil - 16.01.2012

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?


Re: This code make crashes server - Face9000 - 16.01.2012

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.