- 30
- 0
- Версия MoonLoader
- .027.0-preview
Скрипт:
sampAddChatMessage("{FF4500}[CarSearch]{FFFF00} use /cfind [id], Author: CeSum!")
local vkeys = require "vkeys"
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand("cfind",function(arg)
if tonumber(arg) then
local id = tonumber(arg)
local result, handle = sampGetCarHandleBySampVehicleId(id)
if result then
placeWaypoint(x,y,z)
sampAddChatMessage("{FF4500}[CarSearch] {FFF101}Car is found! Waypoint is placed in coords - "..x.. ", "..y.. ", "..z)
sampAddChatMessage("{FFF4500}[CarSearch] {FFF101}Press Z to update waypoint")
while true do
wait(0)
if isKeyJustPressed(vkeys.VK_Z)then do
local result, handle = sampGetCarHandleBySampVehicleId(id)
if result then
placeWaypoint(x,y,z)
else
sampAddChatMessage("{FF4500}[CarSearch] {FFF101} Car is not in stream zone!")
end
end
end
end
sampAddChatMessage("Type id")
end
wait(-1)
end
end
)
end
В логах нету ошибки, но почему-то на сервере пишет что команда не найдена
sampAddChatMessage("{FF4500}[CarSearch]{FFFF00} use /cfind [id], Author: CeSum!")
local vkeys = require "vkeys"
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand("cfind",function(arg)
if tonumber(arg) then
local id = tonumber(arg)
local result, handle = sampGetCarHandleBySampVehicleId(id)
if result then
placeWaypoint(x,y,z)
sampAddChatMessage("{FF4500}[CarSearch] {FFF101}Car is found! Waypoint is placed in coords - "..x.. ", "..y.. ", "..z)
sampAddChatMessage("{FFF4500}[CarSearch] {FFF101}Press Z to update waypoint")
while true do
wait(0)
if isKeyJustPressed(vkeys.VK_Z)then do
local result, handle = sampGetCarHandleBySampVehicleId(id)
if result then
placeWaypoint(x,y,z)
else
sampAddChatMessage("{FF4500}[CarSearch] {FFF101} Car is not in stream zone!")
end
end
end
end
sampAddChatMessage("Type id")
end
wait(-1)
end
end
)
end
В логах нету ошибки, но почему-то на сервере пишет что команда не найдена