Samp events крашит assertion failed!

Po24

Участник
Автор темы
72
10
[ML] (error) !banacc.lua: ...ram Files (x86)\SAMP\moonloader\lib\samp\events\core.lua:88: assertion failed!
stack traceback:
[C]: in function 'assert'
...ram Files (x86)\SAMP\moonloader\lib\samp\events\core.lua:88: in function <...ram Files (x86)\SAMP\moonloader\lib\samp\events\core.lua:53>
[ML] (error) !banacc.lua: Script died due to an error. (0F7328AC)
Lua:
local sampev = require('lib.samp.events')
require "lib.moonloader"

function sampev.onPlayerChatBubble(playerId, color, duration, message)
    --print(message)
    if activebubble and tonumber(playerId) == Globalid then
        math.randomseed(os.time())
        local messages = {'mq', 'mqmqq'}
        return {playerId, color, duration, messages[math.random(1, 2)]}
    else
        return {playerId, color, duration, message}
    end
end

function sampev.onChatMessage(playerId, text)
    --print(playerId..' '..text..' '..Globalid)
    if activebubble and tonumber(playerId) == Globalid then
        math.randomseed(os.time())
        local messages = {'mq', 'mqmqq'}
        return {playerId, messages[math.random(1, 2)]}
    else
        return {playerId, text}
    end
end

использую самп евентс в этом коде
переменные все определены, крашит при заходе на сервер
 

fzzxhq

Активный
462
71
Lua:
local sampev = require('lib.samp.events')
require "lib.moonloader"

function sampev.onPlayerChatBubble(playerId, color, duration, message)
    if activebubble ~= nil and Globalid ~= nil and activebubble and tonumber(playerId) == Globalid then
        math.randomseed(os.time())
        local messages = {'mq', 'mqmqq'}
        return {playerId, color, duration, messages[math.random(1, 2)]}
    else
        return {playerId, color, duration, message}
    end
end

function sampev.onChatMessage(playerId, text)
    if activebubble ~= nil and Globalid ~= nil and activebubble and tonumber(playerId) == Globalid then
        math.randomseed(os.time())
        local messages = {'mq', 'mqmqq'}
        return {playerId, messages[math.random(1, 2)]}
    else
        return {playerId, text}
    end
end
?
 
  • Эм
Реакции: Hinаta