A3kri Posted August 2, 2013 Posted August 2, 2013 Hello .. I have an if statement inside function1 which has two variables, source and source2. is it possible to store these to variable for use in function2? function 1 ( ) if ( xxx == 1) then outputChatBox (getPlayerName(source1) .. "< source1 " .. getPlayerName(source2) .. "< source2 ", getRootElement (), 255, 170, 0 ) toggleControl (source1, "fire", false ) end end function 2( ) givePlayerMoney(source1, 10000) end is it possible?^
Castillo Posted August 2, 2013 Posted August 2, 2013 You can send the arguments to the second function.
xXMADEXx Posted August 2, 2013 Posted August 2, 2013 Also, if you don't have 'local' in the function, it will be stored as a global variable.
A3kri Posted August 2, 2013 Author Posted August 2, 2013 You can send the arguments to the second function. Also, if you don't have 'local' in the function, it will be stored as a global variable. thanks, what I did was i set them to nil then re set them to a value which made it possible =)
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