Shingeki Posted October 7, 2015 Share Posted October 7, 2015 Hey i have a problem with mysql, I dont know how to do it. At the moment i have this: Server: function showPlayerData(player, money) local money = getMysqlData(player,"Money") triggerClientEvent(player,"showMoney", getRootElement(), money) end addEventHandler("onResourceStart", getRootElement(), showPlayerData) If i output money in clientside with outPutChatBox it wont work =( (outputChatBox Expected string at argument 1) Link to comment
Noki Posted October 7, 2015 Share Posted October 7, 2015 If i output money in clientside with outPutChatBox it wont work =(... (outputChatBox Expected string at argument 1) You need to post your client-side code. Oh, and you shouldn't really use triggerClientEvent with the root element as your source parameter. Use player instead. Link to comment
xeon17 Posted October 7, 2015 Share Posted October 7, 2015 ... addEventHandler('onResourceStart', resourceRoot, function () for _,player in pairs (getElementsByType('player')) do local money = getMysqlData(player,"Money") if (money) then triggerClientEvent(player,"showMoney", root, money) end end end) Link to comment
jingzhi Posted November 19, 2015 Share Posted November 19, 2015 Hey i have a problem with mysql,I dont know how to do it. At the moment i have this: Server: function showPlayerData(player, money) local money = getMysqlData(player,"Money") triggerClientEvent(player,"showMoney", getRootElement(), money) end addEventHandler("onResourceStart", getRootElement(), showPlayerData) If i output money in clientside with outPutChatBox it wont work =( (outputChatBox Expected string at argument 1) Show clientside scripts. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now