- 380
- 173
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
- Версия MoonLoader
- .026-beta
как сделать чтобы вывело одну самую близкую к педу машину? даже если их стоит несколько
Lua:function main() while not isSampAvailable() do wait(0) end sampRegisterChatCommand('findcar',function(arg) lua_thread.create(function() if #arg == 0 then return sampAddChatMessage('/findcar [idmodel]') elseif string.match(arg,'%d+') then arg = tonumber(arg) if arg >= 400 and arg <= 611 then local carname = getNameOfVehicleModel(arg) if carname ~= nil then for i = 0, 2000 do local res, car = sampGetCarHandleBySampVehicleId(i) if res then local modelId = getCarModel(car) if carname == getNameOfVehicleModel(modelId) then local px, py, pz = getCharCoordinates(playerPed) local x, y, z = getCarCoordinates(car) local dist = getDistanceBetweenCoords3d(px, py, pz, x, y, z) if dist < 50 then sampGetVehicleIdByCarHandle(i) sampAddChatMessage(i, -1) sampAddChatMessage(string.format('X:%d Y:%d Z:%d model:%s[%d]',x, y, z,carname,arg),-1) sampProcessChatInput("/setmarker "..x.. ", " ..y.. ", "..z) sampProcessChatInput("/rtpc") wait(3000) sampSendEnterVehicle(i, 0) wait(1000) warpCharIntoCar(PLAYER_PED, car) end end end end end else sampAddChatMessage('от 400 до 611', -1) end end end) end) end