Jump to content

Error help me


-ffn-python

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...