Can't kill a timer
#2

This is because variables have a scope; put plainly, a life within a certain amount of code. In case you create it in a function, like here (OnPlayerEnter/ExitVehicle), the variable will be destroyed at the end of the function and anything assigned to it will be lost.

In order to have this variable carry a value over to another function, you will need to create it globally, outside of any other function. In case you are not sure on that position, try placing it above the main() function. You will also need to remove the code where you create it locally within the functions so the compiler doesn't throw a warning/error.
Reply


Messages In This Thread
Can't kill a timer - by Moron - 03.12.2012, 04:24
Re: Can't kill a timer - by Bakr - 03.12.2012, 04:34
Re: Can't kill a timer - by Moron - 03.12.2012, 13:32

Forum Jump:


Users browsing this thread: 1 Guest(s)