GetSpeed on OnPlayerEnterCheckpoint - 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: GetSpeed on OnPlayerEnterCheckpoint (
/showthread.php?tid=399647)
GetSpeed on OnPlayerEnterCheckpoint -
DarkPower - 15.12.2012
pawn Код:
stock GetSpeed(playerid)
{
new
vehicle = GetPlayerVehicleID(playerid),
Float:speed_x,Float:speed_y,Float:speed_z,Float:Brzina;
GetVehicleVelocity(vehicle,speed_x,speed_y,speed_z);
Brzina = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*176.666667;
return floatround(Brzina,floatround_round);
}
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
new brzina = GetSpeed(GetPlayerVehicleID(playerid));
if(CP[playerid] == 1) // PREUZIMANJE
{
if(brzina >= 35) return GameTextForPlayer(playerid, "~r~SLOW DOWN!", 2500, 3);
// rest of code
}
return (true);
}
It dosen't work i enter in CP with 130km/h and i don't get any message
Re : GetSpeed on OnPlayerEnterCheckpoint -
scott1 - 15.12.2012
Quote:
new brzina = GetSpeed(GetPlayerVehicleID(playerid));
|
new brzina = GetSpeed(
playerid);
Max
Re: GetSpeed on OnPlayerEnterCheckpoint -
DarkPower - 15.12.2012
omg i have problem with my eyes, tnx alot...