04.02.2012, 14:47
First off all i thnik you gotta set the velocity like this: SetPlayerVeloCity(playerid, 0.2, 0.2, 0.2);
Second I have a script wich checks the speed of player infront of him when i got the thing out how i did it i will tell you
Edit:
This is to get vehicleid but since i see your post count i guess you know how to change it for anything
Second I have a script wich checks the speed of player infront of him when i got the thing out how i did it i will tell you
Edit:
This is to get vehicleid but since i see your post count i guess you know how to change it for anything
pawn Код:
GetVehicleInfrontID (vehid)
{
new Float: temp = 7.0;
new j = 0;
for (new i = 1; i <= MAX_VEHICLES; i++)
{
new Float: a, Float: x1, Float: y1, Float: z1, Float: x2, Float: y2, Float: z2;
GetVehiclePos (vehid, x1, y1, z1);
GetVehicleZAngle (vehid, a);
if (i != vehid)
{
if (GetVehiclePos (i, x2, y2, z2))
{
new Float: distance = floatsqroot (floatpower ((x1 - x2), 2) + floatpower ((y1 - y2), 2) + floatpower ((z1 - z2), 2));
GetVehicleZAngle (vehid, a);
if (distance < 300.0)
{
x1 = x1 + (distance * floatsin(-a, degrees));
y1 = y1 + (distance * floatcos(-a, degrees));
distance = floatsqroot ((floatpower ((x1 - x2), 2)) + (floatpower ((y1 - y2), 2)));
if (temp > distance)
{
temp = distance;
j = i;
}
}
}
}
}
if (temp < 7.0) return j;
return -1;
}