Jump to content

[Help] Save system and Spectators


hutin123

Recommended Posts

Hi guys!

Pls help me, i want save 1 value, it's "Điểm" with my language, mean Point on server race DM. I have 1 save system like this but only for Money:

node = xmlLoadFile ("player.xml") 
  
function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) 
    if not (isGuestAccount (getPlayerAccount(source))) then 
        local accountData = getAccountData (theCurrentAccount, "money") 
        if (accountData) then 
            local playerMoney = getAccountData(theCurrentAccount, "money") 
            setPlayerMoney(source, playerMoney) 
              end 
              end 
            end 
            addEventHandler("onPlayerLogin", getRootElement(), playerLogin) 
  
function onQuit() 
    if not (isGuestAccount (getPlayerAccount (source))) then 
        account = getPlayerAccount (source) 
        if (account) then 
            setAccountData(account,"money", tostring(getPlayerMoney(source))) 
        end 
    end 
end 
addEventHandler("onPlayerQuit", getRootElement(), onQuit) 

And the second, I have resource name Spectator, i want to translate word "Spectators:" to "Người:" but it not word. Can it work by another way?

Pls help me, thank all.

p/s: Sorry for my english

Link to comment

For points it's almost the same (for saving and getting). My recommendation is that, in order to prevent problems you should also add some event onResourceStop to save, in case shit happens.

For the second option, open the Lua file and search for "Spectators:", then, replace however you want.

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...