alliedmodders/amxmodx — pull request #25 by Arkshine (2014-06-02 17:59:51+00:00)
Title: Implement CS_OnBuy forward + Do some clean up (bug 5906)

This adds a new ```CS_OnBuy``` forward when a player attempts to purchase an item

Few notes worth to be mentioned:
* To make this in a reliable and efficient way, some CS functions are hooked.
* Considering the original code was a mess, I wanted to do some clean up before and taking the opportunity to import some memory tool from SM: ```CDetour``` and ```MemoryUtils```. Both are slightly modified to remove SM dependancies, and more precisely:
* ```CDetour```: Create detour directly from a given address instead of signame (from Kyles's version) and add equivalent functions to allocate/free memory
* ```MemoryUtils```: Changed ```CVector``` to ke:```Vector``` and add ```DecodeAndFindPattern```
* Commit e4ff685 seems to be hard to review, I should have done more steps, but a diff is actually pointless here because I've changed the whole code, since I've used here CDetour way.
* This has been tested under all OSes (windows, linux, and OSX) ,with CS 1.6 and CZ.
* Arrggh to GitHub and his 8 spaces-tab!