11.11.2010, 14:32
could this be helpful?
http://www.xfire.com/video/38ed30/
http://www.xfire.com/video/38ed30/
Код:
CMD:test(playerid,params[]){ new TimerOld=GetTickCount(); new VehID; new Dist,DistLower=8500,DistLowerSA; new Float:X,Float:Y,Float:Z; new Float:pX,Float:pY,Float:pZ; new XX,YY,ZZ; new sXX,sYY,sZZ; GetPlayerPos(playerid,pX,pY,pZ); for(new v=0;v<MAX_VEHICLES;v++) { if(IsPlayerInVehicle(playerid,v)==1) continue; GetVehiclePos(v,X,Y,Z); if(IsPlayerInRangeOfPoint(playerid,DistLower,X,Y,Z)) { XX=floatround(X-pX,floatround_floor); YY=floatround(Y-pY,floatround_floor); ZZ=floatround(Z-pZ,floatround_floor); sXX=XX*XX; sYY=YY*YY; sZZ=ZZ*ZZ; DistLowerSA=sXX+sYY+sZZ; DistLower=floatround(floatsqroot(DistLowerSA),floatround_floor); VehID=v; } } new TimerNew=GetTickCount(); new string[48]; format(string,sizeof(string),"Closest Veh:%d Dist:%d ms:%d",VehID,DistLower,TimerNew-TimerOld); SendClientMessage(playerid,0x33cc33ff,string); return VehID; }