Jump to content

[0.26.1] Alliance onNewMember - allianceIndex is nil


Rinart73

Recommended Posts

Avorion: 0.26.1

 

I'm trying to globally track whenever a player joins an alliance.

So I registered an "onNewMember" callback for every alliance in the "main.lua":

function onNewMember(playerIndex, rank)
    local player = Player(playerIndex)
    print(string.format("Player %i joined the alliance %s", playerIndex, tostring(player.allianceIndex)))
end

 

But "player.allianceIndex" is nil. So apparently this callback happens BEFORE player's allianceIndex gets a value.

Link to comment
Share on other sites

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
×
×
  • Create New...