- 52
- 5
Нарушение правил раздела
- Версия MoonLoader
- .026-beta
function heal()
sampSendChat(ini.Binder.HealStroka1)
sampSendChat('/heal'..closestId..'')
end
function getClosestPlayerId()
local minDist = 9999
local closestId = -1
local x, y, z = getCharCoordinates(PLAYER_PED)
for i = 0, 999 do
local streamed, pedID = sampGetCharHandleBySampPlayerId(i)
if streamed then
local xi, yi, zi = getCharCoordinates(pedID)
local dist = math.sqrt( (xi - x) ^ 2 + (yi - y) ^ 2 + (zi - z) ^ 2 )
if dist < minDist then
minDist = dist
closestId = i
end
end
end
return closestId
end
хочу сделать так чтобы по команде хилился ближайший игрок
в мунлоадере такая ошибка
[ML] (error) LeaderAndZamHelper.lua: ... ïàïêà (2)\bin\arizona\moonloader\LeaderAndZamHelper.lua:147: attempt to concatenate global 'closestId' (a nil value)
stack traceback:
... ïàïêà (2)\bin\arizona\moonloader\LeaderAndZamHelper.lua:147: in function <... ïàïêà (2)\bin\arizona\moonloader\LeaderAndZamHelper.lua:145>
[ML] (error) LeaderAndZamHelper.lua: Script died due to an error. (1F67B284)
sampSendChat(ini.Binder.HealStroka1)
sampSendChat('/heal'..closestId..'')
end
function getClosestPlayerId()
local minDist = 9999
local closestId = -1
local x, y, z = getCharCoordinates(PLAYER_PED)
for i = 0, 999 do
local streamed, pedID = sampGetCharHandleBySampPlayerId(i)
if streamed then
local xi, yi, zi = getCharCoordinates(pedID)
local dist = math.sqrt( (xi - x) ^ 2 + (yi - y) ^ 2 + (zi - z) ^ 2 )
if dist < minDist then
minDist = dist
closestId = i
end
end
end
return closestId
end
хочу сделать так чтобы по команде хилился ближайший игрок
в мунлоадере такая ошибка
[ML] (error) LeaderAndZamHelper.lua: ... ïàïêà (2)\bin\arizona\moonloader\LeaderAndZamHelper.lua:147: attempt to concatenate global 'closestId' (a nil value)
stack traceback:
... ïàïêà (2)\bin\arizona\moonloader\LeaderAndZamHelper.lua:147: in function <... ïàïêà (2)\bin\arizona\moonloader\LeaderAndZamHelper.lua:145>
[ML] (error) LeaderAndZamHelper.lua: Script died due to an error. (1F67B284)