This is the extension part behind the Entcontrol-Plugin.
There are 2 Parts - Extension and plugin.
The plugin-part is only needed for spawning NPCs.
Main Functions
- Integrated Webserver
- Entity-Outputs
- Parse .nav-files (CS:S only?)
- Extract items from VPK, BSP, GCF, NCF, PAK, VPK, WAD, XZP
- CRC32, MD5, Hamming-Distance, Hash, Gaussian-Random-Hash (mostly untested)
- Spawn NPCs (CS:S only)
Integrated Webserver
All files a stored under sourcemod/configs/www.
You can find the server running
here.
Files can be "adminized" by inserting the flag into the very first line:
{b}<html>....
Every plugin has the ability to use the webserver-forward. This way it is possible to write webinterfaces for your own plugins.
Iīm using this feature for the entcontrol-webinterface.
Click here to see it in "action" (itīs still very early ... so there is not much to see, yet)
Entity-Outputs
Everyone knows about AcceptEntityInput but what about the outputs?
With entcontrol itīs possible to get these outputs.
You can see it in action if you check the entcontrol-webserver-entitylist
here.
Just click some entity index and see the inputs and outputs.
Parse .nav-files
You may use the nav-files to find hiding spots.
These spots can be used for spawning players or items.
If the .nav file is compressed into the .vpk-file it will be extracted automatically.
Extract items from VPK, BSP, GCF, NCF, PAK, VPK, WAD, XZP
Using HLLib it is possible to extract files from these package-files.
Code:
/**
* Extension-Natives
*/
// + Entities
native EC_Entity_GetOutputCount(entity, String:sOutputName[]);
native bool:EC_Entity_GetOutputFirst(entity, String:sOutputName[]);
native bool:EC_Entity_GetOutputAt(entity, String:sOutputName[], i);
// - Entities
// + Navigation(.nav needed) - Used to spawn players/npcs/...
// Thanks to AnthonyIacono - https://github.com/AnthonyIacono for his navigation-parsing-code
native bool:EC_Nav_Load(); // .nav-files will automatically extracted from .vpk file
native bool:EC_Nav_CachePositions();
native bool:EC_Nav_GetNextHidingSpot(Float:randomPosition[3]);
// - Navigation
// + Webserver
// Not working? Look into your logfile: "Not enough space on the stack"? Type the following to increase the stackspace to 131072 bytes (131072/4=32768 cells)
// #pragma dynamic 32768
#define EC_MAXHTTPRESULT 131072
forward Action:EC_OnWebserverCallFunction(const userID, const String:function[], const String:arg[], String:result[]); // resultsize is max 131072 bytes
native EC_Web_GetPort();
// - Webserver
// + HLLib - http://nemesis.thewavelength.net/index.php?p=35
native bool:EC_HLLib_OpenFile(const String:function[]); // BSP, GCF, NCF, PAK, VPK, WAD, XZP and uncompressed ZIP package formats are supported.
native bool:EC_HLLib_ItemExist(const String:item[]);
native bool:EC_HLLib_Extract(const String:source[], const String:destination[]);
native EC_HLLib_Close();
// - HLLib
// + Dlib - http://dlib.net/
native EC_Dlib_CRC32(const String:text[]);
native EC_Dlib_MD5(const String:text[]); // text is in/out
native EC_Dlib_HammingDistance(num1, num2);
native EC_Dlib_Hash(const String:text[]);
native Float:EC_Dlib_GaussianRandomHash(num1, num2, num3);
// - Dlib
/**
* Plugin-Natives
*/
// + NPCs
// Possible NPC-Names:
// npc_antlion,npc_antlionguard,npc_barney,npc_dog,npc_gman,npc_headcrab,npc_police,npc_soldier,npc_sentrygun,npc_vortigaunt,npc_synth,npc_zombie,...
native EC_NPC_Spawn(String:sNPCName[], Float:x, Float:y, Float:z);
// - NPCs
This is a bit of chaos:
Why do I release some extension that is already released under my entcontrol-plugin-thread?
Most of the people donīt know about the functionality behind entcontrol, so it thought about making this thread to let other developers know about this. And maybe someone might find use of some features
This is why the download can only be found in the original thread:
Download
Or the Sourcecode at
GITHUB
__________________