Jump to content

Problem with query ?


botshara

Recommended Posts

 [20:15:13] Starting items [ [20:15:13] SCRIPT ERROR: items/items_functions.lua:6: ')' expected (to close '(' [20;2Hat line 1) near '}'  
[ [20:15:13] ERROR: Loading script failed: items/items_functions.lua:6: ')' expect [ Hed (to close '(' at line 1) near '}'  

addEventHandler("onPlayerLogin", root, 
function() 
local getfightstyle = exports.sql:query_fetch_assoc("SELECT characterID, fightstyle FROM characters WHERE characterID = " .. exports.players:getCharacterID( source )) 
setPedFightingStyle(source, tonumber(getfightstyle["fightstyle"])) 
end 
} 

Link to post
addEventHandler("onPlayerLogin", root, 
    function() 
        local getfightstyle = exports.sql:query_fetch_assoc("SELECT characterID, fightstyle FROM characters WHERE characterID = '" .. exports.players:getCharacterID( source )) .. "'") 
        setPedFightingStyle(source, tonumber(getfightstyle["fightstyle"])) 
    end 
) 

Link to post

No errors but doesnt get fightstyle from database or event doesnt start ?

addEventHandler("onPlayerLogin", root,  
function()  
if exports.players:isLoggedIn( source ) then 
 local characterID = exports.players:getCharacterID( source )  
 local getfightstyle = exports.sql:query_fetch_assoc("SELECT fightstyle FROM characters WHERE characterID = " .. characterID )  
        setPedFightingStyle(source, tonumber(getfightstyle["fightstyle"]))  
end  
end 
 ) 

Link to post

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