ZeyadGTX Posted June 18, 2014 Share Posted June 18, 2014 Hey guys i use this script which allows me to save player stats but it says that it has some errors that make some lag statssave\main_s.lua:33: attempt to concatenate a boolean value addEventHandler("onPedWasted",root, function() savePedStats( getPlayerAccount(source)) end ) addEventHandler ("onPlayerLogin",root, function() loadPedStats( getPlayerAccount(source)) end ) addEventHandler ("onPlayerQuit",root, function() savePedStats( getPlayerAccount(source)) end ) addEventHandler ("onPlayerLogout",root, function(thePreviousAccount) savePedStats( thePreviousAccount ) end ) function savePedStats( Acc) outputChatBox(getPlayerName(source).." saveing Stats now!", source) local pedposx,pedposy,pedposz = getElementPosition( source ) local pedrotx,pedroty,pedrotz = getElementRotation( source ) setAccountData(Acc, "pos.x", pedposx) setAccountData(Acc, "pos.y", pedposy) setAccountData(Acc, "pos.z", pedposz) setAccountData(Acc, "rot.x", pedrotx) setAccountData(Acc, "rot.y", pedroty) setAccountData(Acc, "rot.z", pedrotz) setAccountData(Acc, "skin", getPedSkin( source )) setAccountData(Acc, "armor", getPedArmor( source )) setAccountData(Acc, "health", getElementHealth( source )) setAccountData(Acc, "money",getPlayerMoney( source )) for i = 21 , 25 do setAccountData(Acc, "stat."..i , getPedStat(source,i)) end for i = 69 , 79 do setAccountData(Acc, "stat."..i , getPedStat(source,i)) end outputChatBox(getPlayerName(source).." saved Stats!", source) end function loadPedStats(Acc ) outputChatBox(getPlayerName(source).." loading Stats now!", source) setElementPosition(source,getAccountData(Acc, "pos.x"),getAccountData(Acc, "pos.y"),getAccountData(Acc, "pos.z")) setElementRotation(source,getAccountData(Acc, "rot.x"),getAccountData(Acc, "rot.y"),getAccountData(Acc, "rot.z")) setPedSkin(source,getAccountData(Acc, "skin")) setPedArmor(source,getAccountData(Acc, "armor")) setElementHealth(source,getAccountData(Acc, "health")) setPlayerMoney(source,getAccountData(Acc, "money")) for i = 21 , 25 do setPedStat(source,i,getAccountData(Acc, "stat."..i)) end for i = 69 , 79 do setPedStat(source,i,getAccountData(Acc, "stat."..i)) end outputChatBox(getPlayerName(source).." loaded Stats!", source) end Link to comment
Max+ Posted June 18, 2014 Share Posted June 18, 2014 iam sure it's not your script , i can't help you if it's not yours , also do you think the scripting is just like that you have a lot of erros , getPlayerName(source).." saveing Stats now!", source) what is this ? it should be like this outputChatBox("Account" ..getPlayerName(source).. "Saved His Stats!", source, getRootElement(),255, 255, 0, true) Link to comment
ZeyadGTX Posted June 18, 2014 Author Share Posted June 18, 2014 and , for your information i made this script but iam new at Scripting so iam Noob Link to comment
Max+ Posted June 18, 2014 Share Posted June 18, 2014 Really ? what is this , https://github.com/cs8898/stat-system/b ... main_s.lua and i really hope you be alot better than me Link to comment
ZeyadGTX Posted June 18, 2014 Author Share Posted June 18, 2014 Any way its just Fixed Link to comment
Max+ Posted June 18, 2014 Share Posted June 18, 2014 Any way its just Fixed your welcome , 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