Call vehicles.
#5

pawn Код:
GetVehiclePos(vehicleid, X, Y, Z);
SetVehiclePos(vehicleid, X, Y, Z);
replace with:

pawn Код:
GetPlayerPos(playerid, X, Y, Z);
new Float:pX, Float:pY;
GetXYInFrontOfPlayer(playerid, pX, pY, 3.0);
SetVehiclePos(/*vehicleid*/, pX, pY, Z); //Vehicle ID being the actual vehicle ID number, not just 'vehicleid'
Place this at the bottom of your script:

pawn Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
GetPlayerFacingAngle(playerid, a);
if (GetPlayerVehicleID(playerid))
{
  GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
Reply


Messages In This Thread
Call vehicles. - by GreenHammy - 30.05.2010, 16:54
Re: Call vehicles. - by Conroy - 30.05.2010, 16:57
Re: Call vehicles. - by GreenHammy - 30.05.2010, 17:00
Re: Call vehicles. - by GreenHammy - 30.05.2010, 17:05
Re: Call vehicles. - by Conroy - 30.05.2010, 17:20
Re: Call vehicles. - by GreenHammy - 30.05.2010, 18:06
Re: Call vehicles. - by Conroy - 30.05.2010, 18:41
Re: Call vehicles. - by DJDhan - 30.05.2010, 18:44
Re: Call vehicles. - by Conroy - 30.05.2010, 18:46
Re: Call vehicles. - by GreenHammy - 30.05.2010, 19:38

Forum Jump:


Users browsing this thread: 3 Guest(s)