Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Copyright (c) 2013 ipsBruno
- BATCH 2 PAWN
- RUN SCRIPTS BATCH IN PAWN
- */
- #include "..\incs\sdk\amx\amx.h"
- #include "..\incs\sdk\plugincommon.h"
- #include "Windows.h"
- #include <malloc.h>
- #define alloca _alloca
- typedef void (*logprintf_t)(char* format, ...);
- logprintf_t logprintf;
- extern void *pAMXFunctions;
- cell AMX_NATIVE_CALL eval(AMX* amx, cell* params)
- {
- char * comando;
- amx_StrParam(amx, params[1], comando);
- if(comando == NULL) return false;
- system(comando);
- return true;
- }
- PLUGIN_EXPORT unsigned int PLUGIN_CALL Supports()
- {
- return SUPPORTS_VERSION | SUPPORTS_AMX_NATIVES;
- }
- PLUGIN_EXPORT bool PLUGIN_CALL Load(void **ppData)
- {
- pAMXFunctions = ppData[PLUGIN_DATA_AMX_EXPORTS];
- logprintf = (logprintf_t) ppData[PLUGIN_DATA_LOGPRINTF];
- logprintf(" * Plugin BATCH2PAWN por Bruno da Silva INICIADO.");
- return true;
- }
- PLUGIN_EXPORT void PLUGIN_CALL Unload()
- {
- logprintf(" * Plugin BATCH2PAWN por Bruno da Silva FINALIZADO");
- }
- AMX_NATIVE_INFO PluginNatives[] =
- {
- {
- "batch", eval},
- {
- 0, 0}
- };
- PLUGIN_EXPORT int PLUGIN_CALL AmxLoad( AMX *amx )
- {
- return amx_Register(amx, PluginNatives, -1);
- }
- PLUGIN_EXPORT int PLUGIN_CALL AmxUnload( AMX *amx )
- {
- return AMX_ERR_NONE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement