Couple of questions
What does defining a function as "stock" or "void" practically do?
Is the only difference between a normal variable and a value that is defined (i.e. #define age 16 vs. new age = 16;) is that a defined variable cannot be changed? (which I assume has some overhead influences otherwise there'd be no point in it). Is there a reference somewhere for Sourcemod's syntax for handling bitflags? What is the purpose of gamedata, and why do some plugins need it? Thanks in advance. |
Re: Couple of questions
1. Stock: A normal function provided by an include file. If unused, it won't be compiled.
Void: Basicly a function with no returns needed. 2. A defined age 16 can't be changed as you said wich is true, also a defined value takes no memory in the processor, where the integer variable can be modifyed under any desired circumstances tho it takes up a little bytes to store values, the modify of the integer variable can be used to store data, like client indexes and what else, so yes big point in using the integer variable, but it all depends on what your trying to do. 3. What do you want to know about bitflags, like what are you trying to accomplish? 4. Gamedata is typically changed by the game itself, for us to modify some values we need this gamedata, there should be plenty of information about gamedata laying around, just search. If i'm totally wrong about anything said above feel free to correct me. |
Re: Couple of questions
xines already answered most of it so I'll just give you some references.
Stocks Stocks are mentioned in the wiki and in asherkin's answer to a similar question. You can also read about them in the pawn language guide on page 83. Defines Defines are processed during the compilation process. You can read about them in the pawn language guide on page 92. Bitwise Bugsy talked a bit about this (it's amxx but applicable). As this is not a sourcemod exclusive thing (neither are the defines) i recommend searching for "bitwise operators" or "bitwise operators site:forums.alliedmods.net". You can also read a bit about it in the pawn language guide starting on page 104. |
Re: Couple of questions
Gamedata's purpose is to help Sourcemod locate functions, C++ offsets, and global variables in Valve's code that Valve doesn't explicity expose on its server API or SDK. Finding them requires some reverse engineering of the game.
|
| All times are GMT -4. The time now is 21:09. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.