Sound hooks source code:
Those wiki-page prototype is wrong, so use info from inc-file instead:
https://github.com/alliedmodders/sou...sound.inc#L322
Here is a sample that compile correctly even without 'view_as' on both sm 1.10, 1.9 (sorry for some dirty example previous time):
Spoiler
PHP Code:
#include <sdktools>
public void OnPluginStart()
{
AddNormalSoundHook(SoundHook);
AddAmbientSoundHook(AmbientHook);
}
public Action SoundHook (int clients[MAXPLAYERS], int &numClients, char sample[PLATFORM_MAX_PATH],
int &entity, int &channel, float &volume, int &level, int &pitch, int &flags,
char soundEntry[PLATFORM_MAX_PATH], int &seed)
{
return Plugin_Continue;
}
public Action AmbientHook (char sample[PLATFORM_MAX_PATH], int &entity, float &volume,
int &level, int &pitch, float pos[3], int &flags, float &delay)
{
return Plugin_Continue;
}
Various:
PHP Code:
ChangeClientTeam(client, CS_TEAM_NONE)
missing ";"
Also, the snippet doesn't work for me in CS:GO. Flag should be CS_TEAM_SPECTATOR. In such case it works correctly.
Quote:
SDKHooks Extension - Many useful functions and forwards, e.g. hooking OnTakeDamage, entity PreThink and OnEntityCreated/Destroyed forwards etc.
|
I would add notice:
Updated list and callback prototypes are always available in inc-file:
https://github.com/alliedmodders/sou...e/sdkhooks.inc
Quote:
On Listen servers a clients index via console is also 0
|
"via console" in
Bold (or something), for noobs like me, since I was thinking client is physically 0 there.
Quote:
Hiding particles might not work for all games or might only work on Windows. This is an engine limitation.
|
Little correction/addition =>
Quote:
Hiding some particles or entities might not work for all games or might only work on Windows.
|
(under "some" I mean like "prop_glowing_object" in L4D1 that doesn't hide via transmit hook)
Code:
blah[0] == 0; or blah[0] == '\0';
or just !blah[0]
Connect to Server
Quote:
so, later you could only run it manually and insecurely)
|
re-phrase please into:
Quote:
so, later you could only run it by executing exe-file directly)
|
Append the end of this line:
Quote:
- Setup port forwarding for 27016 port (or whichever port your game server uses) + client port.
|
+ after this item, please, add new one:
Common Scripting Mistakes
"
Native XXX is not bound" - dependency plugin is not installed, not loaded yet or failed. If dependency is optional,
always check is native available using GetFeatureStatus() before calling it, or check for library presence if dependency register one.
"
Instruction contained invalid parameter" - source code is successfully compiled despite of syntax or structure error since parser is not ideal, example: un-initialized variable.
In this case, error log can point to a wrong plugin name, e.g. normal plugin that leads to raising event in other - guilty plugin.