script_execute
0x00b474d0 · 301 bytes · __cdecl
_ZL14script_executeRK8CCommand
Decompiled
undefined (1 param)
/* script_execute(CCommand const&) */
void script_execute(CCommand *param_1)
{
char cVar1;
char *pcVar2;
int iVar3;
pcVar2 = "";
if (1 < *(int *)param_1) {
pcVar2 = *(char **)(param_1 + 0x40c);
}
if ((*pcVar2 == '\0') || (g_pScriptVM == 0)) {
Msg();
return;
}
cVar1 = UTIL_IsCommandIssuedByServerAdmin();
if (cVar1 != '\0') {
if (*(int *)param_1 < 2) {
pcVar2 = "";
}
else {
pcVar2 = *(char **)(param_1 + 0x40c);
if (pcVar2 == (char *)0x0) {
return;
}
}
iVar3 = _V_strlen(pcVar2);
if ((((0 < iVar3) && (iVar3 = _V_strstr(pcVar2,"\\\\"), iVar3 == 0)) &&
(iVar3 = _V_strstr(pcVar2,":"), iVar3 == 0)) &&
(((iVar3 = _V_strstr(pcVar2,".."), iVar3 == 0 && (iVar3 = _V_strstr(pcVar2,"\n"), iVar3 == 0)
) && (iVar3 = _V_strstr(pcVar2,"\r"), iVar3 == 0)))) {
pcVar2 = "";
if (1 < *(int *)param_1) {
pcVar2 = *(char **)(param_1 + 0x40c);
}
cVar1 = V_IsAbsolutePath(pcVar2);
if (cVar1 == '\0') {
pcVar2 = "";
if (1 < *(int *)param_1) {
pcVar2 = *(char **)(param_1 + 0x40c);
}
VScriptServerRunScript(pcVar2,(HSCRIPT__ *)0x0,true);
return;
}
}
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.