Grievous Posted January 6, 2022 Share Posted January 6, 2022 Does anyone know how to get and set all players account data? function PayAllJobs ( player ) alivePlayers = getAlivePlayers () if ( alivePlayers ) then alivePlayersList = "none" for playerKey, playerValue in ipairs(alivePlayers) do if ( alivePlayersList == "none" ) then alivePlayersList = getPlayerName ( playerValue ) else PayJobExp(alivePlayers) outputChatBox ( "Alive Players: " .. alivePlayersList ) setAccountData ( account, "exp." ..theTeam, JobExp + 1 ) end end end end function startGameDay( hour, minute ) -- set the time first setTime ( 0, 0 ) setTimer ( PayAllJobs, 10000, 1 ) end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),startGameDay) Link to comment
NeXuS™ Posted January 6, 2022 Share Posted January 6, 2022 Heya, You'll just have to use a for loop like in your code above. Using getPlayerAccount and setAccountData should be enough, no need for those if branches inside your function. 1 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