Blueman Posted June 15, 2011 Posted June 15, 2011 I'm not sure what this is about but I get a bad argument error when using the following. textDisplayAddObserver ( score, source ) The text display score is added perfectly but showing it fails. It's amazing what people will sell nowadays $500 for an animated gif
Castillo Posted June 15, 2011 Posted June 15, 2011 Well, we can't really help you if you don't post your full script, with just one line we can't know what you did wrong. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
JR10 Posted June 15, 2011 Posted June 15, 2011 Post your whole code, Are you sure that the source are defined, And post the errors or warnings, Did you add text item to the text display? Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Blueman Posted June 15, 2011 Author Posted June 15, 2011 Ok my code is: function score () score2 = 0 score1 = 0 local score = textCreateDisplay() local csscore1 = textCreateTextItem ( "Terrorist: " .. score1 .. " |" , 0.5, 0.5 ) local csscore2 = textCreateTextItem ( "Resistance: " .. score2 .. " |" , 0.5, 0.5 ) textDisplayAddText ( score, csscore1 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), score ) function showscore() textDisplayAddObserver ( score, source ) end addEventHandler ( "onPlayerSpawn", getRootElement(), showscore ) It's not finished and I am aware that csscore 1 and 2 are overlapping. Images: It's amazing what people will sell nowadays $500 for an animated gif
Castillo Posted June 15, 2011 Posted June 15, 2011 Try this: function score () score2 = 0 score1 = 0 scoreDisplay = textCreateDisplay() local csscore1 = textCreateTextItem ( "Terrorist: " .. score1 .. " |" , 0.5, 0.5 ) local csscore2 = textCreateTextItem ( "Resistance: " .. score2 .. " |" , 0.5, 0.5 ) textDisplayAddText ( scoreDisplay, csscore1 ) textDisplayAddText ( scoreDisplay, csscore2 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), score ) function showscore() textDisplayAddObserver ( scoreDisplay, source ) end addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Blueman Posted June 15, 2011 Author Posted June 15, 2011 Try this: addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) Ok and I made some last minute changes that you didn't catch. Works perfectly It's amazing what people will sell nowadays $500 for an animated gif
Castillo Posted June 15, 2011 Posted June 15, 2011 Well... just make these changes to the new code I gave you. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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