09.11.2011, 21:25
When I am inside the vehicle, how can I make it so when I am not in a vehicle it'll still lock.
Sorry I cannot give a code because I am on my phone.
Sorry I cannot give a code because I am on my phone.
stockGetNearestCar(playerid, Float:radius)
{
new Float:SpielerX, Float:SpielerY, Float:SpielerZ, Float:CarX, Float:CarZ, Float:CarY;
GetPlayerPos(playerid, SpielerX, SpielerY, SpielerZ);
for(new i = 1; i < MAX_VEHICLES; i++)
{
GetVehiclePos(i, CarX, CarY, CarZ);
if((floatabs(SpielerX-CarX)<radius)&&(floatabs(SpielerY-CarY)<radius)&&(floatabs(SpielerZ-CarZ)<radius))
{
return i;
}
}
return false;
}