- 30
- 0
- Версия MoonLoader
- .027.0-preview
Lua:
require 'lib.moonloader'
local id = -1
function main()
while not isSampAvailable() do wait(0) end
sampAddChatMessage("{FF4500}[PlayerSearch] {FFF101}Use /pfind [id/off]")
sampRegisterChatCommand('pfind', function(arg)
if arg == "off" then
removeWaypoint()
sampAddChatMessage("{FF4500}[PlayerSearch] {FFF101} Waypoint is removed!")
end
if tonumber(arg) then
id = tonumber(arg)
local result, coords = getPlayerCoords(id)
if result then
placeWaypoint(coords[1], coords[2], coords[3])
sampAddChatMessage("{FF4500}[PlayerSearch] {FFF101} Player is found! Waypoint is placed!")
else
sampAddChatMessage('{FF4500}[PlayerSearch] {FFF101}Error, Player is not in zone stream!', -1)
end
end
end)
while true do
wait(0)
if id ~= -1 then
if wasKeyPressed(VK_Z) and not sampIsCursorActive() then
local result, coords = getPlayerCoords(id)
if result then
placeWaypoint(coords[1], coords[2], coords[3])
sampAddChatMessage("{FF4500}[PlayerSearch] {FFF101} Waypoint is updated!")
else
sampAddChatMessage('{FF4500}[PlayerSearch] {FFF101}Error, Player is not in zone stream!', -1)
end
end
end
end
end
function getPlayerCoords(id)
local coords = {0, 0, 0}
local result, Player = sampGetCharHandleBySampPlayerId(id)
if result then
coords = {getCharCoordinates(Player)}
end
return result, coords
end
Почему-то не может найти даже плеера в зоне стрима, даже на ГГ проверял