Page 1 of 1

Is "player name" available in lua?

Posted: Sun Jan 06, 2008 4:52 pm
by theITfactor
I am trying to make it so when Player A enters a region, the game says "Player A = Failure" or something like that. Right now it just says "Haha you fail" from the localize. Any idea how to make it dynamic and add in the player's name?

Code: Select all

ActivateRegion("drop1")

region1 = OnEnterRegion(
		function(region, player)
			if IsCharacterHuman(player) then
				RewindAnimation("drop1")
				PlayAnimation("drop1")
				ShowMessageText( "message.custom.drop", DEF )									ShowMessageText( "message.custom.drop", ATT )				
			end
		end, 
		"drop1"
	)
message.custom.drop is the static message

Re: Is "player name" available in lua?

Posted: Sun Jan 06, 2008 5:33 pm
by RepSharpshooter
You can get the profile name. Hold on while I search my luas. I'll edit it in later. Zerted helped me :D

But, can't you only show text that has been localized in the core.lvl? That may prevent you from doing this.

Re: Is "player name" available in lua?

Posted: Mon Jan 07, 2008 2:24 pm
by [RDH]Zerted
The only way I can think of to do that would be to make a pop-up message. However, I don't have a clue how a dedicated server handles a pop-up message or how well they work in MP.