26.08.2010, 17:30
I got this function from a guy on the sa-mp forums and now I'm experiencing problems with it.nmAllright so when I changed to sa-mp 0.3b R2 This function didn't work anymore. It previously worked but now it doesn't. Does anyone have any solution to this?
pawn Код:
public GetClosestVehicle(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;
}