Hamilton Posted June 15, 2012 Posted June 15, 2012 It wont show anything. I do not get any debug errors either. function showTextDisplay ( player ) local serverDisplay = textCreateDisplay() -- create a text display textDisplayAddObserver ( serverDisplay, player ) -- make it visible to a player local serverText = textCreateTextItem ( "Hello world!", 0.01, 0.3 ) -- create a text item for the display textDisplayAddText ( serverDisplay, serverText ) -- add it to the display so it is displayed end addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), showTextDisplay )
Guest Guest4401 Posted June 15, 2012 Posted June 15, 2012 First parameter in onResourceStart is not a player. Please re-check: https://wiki.multitheftauto.com/wiki/OnResourceStart
Hamilton Posted June 15, 2012 Author Posted June 15, 2012 I don't get it. Could you fix the code for me and explain what you did?
Extremo Posted June 15, 2012 Posted June 15, 2012 Hey, The problem is that onResourceStart does not actually have a player-parameter. It has a source parameter which however in your case would be: function showTextDisplay ( player ) -- player == getResourceRootElement(getThisResource()) Which for obvious reasons is not the player. You can figure the rest from there I am sure. Regards.
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