Drakath Posted February 22, 2014 Share Posted February 22, 2014 What's wrong with clientside money? I use clientside 'givePlayerMoney' but my save system is serverside and it does not save the money gotten from client side, why? Link to comment
Fantanic Posted February 22, 2014 Share Posted February 22, 2014 I had same problem its better to create it server side (the money) Edit : triggerServerEvent is probaly needed Link to comment
فاّرس Posted February 22, 2014 Share Posted February 22, 2014 Note: Using this function client side (not recommended) will not change a players money server side. Link to comment
Drakath Posted February 22, 2014 Author Share Posted February 22, 2014 Client: function lol () triggerServerEvent("givemoney", localPlayer, 400) end addEventHandler ( "onClientGUIClick", lolz, lol ) Server: function givecash ( thePlayer, amount ) givePlayerMoney ( thePlayer, amount ) end addEvent("givemoney", true) addEventHandler("givemoney", root, givecash) Warning: Bad argument @ 'givePlayerMoney' Link to comment
فاّرس Posted February 22, 2014 Share Posted February 22, 2014 -- Server Side # function givecash (money) givePlayerMoney ( source, money ) end addEvent("givemoney", true) addEventHandler("givemoney", root, givecash) or you can do this and remove '400' from the trigger : -- Server Side # function givecash () givePlayerMoney ( source, 400 ) end addEvent("givemoney", true) addEventHandler("givemoney", root, givecash) 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