Quote:
Originally Posted by ddhoward
You are storing a "pointer" to the cvar in a variable. This way, when you reference the cvar again later, you are not making AMX Mod X search through the giant list of cvars a second time. Rather than saying to AMX "hey can you check the value of that cvar again? I forgot where it is, so you'll have to look through the list again for the right cvar" you are instead saying "Hey, can you check the value of that cvar again? It was the 321st cvar last time we checked." or something similar.
https://forums.alliedmods.net/showthread.php?t=215635
|
Thank You. Nice explanation skills.
Quote:
Originally Posted by ddhoward
The include is showing you what is required in the native call. For example, that particular native requires you to specify a Ham function, an entity on which the function is being executed, followed by any number of parameters of any type.
http://www.amxmodx.org/funcwiki.php?go=module&id=24
|
Just checked ham_const.inc, it's
same better than funcwiki. Thank you.
Quote:
Originally Posted by Black Rose
Ham: and any: are tags. Much like Array:, Regex:, Float:, bool: and so on.
|
Hmmm.
Quote:
Originally Posted by Black Rose
If you use another value except from the predefined list using the Ham: tag you will get a tag mismatch warning.
|
And where is the predefined list? (noob questions)
Quote:
Originally Posted by Black Rose
This is to hint people that they most likely is using the native incorrectly, trying to send a player index for example.
|
Oh.
Quote:
Originally Posted by Black Rose
Custom tags have absolutely no effect at all after the compilation. The only tag(s) that actually treat the data in a different matter is Float: and perhaps bool  ?). bool may also just be a tagged 32-bit integer (1 cell) with a value of 1/0. I'm not entirely sure.
|
Did not understood this, NVM. Will keep on learning.
Quote:
Originally Posted by Black Rose
any: will allow you to send anything with any tag at that location without getting an error on compilation.
... will allow you to send any number of arguments without getting an error about wrong argument count.
"this" is just the name of that variable.
|
It would be great if you would explain this in layman's terms. Sorry.
Quote:
Originally Posted by Black Rose
What that actually is depends on which function is called. For any Ham_Player_* function, "this" is referring to the player index. And for all the Ham_Item_* functions "this" is referring to the item entity index. You can find more information in ham_const.inc.
|
I read ham_const.inc, but didn't understood much. Where can I get these functions? Every function in include files is explained like this.
Code:
/**
42 * Description: This is typically called whenever an entity is created.
43 * It is the virtual equivilent of spawn from the engine.
44 * Some mods call this on player spawns too.
45 * Forward params: function(this)
46 * Return type: None.
47 * Execute params: ExecuteHam(Ham_Spawn, this);
48 */
I don't understand what's this forward params and execute params. Can you please explain this in short, basic language? Thanks.
Quote:
Originally Posted by Black Rose
When declaring natives for includes the names of the parameters makes no difference at all since natives get their parameters by numbers. They're often named so that people will understand what it is about. In the case of Ham, it can mean a lot of things. This is why "this" was selected instead.
|
Thank You.
__________________