06.10.2013, 17:24
How to create a script that I will do, that will be released in speed, eg 100 KM / H and when you exceed the speed limit will be fined or wanted by the police
public OnPlayerUpdate( playerid )
{
if(GetPlayerSpeed(playerid) > 100)
{
SendClientMessage(playerid,-1,"your speed is over 100!");
}
return 1;
}
stock GetPlayerSpeed( playerid )
{
new Float:ST[4];
GetVehicleVelocity(GetPlayerVehicleID( playerid ),ST[ 0 ],ST[ 1 ],ST[ 2 ] );
ST[3] = floatsqroot(floatpower(floatabs(ST [ 0 ] ), 2.0 ) + floatpower(floatabs( ST[ 1 ] ), 2.0) + floatpower(floatabs(ST[2 ]), 2.0)) * 179.28625;
return floatround(ST[3]);
}