Errors that may occur while working with global types;- two checksum names being the same = CRASH

%GLOBAL% Usage:

%GLOBAL% in the qb script is actually a misleading name.But its very useful.

%GLOBAL% works pretty much like "Global types". The difference is that the value has to be passed as a parameter into the function, OR it could be defined inside the function itself.

An easy way to explain the "passing as parameter"-part would be;When you call a function you can add Arguments, the way it works is that you "give" the function data that it can access when its run. Unlike the "Global Types" where it can always be accessed.

This function above (Example_GlobalData02), will run then wait the number of frames assigned to the %GLOBAL% value "myframes".

Actually, there is 3rd way to work add a %GLOBAL% value, its a little more advanced than the others.If you have a function that is depending on a parameter/value being passed. You can add a "default" value to the "function header".

It works like this; if you have a function that will not work if some parameters are missing, you add a default value, that will only be use if a new one is not presented.

QB scripts does not really have a bool data type, but "If" statements can handle both Floats and Integers as a bool.Its really simple, if you setup a Global Integer, either assigned to 0 or 1 it will be handled as True / False.

Now, if you have a Float that you want to "put back" into another vector/double. I figured out a little wacky way to do that.This is useful when you only want to change one of the floats in the vector/double.

WhoElseButMe on Nov 26, 2009 wrote:It's that lack of respect amongst their peers and ignorance towards modding etiquette that keeps us who know this stuff well from spreading it like wild fire. We do still enjoy playing the game and if you need to cheat to play a game PLAY SOMETHING ELSE YOU DON'T SUCK AT.

WhoElseButMe on Nov 26, 2009 wrote:It's that lack of respect amongst their peers and ignorance towards modding etiquette that keeps us who know this stuff well from spreading it like wild fire. We do still enjoy playing the game and if you need to cheat to play a game PLAY SOMETHING ELSE YOU DON'T SUCK AT.

Inside your function you would want to first loop your array in the event it contains more than 1 element. The "MyId" element is used for identifying this element. I'll show you how to get at the element first.

As you can see we get the array size first to know how many elements we need to loop over. Set a default index to zero then iterate through the array. When MyId matches Element1 we set an integer indicating this elements index in the array.

For display purposes we send two chat messages. The first one will display the values of our structure before modifications.

WhoElseButMe on Nov 26, 2009 wrote:It's that lack of respect amongst their peers and ignorance towards modding etiquette that keeps us who know this stuff well from spreading it like wild fire. We do still enjoy playing the game and if you need to cheat to play a game PLAY SOMETHING ELSE YOU DON'T SUCK AT.