29.06.2014, 05:08
I have this code to detect and send an Airbreak-Hack report to admins. Its working fine but i got small issue. Whenever a player enters an Andromada or AT-400, it sends a fake Airbreak-Hack report to admins. Its pretty annoying since i have AT-400 and Andromada for pilot class and my admins need to /spec them every time. Anyone can help me how to fix it? Or if there are some good Anti-Airbreak, it would be nice cause this one is not really as good as other servers have.
I have this code under my GlobalCheck function which has 1000 milliseconds timer running.
PS: I want to ask something, is it a good idea to create a stock for getting a name of the player? I mean something like
Then use GetName(target), GetName(playerid) to those scripts which takes the player names, cmds and other scripts? I saw some of the gamemode is using it, i just want to know if its better than creating a separate name variable and using GetPlayerName function every time you create a command.
pawn Код:
if (GetPlayerVehicleSeat(playerid) == 0)
{
if (pInfo[playerid][PlayerSpeed] < 10)
{
if (GetPlayerInterior(playerid) != pInfo[playerid][PreviousInt])
{
switch (GetPlayerInterior(playerid))
{
case 0, 1, 2, 3:
{
GetPlayerPos(playerid, pInfo[playerid][PreviousX], pInfo[playerid][PreviousY], pInfo[playerid][PreviousZ]);
pInfo[playerid][PreviousInt] = GetPlayerInterior(playerid);
return 1;
}
}
}
if (IsPlayerInRangeOfPoint(playerid, 7.5, pInfo[playerid][PreviousX], pInfo[playerid][PreviousY], pInfo[playerid][PreviousZ]))
{
}
else
SendReportToAdmins(-1, playerid, "Airbreak-hack");
}
}
GetPlayerPos(playerid, pInfo[playerid][PreviousX], pInfo[playerid][PreviousY], pInfo[playerid][PreviousZ]);
pInfo[playerid][PreviousInt] = GetPlayerInterior(playerid);
PS: I want to ask something, is it a good idea to create a stock for getting a name of the player? I mean something like
pawn Код:
stock GetName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}