Jump to content

erro script save system


Recommended Posts

meu servidor inicia normalmente com o script e funciona, só que após fechar o servidor e verificar a log percebo que sempre acusa os seguintes erros: 

WARNING: [servidor]\[scripts]\Script_Save_System\SS_server.lua:236: Bad argument @ 'split' [Expected string at argument 1, got boolean]
WARNING: [servidor]\[scripts]\Script_Save_System\SS_server.lua:237: Bad argument @ 'split' [Expected string at argument 1, got boolean]
ERROR: [scripts]\Script_Save_System\SS_server.lua:239: attempt to index local 'textures' (a number value)

 

 

todos estes erros acusam nesta função!

 

function setClothes()
    local account = getPlayerAccount(source)
    if ( not isGuestAccount(account) ) then
        local textureString = getAccountData(account, "Clothessaver:Texture")
        local modelString = getAccountData(account, "Clothessaver:Model")
        local textures = split(textureString, 44)
        local models = split(modelString, 44)
        for i=0, 17, 1 do
        if ( textures[i+1] ~= " " or textures[i+1] ~= nil ) then
                addPedClothes(source, textures[i+1], models[i+1], i)
            end
        end
        outputChatBox("Clothes were added by clothessaver", source, 0, 255, 0)
        textures = {}
        models = {}
    end
end
addEventHandler("onPlayerLogin", getRootElement(), setClothes)

 

se alguém puder me ajudar desde já agradeço!!

Link to comment
  • Other Languages Moderators

Não se usa getPlayerAccount(source) neste evento. Pois vc obtém ele nos parâmetros de função.

function setClothes(prevAcc, currAcc) -- Obtém aqui.
    if (not isGuestAccount(currAcc)) then
        local textureString = getAccountData(currAcc, "Clothessaver:Texture")
        local modelString = getAccountData(currAcc, "Clothessaver:Model")
        if (textureString and modelString) then
            local textures = split(textureString, 44)
            local models = split(modelString, 44)
            for i=0, 17, 1 do
                if ( textures[i+1] ~= " " or textures[i+1] ~= nil ) then
                    addPedClothes(source, textures[i+1], models[i+1], i)
                end
            end
        end
        outputChatBox("Clothes were added by clothessaver", source, 0, 255, 0)
        textures = {}
        models = {}
    end
end
addEventHandler("onPlayerLogin", root, setClothes)

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...