-ffn-python Posted September 13, 2015 Share Posted September 13, 2015 I'm entered the game becomes zero points GUIEditor = { gridlist = {}, window = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(0.27, 0.28, 0.46, 0.47, "Clan Point System By Python", true) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(0.03, 0.09, 0.95, 0.84, true, GUIEditor.window[1]) pythonClan = guiGridListAddColumn(GUIEditor.gridlist[1], "Team", 0.5) clanPoints = guiGridListAddColumn(GUIEditor.gridlist[1], "Points", 0.5) python = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "MoonTheRacer", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 2, "0", false, false) guiGridListSetItemColor(GUIEditor.gridlist[1], 0, 2, 254, 138, 0, 255) test = (getElementData(getLocalPlayer(),"wins") or 0) guiGridListSetItemText ( GUIEditor.gridlist[1], python, clanPoints, test, false, false ) for id, team in ipairs(getElementsByType("team")) do local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) guiGridListSetItemText ( GUIEditor.gridlist[1], row, pythonClan, test, getTeamName ( team ), false, false ) guiGridListSetItemColor ( GUIEditor.gridlist[1], row, pythonClan, getTeamColor ( team ) ) end end ) Link to comment
HUNGRY:3 Posted September 13, 2015 Share Posted September 13, 2015 Save it using setAccountData try server side function save() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local winspoints = (getElementData(playeraccount,"wins") or 0 ) setAccountData(playeraccount,"wins",winspoints) end end addEventHandler("onPlayerQuit",root,save) function putlogin(_, playeraccount) if ( playeraccount ) then local playerwins = getAccountData ( playeraccount, "wins" ) if ( playerwins ) then setElementData(playeraccount,"wins",playerwins) end end end addEventHandler("onPlayerLogin",root,putlogin) Link to comment
JR10 Posted September 13, 2015 Share Posted September 13, 2015 Why set the account's element data? Why not the player, so you can use scoreboard? 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