How can I prevent detection spamming [REP+]
#1

Hello again,

I have a callback that it is called when a cheat is detected but for example if I am alerting an admin on this callback the chat is getting spammed with the same message, ex. if a player is airbraking it will say

Код:
SecretBoss(0) suspected using Airbrake hacks
SecretBoss(0) suspected using Airbrake hacks
SecretBoss(0) suspected using Airbrake hacks
SecretBoss(0) suspected using Airbrake hacks
SecretBoss(0) suspected using Airbrake hacks
SecretBoss(0) suspected using Airbrake hacks
SecretBoss(0) suspected using Airbrake hacks
many times.

Is there any way to make the message to be sent just one time? Thanks for reading, and help will be appreciated and SecretBoss(0) suspected using Airbrake hacks
Reply
#2

Make a variable and set it to true when a player is suspected of cheating. While it's set to true, don't alert the admins.
Reply
#3

Quote:
Originally Posted by TommyB
Посмотреть сообщение
Make a variable and set it to true when a player is suspected of cheating. While it's set to true, don't alert the admins.
And if the player will hack another time?
Reply
#4

Set a timer to set it to false again.
EDIt: The solution posted down is better.
Reply
#5

It can be done with GetTickCount, And variable.
Heres an example
PHP код:
new TickCount[MAX_PLAYERS];
//OnPlayerConnect :-
TickCount[playerid] = 0;
//OnPlayerSuspectedForAirbreak or w/e the callback is :D
if(TickCount[playerid] < GetTickCount())
{
 
TickCount[playerid] = GetTickCount() + 120000// Some time
 //Warn Here.
 
return 1;
}
else if(
TickCount[playerid] > GetTickCount()) return 1//no warnings. 
Its will warn every few mins if player still airbreaking, it wont spam the chat
P.S.:I didn't test it so, you can test me and tell me if theres something wrong.
Reply
#6

Quote:
Originally Posted by karemmahmed22
Посмотреть сообщение
It can be done with GetTickCount, And variable.
Heres an example
PHP код:
new TickCount[MAX_PLAYERS];
//OnPlayerConnect :-
TickCount[playerid] = 0;
//OnPlayerSuspectedForAirbreak or w/e the callback is :D
if(TickCount[playerid] < GetTickCount();)
{
 
TickCount[playerid] = GetTickCount() + 120000// Some time
 //Warn Here.
 
return 1;
}
else if(
TickCount[playerid] > GetTickCount()) return 1//no warnings. 
Its will warn every few mins if player still airbreaking, it wont spam the chat
P.S.:I didn't test it so, you can test me and tell me if theres something wrong.
Thanks for info, I repped you all for helping me but I have some errors, the problem is that it can't get tickcount I think have a look here

Код:
.pwn(707) : error 001: expected token: ")", but found ";"
.pwn(707) : error 036: empty statement
.pwn(707) : error 029: invalid expression, assumed zero
.pwn(707) : fatal error 107: too many error messages on one line
Error line is

Код:
if(TickCount[playerid] < GetTickCount();)
- EDIT -

Код:
if(TickCount[playerid] < GetTickCount())
You putted a ; that is was not needed, its working thanks for all guys
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)