- 27
- 2
- Версия SA-MP
-
- Любая
or) aim.lua: ...esktop\Rage+++ Kaneki mod 1000-7 1337\moonloader\aim.lua:32: 'then' expected near 'System'
[ML] (error) aim.lua: Script died due to an error. (01C9E22C)
Ошибка делал скрипт на Open AI , кто нибудь может помочь снизу скрипт
require "lib.sampfuncs"
function main()
if not isSampfuncsLoaded() then
print("Error: SAMPFUNCS not loaded!")
return
end
sampRegisterChatCommand("aim", toggle_aim)
aim_enabled = false
while true do
wait(0)
if aim_enabled then
local closest_player = -1
local min_distance = 9999.0
for id = 0, 1000 do
if sampIsPlayerConnected(id) then
local res, x, y, z = sampGetPlayerPos(id)
if res then
local px, py, pz = getCharCoordinates(PLAYER_PED)
local dist = getDistanceBetweenCoords3d(x, y, z, px, py, pz)
if dist < min_distance then
min_distance = dist
closest_player = id
end
end
end
end
if closest_player ~= -1 then
local res, x, y, z = sampGetPlayerPos(closest_player)
if res --
System: then
setCameraLookAt(x, y, z)
sampAddChatMessage("Aiming at player " .. closest_player, 0xFFFF00)
end
end
end
end
end
function toggle_aim()
aim_enabled = not aim_enabled
sampAddChatMessage(aim_enabled and "Aim activated!" or "Aim deactivated!", 0xFFFF00)
end
[ML] (error) aim.lua: Script died due to an error. (01C9E22C)
Ошибка делал скрипт на Open AI , кто нибудь может помочь снизу скрипт
require "lib.sampfuncs"
function main()
if not isSampfuncsLoaded() then
print("Error: SAMPFUNCS not loaded!")
return
end
sampRegisterChatCommand("aim", toggle_aim)
aim_enabled = false
while true do
wait(0)
if aim_enabled then
local closest_player = -1
local min_distance = 9999.0
for id = 0, 1000 do
if sampIsPlayerConnected(id) then
local res, x, y, z = sampGetPlayerPos(id)
if res then
local px, py, pz = getCharCoordinates(PLAYER_PED)
local dist = getDistanceBetweenCoords3d(x, y, z, px, py, pz)
if dist < min_distance then
min_distance = dist
closest_player = id
end
end
end
end
if closest_player ~= -1 then
local res, x, y, z = sampGetPlayerPos(closest_player)
if res --
System: then
setCameraLookAt(x, y, z)
sampAddChatMessage("Aiming at player " .. closest_player, 0xFFFF00)
end
end
end
end
end
function toggle_aim()
aim_enabled = not aim_enabled
sampAddChatMessage(aim_enabled and "Aim activated!" or "Aim deactivated!", 0xFFFF00)
end