That code use the pawn emit which originally not exist in sm compiler More info about #emit here
Regards to komashchenko for restoring some removed features to a compiler and for the code below,
which show a simple example of what scripters can do with #emit, myself found it very useful for menu info , when you need to store some data like "4 5.0 -1" and now I don't use FormatEx and ExploadString and just simply send data via parameters and after extracting them back. Remember that any formatting on that stream char will break it, so only use the two function below, I hope the original sm once will return some of that kind of features because they might be useful in some situation, for example when you need to get the number of arguments which use sent to (any ...)
Use can send data like int, float by the AnyToStream(sBuf, 5, 5.0, 3, 5, 7) and get back using StreamToAny(sBuf, iData)
where iData is the any[]
Minimum size of char buffer array should be not less then args * 4 + 1
PHP Code:
/** * @brief Converts any parameter into a stream. * * @param sStream Input string buffer. */ void AnyToStream(char[] sStream, any ...) { // Initialize some variables int iArgs; int nArg; #emit load.s.pri 8 #emit stor.s.pri iArgs sStream[iArgs * 5 - 4] = 0; iArgs = 12 + iArgs * 4;
Seems interesting, but if I understood this right... then you can just use DataPacks for passing information?
Yes but DataPacks work thought extension, but you also can convert Handle to char stream if you need. I also will attach the sourcecode of comp later a bit later tommorow
#emit was removed from spcomp because it made it impossible to safely make many internal improvements, and it had never been used in any released plugin. Using a modified version of spcomp means your plugins will very likely not be compatible with future versions of SourceMod.
#emit was removed from spcomp because it made it impossible to safely make many internal improvements, and it had never been used in any released plugin. Using a modified version of spcomp means your plugins will very likely not be compatible with future versions of SourceMod.
Here I will disagree with you, it will work, like other old compilers works with new ver of sm