This script will not be executed when you are jump out of vehicle or falling down.
I have tested GetPlayerSpeed in different situations and there is never value higher for 350 for speed.
I have tested GetPlayerSpeed in different situations and there is never value higher for 350 for speed.
Code:
#include <a_samp>
stock GetPlayerSpeed(playerid)
{
if(playerid != INVALID_PLAYER_ID)
{
new Float:Pos[3],Float:PS;
GetPlayerVelocity(playerid, Pos[0], Pos[1], Pos[2]);
PS = floatsqroot(Pos[0]*Pos[0] + Pos[1]*Pos[1] + Pos[2]*Pos[2])*200;
return floatround(PS,floatround_round);
}
return INVALID_PLAYER_ID;
}
public OnPlayerUpdate(playerid)
{
if(GetPlayerSpeed(playerid) > 350)
{
//reakcja na cheata
}
return 1;
}