Jump to content

Help Please!


Annas

Recommended Posts

Hey all.

I have a problem on this code:

function downloadPlayerAlternateSkin (p, _) 
    local filename = exports.CSTmysql:query("SELECT * FROM Skins") 
    for i=1, #filename do 
    local theskinId = filename[i].skinid 
    outputDebugString("filename[i] = ".. tostring(filename[i])) 
    if theskinId then 
        fetchRemote("http://localhost/shadersqsdqs/"..theskinId..".jpg", checkPlayerAlternateSkinONLOGIN) 
    end 
    end 
end 
addCommandHandler("addskin", downloadPlayerAlternateSkin) 

Console: INFO: filename = table: 0xa9a3b40

Also it makes server lag (NETWORK TROUBLE) for 1min everytime i use that command '/addskin'.

Maybe there is something wrong on my function.. please help me

Link to comment
    function downloadPlayerAlternateSkin (p, _) 
        local filename = exports.CSTmysql:query("SELECT * FROM Skins") 
        for i=1, #filename do 
        local theskinId = filename[i].skinid 
        outputDebugString("filename[i] = ".. tostring(filename[i].skinid)) -- Not sure if this was what you intended to do, but here it was outputting a table as the string. 
  
        if theskinId then 
            fetchRemote("http://localhost/shadersqsdqs/"..theskinId..".jpg", checkPlayerAlternateSkinONLOGIN) 
        end 
        end 
    end 
    addCommandHandler("addskin", downloadPlayerAlternateSkin) 

Not sure if that's what you were trying to do, but some times small errors such as that will indeed freeze up the server.

Link to comment
    function downloadPlayerAlternateSkin (p, _) 
        local filename = exports.CSTmysql:query("SELECT * FROM Skins") 
        for i=1, #filename do 
        local theskinId = filename[i].skinid 
        outputDebugString("filename[i] = ".. tostring(filename[i].skinid)) -- Not sure if this was what you intended to do, but here it was outputting a table as the string. 
  
        if theskinId then 
            fetchRemote("http://localhost/shadersqsdqs/"..theskinId..".jpg", checkPlayerAlternateSkinONLOGIN) 
        end 
        end 
    end 
    addCommandHandler("addskin", downloadPlayerAlternateSkin) 

Not sure if that's what you were trying to do, but some times small errors such as that will indeed freeze up the server.

Not working :(

ScreenShot:

TsxpOds.png

Debugscript:

Line 5: Attempt to concatenate local 'theskinId' (a nil value)
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...