06.05.2012, 04:58
(
Последний раз редактировалось Jonny5; 17.05.2012 в 01:31.
Причина: Updates!
)
SA-MP ALS Hooking Generator 0.3b
About
This is a simple app to generate the code needed to do an ALS hook on any callback.
Dont know what ALS Hooking is? Please check this posts for more info.
https://sampforum.blast.hk/showthread.php?tid=85907
Whats this do?
The app will generate code to hook one or more callbacks defining all the ALS code for you
with your set prefix.
supports both pre & post code for OnGameModeInit().
The interface has checkboxs with a list of all callbacks to select to hook.
Is this better/faster than y_hooks?
Quote:
For reference, ALS and y_hooks are pretty much equal in run-time speed, but you're right that y_hooks takes longer to compile (though this has been vastly improved) and ALS takes longer to write - so if you have a tool to generate ALS code then that's a win!
|
where/what you using ALS over y_hooks, Do you want to depend on another lib,
would depend on your code, if your already using YSI then I would use y_hooks.
What language is this written in?
VS c# 2010
Update
After the discussion held here, ****** had some great ideas and some tips that I have implemented.
So credits to ****** for his tips & ideas!
List of changes
0.3b:
- Fixed a bug in code that was generated for OnGameModeInit()
- Fixed a bug in code that was generated to check for null strings.
- Added full support for custom functions
- Added support for storing weather a callback exists or not.
- When no prefix is set, prompt user to enter one.
- Code now generates support for null strings.
- Added more to the interface to allow for Custom Callbacks ALS code generation.
Read below in "Custom Callbacks" to learn how to use it.
Adding a custom callback is easier than ever.
When you launch the ALS generator you'll see a group box
(See ss2.jpg from the attachments)
It takes 3 Parameters:
- Name //This is the Callback Name ex: OnSomeCallBack
- Format //This is the format specifier ex: isf
- Arguments //This is the arguments list ex: playerid,text[],Float:fVal
Note that when using a string argument in a custom function
the code to check for null string is also generated for you!.
New in 0.3*
You can now add and remove custom callbacks from a list
before generating the ALS code.
Note
OnGameModeInit() is always generated. If its the only function you want to hook
Just set your prefix and hit generate!.
Future Release
I have planed for a future release that will load all callbacks from a file making it easy
to permanently add your custom callbacks. This will allow me to add the function hooking support
along with release a simple file for updating the app. This will require a rewrite of the hole system
so will not be done right away but over the next few weeks. I have another project to do before this.
Suggestions
Note this is a work in progress but fully functional,
any suggestions will be taken into consideration.
regards,