Airbreak detection anti-hack - 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: Airbreak detection anti-hack (
/showthread.php?tid=305687)
Airbreak detection anti-hack -
SomebodyAndMe - 23.12.2011
I have the Anti-hack script from PPC_Trucking.
But now, I want, if players aren't in a car, the "auto-report" also shows up if they airbreak.
code now:
pawn Код:
// Detect airbreak hack
if (GetPlayerVehicleSeat(playerid) == 0) // line where the guy is in car
{
// Check if the player is nearly standing still
if (APlayerData[playerid][PlayerSpeed] < 10)
{
// Check if the player switched interior-id's
if (GetPlayerInterior(playerid) != APlayerData[playerid][PreviousInt])
{
// Check if the new interior is the normal world or any mod-shop
switch (GetPlayerInterior(playerid))
{
case 0, 1, 2, 3: // Check interiors 0, 1, 2 and 3 (normal world and all mod-shops)
{
// Store the player's current location and interior-id for the next iteration
GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);
APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);
// Exit the function
return 1;
}
}
}
// Check if the player is still near the same place he was half a second ago
if (IsPlayerInRangeOfPoint(playerid, 20.0, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]))
{
}
else // Send an automated report to the admins so they're informed about it and can take action
SendReportToAdmins(playerid, "Airbreak-hack", true);
}
}
// Store the player's current location and interior-id for the next iteration
GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);
APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);
return 1;
}
Anyone has a idea? On how-to?
Re: Airbreak detection anti-hack -
SomebodyAndMe - 30.12.2011
Late-bump
Re: Airbreak detection anti-hack -
ToPhrESH - 30.12.2011
Maybe use the same thing that you used for detecting vehicle airbreak, except don't use the vehicle lines:
pawn Код:
if (GetPlayerVehicleSeat(playerid) == 0)
And use the rest in:
pawn Код:
public OnPlayerUpdate(playerid)
{
if (APlayerData[playerid][PlayerSpeed] < 10)
{
// Check if the player switched interior-id's
if (GetPlayerInterior(playerid) != APlayerData[playerid][PreviousInt])
{
// Check if the new interior is the normal world or any mod-shop
switch (GetPlayerInterior(playerid))
{
case 0, 1, 2, 3: // Check interiors 0, 1, 2 and 3 (normal world and all mod-shops)
{
// Store the player's current location and interior-id for the next iteration
GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);
APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);
// Exit the function
return 1;
}
}
}
// Check if the player is still near the same place he was half a second ago
if (IsPlayerInRangeOfPoint(playerid, 20.0, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]))
{
}
else // Send an automated report to the admins so they're informed about it and can take action
SendReportToAdmins(playerid, "Airbreak-hack", true);
}
}
// Store the player's current location and interior-id for the next iteration
GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);
APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);
return 1;
}