Jump to content

Variable Overwriting?


GhostXoP

Recommended Posts

Posted

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.

Posted

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.

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...