#Paper Posted June 8, 2011 Posted June 8, 2011 If i use this code: function onWasted() if state == "Running" or state == "PostFinish" then end end addEventHandler("onPlayerWasted", getRootElement(), onWasted) the function wont work, if i use this one: function onWasted() end addEventHandler("onPlayerWasted", getRootElement(), onWasted) The function works. The "state" variable is defined here: local state = "" function raceStat(newStateName) state = newStateName end addEvent("onRaceStateChanging", true) addEventHandler( "onRaceStateChanging", getRootElement(), raceStat) My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
karlis Posted June 8, 2011 Posted June 8, 2011 make sure does it needs a capital letter at beginning. [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
#Paper Posted June 8, 2011 Author Posted June 8, 2011 I saw it in the racestates_server.lua it needs My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Aibo Posted June 8, 2011 Posted June 8, 2011 If i use this code:The "state" variable is defined here: and where is "here"? same file? same resource, but other file? ?
#Paper Posted June 8, 2011 Author Posted June 8, 2011 in the same lua file My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
BinSlayer1 Posted June 8, 2011 Posted June 8, 2011 this might look dumb but i've had many problems with IF's when I wasn't using paranthesis so you might wanna try the following: if (state == "Running") or (state == "PostFinish") then
#Paper Posted June 8, 2011 Author Posted June 8, 2011 it's just the same My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Aibo Posted June 8, 2011 Posted June 8, 2011 ok then, how do you know your function works if your function does nothing? ?
#Paper Posted June 8, 2011 Author Posted June 8, 2011 cuz the outputChatBox doesn't happen My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Aibo Posted June 8, 2011 Posted June 8, 2011 well there's no outputChatBox in the code you've posted. ?
#Paper Posted June 8, 2011 Author Posted June 8, 2011 Ye, i deleted the code and i posted just a part... My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Aibo Posted June 8, 2011 Posted June 8, 2011 and what makes you so sure the error is in the lines you've posted, and not in the deleted ones? ?
#Paper Posted June 9, 2011 Author Posted June 9, 2011 the error is in the code that i've posted, cuz if i use the first one code i've posted the fuction wont work, instead if i use the second one it works.. so... My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
karlis Posted June 9, 2011 Posted June 9, 2011 just put all the code, will be easier for both helpers and you, and will save misleadings. [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
#Paper Posted June 9, 2011 Author Posted June 9, 2011 I fixxed don't worry My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
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