megaman54 Posted December 11, 2009 Share Posted December 11, 2009 So, in Wiki where i can see is it server side or client side script? Because always there are no read "server side" or "client side". please tell meso i can continue without problems. Link to comment
megaman54 Posted December 12, 2009 Author Share Posted December 12, 2009 Nevermind. Another thing: why this wont work: function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getPlayerMoney ( source ) setAccountData ( playeraccount, "mtafreeroam.money", playermoney ) end end function onPlayerJoin ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "mtafreeroam.money" ) if ( playermoney ) then setPlayerMoney ( source, playermoney ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerJoin", getRootElement ( ), onPlayerJoin ) -- function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playerposition = getElementPosition ( source ) setAccountData ( playeraccount, "mtafreeroam.position", playerposition ) end end function onPlayerJoin ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playerposition = getAccountData ( playeraccount, "mtafreeroam.position" ) if ( playerposition ) then setElementPosition ( source, playerposition ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerJoin", getRootElement ( ), onPlayerJoin ) it saves everything i want bu it wont load anything. Whats wrong Link to comment
Exploit Posted December 12, 2009 Share Posted December 12, 2009 I may be mistaken but I think you can't have 2 functions named the same Either have everything in onPlayerJoin and onPlayerQuit or name the functions different Example for naming the functions different: function onPlayerQuitSaveMoney ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getPlayerMoney ( source ) setAccountData ( playeraccount, "mtafreeroam.money", playermoney ) end end function onPlayerJoinLoadMoney ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "mtafreeroam.money" ) if ( playermoney ) then setPlayerMoney ( source, playermoney ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuitSaveMoney ) addEventHandler ( "onPlayerJoin", getRootElement ( ), onPlayerJoinLoadMoney ) -- function onPlayerQuitSavePosition ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playerposition = getElementPosition ( source ) setAccountData ( playeraccount, "mtafreeroam.position", playerposition ) end end function onPlayerJoinLoadPosition ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playerposition = getAccountData ( playeraccount, "mtafreeroam.position" ) if ( playerposition ) then setElementPosition ( source, playerposition ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuitSavePosition ) addEventHandler ( "onPlayerJoin", getRootElement ( ), onPlayerJoinLoadPosition Link to comment
megaman54 Posted December 12, 2009 Author Share Posted December 12, 2009 Thanks! ANd who can start scripting for me 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