pawn Код:
if(strcmp(x_nr,"hood",true) == 0)
{
new lastcar = P_LastVeh[playerid];
new Float:lcX, Float:lcY, Float:lcZ;
GetVehiclePos(lastcar, lcX, lcY, lcZ);
if(IsPlayerInRangeOfPoint(playerid, 2, lcX, lcY, lcZ))
{
if(GetPVarInt(playerid, "Hood") == 0)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,hood,trunk,objective);
SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,trunk,objective);
SetPVarInt(playerid, "Hood", 1);
}
else if(GetPVarInt(playerid, "Hood") == 1)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,hood,trunk,objective);
SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,trunk,objective);
SetPVarInt(playerid, "Hood", 0);
}
return 1;
}
else {
SendClientMessage(playerid,COLOR_WHITE,"[Vehicle Control] You're not in range of your last vehicle!");
return 1;
}
}
if that dont make any diffrence try printing both positions and see if your just out or there miles out
coz i kinda remember something like when you get a empty vehicles pos it returns the pos where it spawned