19.12.2013, 10:56
(
Последний раз редактировалось xeeZ; 19.12.2013 в 16:07.
)
If anyone cares I released a new version of this (3.6).
What's new:
For example, in order to call GetPlayerName you would do:
For GetPlayerPos:
What's new:
- Added SAMPGDK_TIMER_CALL macro for timer callbacks (expands to SAMPGDK_CALL)
- Added several new functions for calling SA-MP and other plugins' natives dynamically:
Код:sampgdk_find_native(const char *name) sampgdk_call_native(AMX_NATIVE native, cell *params) sampgdk_invoke_native(AMX_NATIVE, const char *format, ...)
- Minor code and build system improvements
pawn Код:
'i', 'd' - int
'b' - bool
'f' - float
'r' - const reference ('const cell *' in C)
'R' - non-const reference (output argument) (the C type is 'cell *')
's' - input string ('const char *' in C)
'S' - output string ('char *'), size must be passed in next argument
Код:
char name[MAX_PLAYER_NAME}; AMX_NATIVE native = sampgdk_find_native("GetPlayerName"); sampgdk_invoke_native(native, "iSi", playerid, name, sizeof(name));
Код:
float x, y, z; AMX_NATIVE native = sampgdk_find_native("GetPlayerPos"); sampgdk_invoke_native(native, "iRRR", playerid, &x, &y, &z);