GhostXoP Posted December 31, 2012 Share Posted December 31, 2012 Lets throw out a senario Say you have two resources. Starting one, has a function that uses a global variable. This variable shows true, and false when other functions act on it. Starting another resource keeps the global variable in resource one at false. Can this happen by conflicting names? (same name in resources) i would not think its possible right? function usage? Give me some steps i should take, that i probably havent already done to see how this could be happening? What to look for. Ive searched my code to see how its modified, and i see nothing from resource two that could cause this. Debug shows no errors. Link to comment
Castillo Posted December 31, 2012 Share Posted December 31, 2012 You can use the same variable names on many resources, they won't overwrrite. Link to comment
GhostXoP Posted December 31, 2012 Author Share Posted December 31, 2012 I found that since i had "onClientResourceStart" I used getRootElement not getResourceRootElement(getThisResource) so it ran F1 twice when hit, which meant it set the variable true, then false when the other resource had started. Link to comment
Castillo Posted December 31, 2012 Share Posted December 31, 2012 If you use 'getRootElement' for the 'on(Client)ResourceStart' event, it'll execute the function when any resource starts. Link to comment
GhostXoP Posted December 31, 2012 Author Share Posted December 31, 2012 Well what happened was, my key binding was on the init script, so it was bind'ed twice, (Or something like that) I now use the resource element, not the root. Link to comment
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