Quote:
Originally Posted by Vit_amin
Wow! Nice !
What about Left 4 Dead 2 VScripts ?
|
You can call vscript functions in l4d2 with this stock.
however it should work in just about anygame.
Found in timocop's plugin director unlocker
https://forums.alliedmods.net/showthread.php?p=2535972
PHP Code:
/**
* Runs a single line of vscript code.
* NOTE: Dont use the "script" console command, it startes a new instance and leaks memory. Use this instead!
*
* @param sCode The code to run.
* @noreturn
*/
stock L4D2_RunScript(const String:sCode[], any:...)
{
static iScriptLogic = INVALID_ENT_REFERENCE;
if(iScriptLogic == INVALID_ENT_REFERENCE || !IsValidEntity(iScriptLogic)) {
iScriptLogic = EntIndexToEntRef(CreateEntityByName("logic_script"));
if(iScriptLogic == INVALID_ENT_REFERENCE || !IsValidEntity(iScriptLogic))
SetFailState("Could not create 'logic_script'");
DispatchSpawn(iScriptLogic);
}
static String:sBuffer[512];
VFormat(sBuffer, sizeof(sBuffer), sCode, 2);
SetVariantString(sBuffer);
AcceptEntityInput(iScriptLogic, "RunScriptCode");
}
__________________