Jump to content

WARNING and ERROR


yToPzz

Recommended Posts

Posted

 WARNING: SaveCJ\Script.lua:33: Bad argument @ 'split' [Expected string at argument 1, got boolean]
 WARNING: SaveCJ\Script.lua:34: Bad argument @ 'split' [Expected string at argument 1, got boolean]
 ERROR: SaveCJ\Script.lua:36: attempt to index local 'textures' (a number value)

 

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) ---- line 33
        local models = split (modelString, 44) ---- line 34
        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) ---- line 36
            end
        end
        outputChatBox("Clothes were added by clothessaver", source, 0, 255, 0)
        textures = {}
        models = {}
    end
end
addEventHandler("onPlayerLogin", getRootElement(), setClothes)

 

Posted
function setClothes()
    local account = getPlayerAccount(source)
    if ( not isGuestAccount(account) ) then
        local textureString = getAccountData(account, "Clothessaver:Texture")
        local modelString = getAccountData(account, "Clothessaver:Model")
    	iprint(textureString, modelString) -- check debugscript for info
    	if textureString and modelString then -- check if textureString is not false or nil
          local textures = split (textureString, 44) ---- line 33
          local models = split (modelString, 44) ---- line 34
          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) ---- line 36
              end
          end
          outputChatBox("Clothes were added by clothessaver", source, 0, 255, 0)
          textures = {}
          models = {}
      	end
    end
end
addEventHandler("onPlayerLogin", getRootElement(), setClothes)

It's either your account data retrieving false or nil value, you should check it before actually split expected string.

You gone learn today.

I work my ass off, but I still can't pay tho.

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...