07.11.2013, 18:36
I know Pottus, its not like im using junkbuster or anything. But i wanted to see how this worked compared to what i got and help out by testing.
After reading the include, i think the problem is in 'stock AB_Detect(playerid)'.
It checks the players position when player is not in a vehicle, then a player enter a vehicle and drive a bit and exit, then the AB_Detect sees it as airbreak.
After reading the include, i think the problem is in 'stock AB_Detect(playerid)'.
It checks the players position when player is not in a vehicle, then a player enter a vehicle and drive a bit and exit, then the AB_Detect sees it as airbreak.
pawn Код:
if (IsPlayerConnected(playerid) && !IsPlayerInAnyVehicle(playerid) && g_AB_PlayerSpawned[playerid])
{
if ((gettime() - g_AB_LastTick[playerid]) >= 1)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (floatabs(g_AB_LastPosition[playerid][2] - z) < 1.0)
{
new Float:distance = GetPlayerDistanceFromPoint(playerid, g_AB_LastPosition[playerid][0], g_AB_LastPosition[playerid][1], g_AB_LastPosition[playerid][2]);
if (floatabs(distance) >= 65.0 && (floatabs(g_AB_LastPosition[playerid][1] - y) >= 45.0 || floatabs(g_AB_LastPosition[playerid][0] - x) >= 45.0))
{
CallLocalFunction("OnPlayerAirbreak", "d", playerid);
}
}
g_AB_LastTick[playerid] = gettime();
GetPlayerPos(playerid, g_AB_LastPosition[playerid][0], g_AB_LastPosition[playerid][1], g_AB_LastPosition[playerid][2]);
}
