I don't know if it's the correct place to post this, since it is not about sourcemod.
I'm trying to modify VScript to randomly replace weapon spawns, for example this should replace pistols with molotovs with 50% chance:
function GetDirectorOptions()
{
local result;
if ( "DirectorOptions" in DirectorScript )
{
result = DirectorScript.DirectorOptions;
}
if ( DirectorScript.MapScript.rawin( "DirectorOptions") )
{
if ( result != null )
{
delegate result : DirectorScript.MapScript.DirectorOptions;
}
result = DirectorScript.MapScript.DirectorOptions;
}
if ( DirectorScript.MapScript.LocalScript.rawin( "DirectorOptions") )
{
if ( result != null )
{
delegate result : DirectorScript.MapScript.LocalScript.DirectorOptions;
}
result = DirectorScript.MapScript.LocalScript.DirectorOptions;
}
if ( DirectorScript.ChallengeScript.rawin( "DirectorOptions") )
{
if ( result != null )
{
delegate result : DirectorScript.ChallengeScript.DirectorOptions;
}
result = DirectorScript.ChallengeScript.DirectorOptions;
}
return result;
}
This doesn't work, error log:
Spoiler
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
Connection to Steam servers successful.
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
VAC secure mode is activated.
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
this doesn't per say need vscripts. just a findentitybyclassname loop on weapon_molotov_spawn and replace with said weapon. take a look at how the css weapon unlocker plugins do it.
this doesn't per say need vscripts. just a findentitybyclassname loop on weapon_molotov_spawn and replace with said weapon. take a look at how the css weapon unlocker plugins do it.
Thanks, looks like those plugins can be modified to do exactly what I want.
But now I'm just wondering what is the correct way to load vscripts? Because even if I load unmodified version, for example this file there are still errors:
Spoiler
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[vargv] ARRAY
[this] TABLE
AN ERROR HAS OCCURED [the index 'DirectorOptions' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]