[06/05/2008] Sn4k3 Plugin Template v3.0
1 Attachment(s)
"Sn4k3 Plugin Template" (HL2 Source Games Compatible) are
(C)Copyright 2006-2008 by sn4k3 AKA Tiago Conceição ******************************************* *** Util WebSites *** ******************************************* http://www.callysto.net (My WebSite | Software :D) http://www.sourceplugins.com (VPS Plugins Forum) http://forums.alliedmods.net/forumdisplay.php?f=52 (MMS Plugins Forum) http://www.sourcemm.net (MetaMod Source Downloads) ******************************************* *** About *** ******************************************* The objective of SPT is try make the HL2 Plugin Code more easy And for new guys want make plugins SPT also have a makefile that allow you compile plugins for Linux (.so) (Cygwin) With SPT is easy to update your SPT SRC version if you only code in plugin_ files or make your owns files! All comunity can contribute giving some funcs for add to SPT. NOTE: Not Forget Read LICENSE.txt ! ******************************************* *** STP Instalation *** ******************************************* 1: You need get a copy of SourceSDK 2: Go to steam -> Tools -> Source SDK 3: Config your SDK if any dialog has appear 4: Double Click on Create a MOD 5: Modify Halfi-Life 2 Multiplayer 6: Select the folder you want for copy the files 7: choose your mod name (not important) 8: Go to (your_mod_path/src/utils) 9: Copy Zipped (SPluginTemplate) Folder to current utils/ path 10: Change (SPluginTemplate) Folder name for your plugin name (if you want) 11: Get a Copy of SourceMM and SourceHook SRC AT: (http://www.sourcemm.net) 12: Go to (your_mod_path/src) 13: Copy Zipped (sourcehook) and (sourcemm) Folder to current src/ path 14: Ready to start! NOTE: After install i recomend you build my default project if you get errors you should report at forum! ******************************************* *** Compile *** ******************************************* Under Windows You must have Microsoft Visual Studio (2005 OR 2008) and run Build Tool Under Linux You must install Cygwin in a windows Plantaform (www.cygwin.com) You must review my makefile and edit at your own! and becarefull with missing librarys or .so files! For install the cygwin you can see that post: http://www.sourceplugins.com/viewtopic.php?t=3922 ******************************************* *** Files *** ******************************************* -= spt_utilslib.cpp =- That containe some functions, utils. like send Mensages! -= spt_langlib.cpp =- Allow get text translations -= spt_adminlib.cpp =- Allow use admins in server using flags, groups, etc (like mani) Simple and Complex admin system compatible! -= spt_sigscanlib.cpp =- This contain all sigscan funcs and offsets. This allow have SigScan loader inside (SigScan Class) -= spt_vfuncslib.cpp =- This contain all virtual funcs and offsets. http://wiki.alliedmods.net/Virtual_O...Source_Mods%29 -= spt_timerslib.cpp =- Allow you make delays and repeats without work! -= spt_inilib.cpp =- Allow you parase any ini struct file (many commands avaliable) -= spt_defines.h =- That containe all information about your plugin dll/so like Name, Actor, Url, Lincese .... -= spt_includes.h =- That containe very includes for plugin works! -= spt_last.h =- Load some important thing for SPT engine -= spt_interface.h =- I not recomend change this file!!! This containe all info for plugin work! -= plugin_classes.h =- This include some classes. You can add yours here -= plugin_cmds.h =- That file Containe some Server Commands examples You may delete and begin add your commands here! -= plugin_convars.h =- That file Containe some Server Convars You may delete and begin add your Convars here! -= plugin_defines.h =- That can be used for you #define your own defines -= plugin_includes.h =- You can add your owns includes not in (spt_includes.h) file! I dont recomend use spt_includes.h file to include! -= plugin_timers.h =- Allow you add your own timers/delays code -= plugin_blocks.h =- Allow you add your own util blocks -= sourcehook.cpp =- SourceHook is a important File for hows want use some hooks! -= memoverride.cpp =- Not important, but dont remove! -= serverplugin_convar.cpp =- Not important, but dont remove! -= MRecipientFilter.cpp =- That allow add player/delete you can make filters like all humans, all bots etc -= serverplugin_engine.cpp =- That containe all Plugin Engine! You may use that for events, gameframe and other importante things! ******************************************* *** Faqs *** ******************************************* Q: What is the diference betewen spt_ and plugin_ files? A: is not recomendated code in spt_ files because SPlugin Template Updates, so you should use plugin_ files to code (easy to update SPT SRCs) Q: What is VSP and MMS? A: VSP is a Standart Alone Plugin A: MMS is a MetaMod Source Plugin (A Plugin Engine) Q: This can compile for Linux? A: Yes, if you make all compatible with linux If you dont know what is cygwin read this: http://www.sourceplugins.com/viewtopic.php?t=3922 NOTE: Dont use that link Makefile! use SPT makefile insted! Q: Can i make a MetaMod Plugin with this? A: Yes, you only need define a var and this will compile for MMS (www.sourcemm.net) Q: Here can i Release Or GetHelp About HL2 Plugins? A: If is a VSP i recomend here: http://www.sourceplugins.com/index.php A: If is a MMS i recomend here: http://forums.alliedmods.net/forumdisplay.php?f=52 Q: What should i use Release or Debug at VS2005 ? A: You should use Release because Debug compile not ready yet! Q: Is SPT 100% Free? A: Yes, but on release your plugin you must indicate your are usng SPT as base Read LICENSE.TXT ! http://creativecommons.org/licenses/by-nc-sa/3.0/us/ ******************************************* *** How To *** ******************************************* Add VFuncs or SigScan funcs: Since SPT v2.0 adding vfuncs or sigscan funcs are realy easy!! You need have 'myplugin_gameinfo.dat' working with the offsets you want. After you need must know what func you will add eg. 'CBaseAnimating::Teleport' (can be finded at info.dat file) Now you need know real func params, so open HL2MP SRC (Game_HL2MP-2005.sln) 'your_mod_folder/src', and after search for func "CBaseAnimating::Teleport" After serach probaly will show some results, try go to lines and see if is the real func. Quote:
So go to your code file and add something like: Code:
bool UTIL_Teleport(edict_t *pEntity, const Vector *newPosition, const QAngle *newAngles, const Vector *newVelocity) VFUNC_x = Call VFuncs (replace the 'x' for the number of real func params) void CBaseAnimating::Teleport( const Vector *newPosition, const QAngle *newAngles, const Vector *newVelocity ) VFUNC_3(pBase, iOffset, , void, const Vector *, newPosition, const QAngle *, newAngles, const Vector *, newVelocity); pBase = Player. iOffset = Func Offset. , OR return = return, if a func is a return like 'IsMoving' you should put 'return' here. void = Real Func return type (RED) All others params are the params types and the values. I recomend use 'bool' return types in funcs not need return anything! With bool you can easy check if func run correctly eg. Code:
if(!UTIL_Teleport(pEntity, NULL, NULL, Vector(100, 100 ,100)) SigScan will work at same way but use: SIGSCAN_x() and SIGSCAN_STATIC_x() SIGSCAN_STATIC_x() = For functions not require run from any entity like 'CreateEntityByName' NOTE: You can use the 'plugin_blocks.h' file to add that codes. Also see 'spt_vfuncslib.cpp' and 'spt_sigscanlib.cpp' for a better understand. Working with filters (MRecipientFilter.cpp): Since SPT v2.0 you life is more easy! You can now add very easy players by filter, userid, steamid Lets see a client exec sample: Code:
void Cexec(char *players, const char *command) Code:
for(int i = 0; i < mrf.GetRecipientCount(); i++) Code:
esounds->EmitSound((IRecipientFilter&)mrf, ...); Quote:
Also support player names, userids, player steam id! with multi players like: "2 3 4 name STEAM_0:0:1254254 BOT" This will add userid: 2, 3 and 4 Player name: name Player SteamID: STEAM_0:0:1254254 and BOT After will clean players repeats. NOTE: Look at 'spt_utilslib.cpp' for a better understanding. Power of formated strings: 'SPT_MultiParms(x);' allow you use like Msg(); params. Code:
void MyOwnMsg(const char *msg, ...) (...) = very important NOTE: Look at 'spt_utilslib.h' for a better understanding. ******************************************* *** Librarys *** ******************************************* All SPT Librarys versions: Quote:
******************************************* *** Addons *** ******************************************* SPT Addons is external librarys like MySQL, Sqlite, sockets, and others ... All yours external libs and projects should be here Also there are some spt addons included SQlite V3.5.4 Addon (V1.1) SQlite Documentation NOTE: Please read 'SPluginTemplate/Addons/README.txt' ******************************************* *** Thanks To *** ******************************************* www.sourcemm.net (MetaMod Source Engine) www.sourcemod.com (Thanks To all help From comunity, examples and for the Plugin Annouce) www.sourceplugins.com (Thanks To all help From comunity and for the Plugin Annouce) awuh0 -> (Thanks to all and fast help) ******************************************* *** Contribute *** ******************************************* If any want contribute by giving functions or edias to SPT you should post in forum. You can give anything like functions, edias, utils, libs, etc ... Also you can donate money via PayPal Or AlertPay :D PayPal/AlertPay Account: [email protected] On contribute i will put you in credits. Quote:
SPT On SourcePlugins Forums SPT On MetaMod:Source Forums |
Re: [09/08/2007] Sn4k3 Plugin Template v1.0
how do can i set admin too me?
|
Re: [09/08/2007] Sn4k3 Plugin Template v1.0
Quote:
|
Re: [09/09/2007] Sn4k3 Plugin Template v1.1
New Version v1.1!
v1.1 [09/09/2007] - added more defines (spt_defines.h) - fixed no compile for metamod source! (serverplugin_engine.cpp) |
Re: [09/09/2007] Sn4k3 Plugin Template v1.1
New Version v1.2
v1.2 [21/11/2007] - added sigscanning to allow use special funcs - added sigscan examples - added timers allow use delays - added timers usage - added a new cmd example to show now SigScan works - added 'getEntityFromUserID' -> spt_blocks.h - added 'plugin_timers.h' to code your own delays blocks - added 'plugin_blocks.h' to code your own util blocks - added an EmitSound usage with SigScan slay func - added 'Sexec' void to 'spt_blocks.h' - change IsAlive code to work |
Re: [27/1/2007] Sn4k3 Plugin Template v1.2
new v1.3
v1.3 [01/12/2007] - added file 'spt_sigscan.h' (contain all SPT PreMade SigScan blocks) - added file 'myplugin_info.dat' (contain all sigscan masks, signatures, symbols) - added a easy way to add sigscan funcs - added CSS player respawn sample (SigScan) - added some Hex Utils - added 'UTIL_GetPropertyInt' (Allow get a player property [INT]) - added 'UTIL_GetPropertyFloat' (Allow get a player property [FLOAT]) |
Re: [21/12/2007] Sn4k3 Plugin Template v2.0
New Version:
v2.0 [21/12/2007] - added 'AddByFilter' to 'MRecipientFilter.cpp' (Thanks to awuh0) - added some util blocks to 'spt_blocks.h' - added 'spt_last.h' last included file for load something for spt engine - added more signatures - added allow load VFuncs offsets from 'myplugin_gameinfo.dat' - added more VFuncs - added more sample cmds (plugin_cmds.h) - added Mensages to '::Load', '::UnLoad', '::Pause', '::UnPause' - added more #defines to plugin - added 'repeats' to timers - added spt librarys - added spt_utilslib.cpp and spt_utilslib.h (came from spt_blocks.h) - added spt_sigscanlib.cpp and spt_sigscanlib.h (came from spt_sigscan.h) - added spt_vfuncslib.cpp and spt_vfuncslib.h (came from spt_vfuncs.h) - added easy way to use multi pararms (Formated String like Msg()) - added allow HOOK and UNHOOK Functions (spt_vfn_hook) - added 'spt_langlib.cpp' and 'spt_langlib.h' allow get translations - added spt_info command (print a full info about spt engine and usages) - added 'spt_adminlib.cpp' and 'spt_adminlib.h' allow use admins in server using flags, groups, etc (like mani) - added 'GamePlayer' to 'myplugin_gameinfo.dat' for allow plugin know what type of Player offsets is using eg. CSSPlayer or CDODPlayer - added extern librarys (Addons) to spt (optional) - change vfuncs samples to a better usage (4 lines of code only) for each func - change signature samples to a better usage (4 lines of code only) for each func - change all 'spt_blocks.h' file to looks better - change some 'spt_blocks.h' funcs to work with 'multi args' and 'AddByFilter()' - change vfuncs and sigscan to an class (.cpp) - change file name 'myplugin_info.dat' TO 'myplugin_gameinfo.dat' - change some files directory - removed sigscan need 'sourcehook.cpp' - removed 'offsets.h' file - removed some functions from spt blocks - removed 'maxClients' param from all 'MRecipientFilter' blocks |
Re: [06/05/2008] Sn4k3 Plugin Template v3.0
new version:
Code:
v3.0 [06/05/2008] |
All times are GMT -4. The time now is 13:04. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.