"0B2B' call caused an unhandled exception stack traceback:

armandl

Новичок
Автор темы
3
0
Версия SA-MP
  1. 0.3.7 (R1)
А чо не так-то?
opcode '0B2B' call caused an unhandled exception
stack traceback:
[C]: in function 'sampGetPlayerIdByCharHandle'
D:\gta\moonloader\Moon.lua:17: in main chunk
[ML] (error) Script died due to an error. (0AF919B4)

Код:
function ch()
    local peds = getAllChars()
    for _, v in pairs(peds) do
        local result, myid = sampGetPlayerIdByCharHandle(playerPed)
        local mx, my, mz = getCharCoordinates(playerPed)
        local x, y, z = getCharCoordinates(v)
        local distance = getDistanceBetweenCoords3d(mx, my, mz, x, y, z)
        local result, id = sampGetPlayerIdByCharHandle(v)
        if result and id ~= sampGetPlayerIdByCharHandle(PLAYER_PED) and distance < 12.0 then
            if id ~= myid then
                sampSendChat('/checkskills '..tonumber(id) .. s2 )
            end
        end
    end
end