SA-MP Forums Archive
Count cheaters - 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: Count cheaters (/showthread.php?tid=580758)



Count cheaters - ALoX12 - 08.07.2015

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


Re: Count cheaters - youssefehab500 - 08.07.2015

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.


Re: Count cheaters - bigtigerbeee - 08.07.2015

Код:
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);



Re: Count cheaters - ALoX12 - 08.07.2015

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.


Re: Count cheaters - DarkLouis - 08.07.2015

So you need to save it with your save system.


Re: Count cheaters - ALoX12 - 08.07.2015

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


Re: Count cheaters - rymax99 - 08.07.2015

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.


Re: Count cheaters - Stanford - 08.07.2015

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