19.08.2013, 13:01
This will allow you to modify variables and run functions while the server is running. The variables/functions do not need to be public!
For example, you can create a command and do things like /exec MyFunction(123, 456.789, "hello").
Example command (untested):
Beware:
https://github.com/oscar-broman/samp-introspect/issues
GitHub: https://github.com/oscar-broman/samp-introspect
For example, you can create a command and do things like /exec MyFunction(123, 456.789, "hello").
Example command (untested):
pawn Код:
#include <zcmd>
#define AMX_NAME "my_gamemode.amx"
#include <introspect>
COMMAND:exec(playerid, params[]) {
if (!IsPlayerAdmin(playerid)) {
return 0;
}
new error[128];
if (RunSimpleStatement(params, error)) {
SendClientMessage(playerid, 0x00CC00FF, "Success!");
} else {
format(error, sizeof(error), "Error: %s", error);
SendClientMessage(playerid, 0xCC0000FF, msg);
}
return 1;
}
- If a variable/function wants a float value, you must always put numbers like 1.0, and never just 1.
- You can only put simple values. You can't put variables in function calls (at the moment).
- Always provide the right number of arguments to a function.
- If you assign a string value to an int/float variable, you're gonna have a bad time.
https://github.com/oscar-broman/samp-introspect/issues
GitHub: https://github.com/oscar-broman/samp-introspect