sampRegisterChatCommand('findcar',function(arg) -- id model
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 x, y, z = getCarCoordinates(car)
sampAddChatMessage(string.format('X:%d Y:%d Z:%d model:%s[%d]',x, y, z,carname,arg),-1)
end
end
end
end
else
sampAddChatMessage('от 400 до 611', -1)
end
end
end)