Minokon Posted June 16, 2011 Posted June 16, 2011 (edited) Hello I have next question: Can I create variable which I can use in all resources? If I can, how do create it? Thanks for help. http://polish-law.strefa.pl/ Regards, Minokon Edited May 28, 2014 by Guest
JR10 Posted June 16, 2011 Posted June 16, 2011 No, you can't create a variable used in all resources. local variables are used only in thier block(function , etc, etc...), global variables are used in all the scripts in the resources. you can do something like that: function getMyVariable() return theVariable end and export it so it can be used in another scripts.
karlis Posted June 16, 2011 Posted June 16, 2011 setElementData(element theElement,string name,string/float/table/boolean data, boolean sync) getElementData(element theElement,string name) but you need to call setElementData each time you change the var.
JR10 Posted June 16, 2011 Posted June 16, 2011 Exporting a function that gets the variable is easier, because you don't have to update it.
Minokon Posted June 16, 2011 Author Posted June 16, 2011 Thank very much for help. I will use it. My head thinking like in SA-MP, I just used to, maybe somobody know how to create global variable in Pawn Regards, Minokon
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