Count cheaters
#1

I'm trying to make count cheaters.

Like:

PHP код:
format(stringsizeof(string), "%s (%d) has been caught by Server Anticheat.",Name[playerid], playerid,);
    
SendClientMessageToAll(COLOR_ADMINstring); 
I am using this ^

PHP код:
format(stringsizeof(string), "%s (%d) has been caught by Server Anticheat. %s Cheaters Caught.",Name[playerid], playerid,);
    
SendClientMessageToAll(COLOR_ADMINstring); 
i want ot make it like this so it count cheaters ^^

Like if a cheaters get banned

PHP код:
format(stringsizeof(string), "%s (%d) has been caught by Server Anticheat. 1 Cheaters Caught.",Name[playerid], playerid,);
    
SendClientMessageToAll(COLOR_ADMINstring); 
if again another cheater gets banned

PHP код:
format(stringsizeof(string), "%s (%d) has been caught by Server Anticheat. 2 Cheaters Caught.",Name[playerid], playerid,);
    
SendClientMessageToAll(COLOR_ADMINstring); 
it goes like this.

hope u understand
Reply
#2

PHP код:
new CountCheaters;
CountCheaters += 1;
format(stringsizeof(string), "%s (%d) has been caught by Server Anticheat. %d Cheater(s) Caught.",Name[playerid], playerid,, CountCheaters); 
SendClientMessageToAll(COLOR_ADMINstring); 
This is something basic, every time someone gets caught, CountCheaters will increase.
Just implement this option in your function, any errors tell me.
Reply
#3

Код:
new CountCheck[MAX_PLAYERS];

//AntiCheat Runing
   
    CountCheck[playerid]++;

    format(string, sizeof(string), "%s (%d) has been caught by Server Anticheat. %d Cheaters Caught.",Name[playerid], playerid, CountCheck[playerid]); 
    SendClientMessageToAll(COLOR_ADMIN, string);
Reply
#4

What if i want to save it. I mean, 50 cheaters caught and then server gets restart so after restart it should say 51 cheaters caught. I don't want it starts from 0-1 again.
Reply
#5

So you need to save it with your save system.
Reply
#6

Ofc then i need it. but i want to know how?
Reply
#7

Make a server variable, add 1 to the value of it every time a cheater is caught, either make a field in SQL if you're using it for your bans that distinguishes cheaters from other bans, OnGameModeInit count the amount of rows that have that field set, set the server variable to that. Either that, or save the variable in the database and load it, but eventually it'd get 'out of sync' if the server crashes, etc.
Reply
#8

Save it in some ini file/database. Make the variable global. load & save.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)