Drakath Posted February 22, 2014 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?
Fantanic Posted February 22, 2014 Posted February 22, 2014 I had same problem its better to create it server side (the money) Edit : triggerServerEvent is probaly needed
فاّرس Posted February 22, 2014 Posted February 22, 2014 Note: Using this function client side (not recommended) will not change a players money server side.
Drakath Posted February 22, 2014 Author 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'
فاّرس Posted February 22, 2014 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)
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