Failed Anti-Cheat. Take a look please! - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Failed Anti-Cheat. Take a look please! (
/showthread.php?tid=269115)
Failed Anti-Cheat. Take a look please! -
cloudysky - 15.07.2011
pawn Код:
public AntiCheat(playerid)
{
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK && PlayerInfo[i][Admin] < 1 )
{
new string [128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "**Auto Ban: %s hacked a Jetpack!**", name);
SendClientMessageToAll(COLOUR_ALERT, string);
PlayerInfo[i][Banned] = 1; //Temp ban so i can test it
SaveUser(i); // Temp
Kick(i); //Temp
}
}
return 1;
}
I tested that by giving a player a Jetpack but it never worked. Anyone see the problem(s)?
EDIT: Also it loops every second if that helps you at all?
Re: Failed Anti-Cheat. Take a look please! - [L3th4l] - 15.07.2011
No need to have the "playerid" param here.
Under OnGameModeInit:
pawn Код:
SetTimer("AntiCheat", 1000, true);
Somewhere below:
pawn Код:
forward AntiCheat();
public AntiCheat()
{
for(new i = 0; i < MAX_PLAYERS; ++i) // I suggest foreach
{
if(IsPlayerConnected(i) && GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK && Playerinfo[i][Admin] < 1)
{
// He was detected
}
}
}
Re: Failed Anti-Cheat. Take a look please! -
cloudysky - 15.07.2011
Thanks, I'll test it now and report back here.
Re: Failed Anti-Cheat. Take a look please! -
cloudysky - 15.07.2011
Hmm it didn't work. I /agiveweapon him a jetpack but nothing happens
Re: Failed Anti-Cheat. Take a look please! -
dr.pepper - 15.07.2011
Quote:
Originally Posted by cloudysky
Hmm it didn't work. I /agiveweapon him a jetpack but nothing happens
|
Did the 'guy' use the jetpack? or did he just stand there as you spawned 'him' the jetpack?
Edit:
Quote:
Originally Posted by [L3th4l]
pawn Код:
forward AntiCheat(); public AntiCheat() { for(new i = 0; i < MAX_PLAYERS; ++i) // I suggest foreach { if(IsPlayerConnected(i) && GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK && Playerinfo[i][Admin] < 1) { // He was detected } } }
|
Also did you add a Kick where Lethal put:
Re: Failed Anti-Cheat. Take a look please! -
cloudysky - 15.07.2011
He used it and yes i put kick there
Respuesta: Failed Anti-Cheat. Take a look please! -
El Bardo - 15.07.2011
pawn Код:
forward AntiCheat();
public AntiCheat()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] < 1)
{
new SpecialAction = GetPlayerSpecialAction(i);
if (SpecialAction == SPECIAL_ACTION_USEJETPACK)
{
//Code Here
}
}
}
}
Credits: Luk0r
Re: Failed Anti-Cheat. Take a look please! - [L3th4l] - 15.07.2011
Also, are you sure your admin level is set to 0?
Re: Failed Anti-Cheat. Take a look please! -
cloudysky - 15.07.2011
Yes although just now I found out every time a player logs out they get R5 admin... I'll come back to this later, thanks for the responses
Re: Failed Anti-Cheat. Take a look please! -
cloudysky - 15.07.2011
sftdp,
Just to let you know it's that anti cheat making everyone R5. I really don't get it :L