Velocity
#1

how would i check in what direction the vehicle is moving ?

pawn Код:
new SaveVelTimer[MAX_PLAYERS];
new Float:VelS[3];

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
SaveVelTimer[playerid] = SetTimerEx("SaveVelocity",500, true, "i", playerid);
return 1;
}

forward SpeedUpdate();
public SpeedUpdate()
{
new Float:Velocity[3];
GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0], Velocity[1], Velocity[2]);
if(Velocity[0] >= VelS[0] && Velocity[1] >= VelS[1])
{
//Moving Forward ?
}else if(Velocity[0] <= VelS[0]&& Velocity[1] <= VelS[1])
{
//Moving Backwords ?
}else if(Velocity[0] == VelS[0]&& Velocity[1] == VelS[1])
{
//Same Pos ?
}
return 1;
}

forward SaveVelocity(playerid);
public SaveVelocity(playerid)
{
GetVehicleVelocity(GetPlayerVehicleID(playerid), VelS[0], VelS[1], VelS[2]);
return 1;
}
would this work ?
if not please show me a method
Reply


Messages In This Thread
Velocity - by park4bmx - 19.11.2011, 13:49
Re: Velocity - by Gamer_Z - 19.11.2011, 13:53
Re: Velocity - by park4bmx - 19.11.2011, 13:58

Forum Jump:


Users browsing this thread: 1 Guest(s)