Mr_nStuff
12-23-2002, 06:00 AM
I'm trying to get a script to properly execute.. The exec doesn't seem to be working.. Here is what i'm trying without success. Basically I want to allow voting on Lean and Axis shotgun. But the only way to do that is have a script to determin the currently selected dmflags.
callvote.cfg
[code:1]"Lean + Strafe" "exec" list
{
"Allowed" "leanOn.scr"
"Disallowed" "leanOff.scr"
}[/code:1]
leanOn.scr
[code:1]main:
if( int( getcvar( dmflags ) ) == 0 )
setcvar "dmflags" "262144"
if( int( getcvar( dmflags ) ) == 1048576 )
setcvar "dmflags" "1310720"
end[/code:1]
leanOff.scr
[code:1]main:
if( int( getcvar( dmflags ) ) == 262144 )
setcvar "dmflags" "0"
if( int( getcvar( dmflags ) ) == 1310720 )
setcvar "dmflags" "1048576"
end[/code:1]
Well here's what pops up on the console when one of these votes passes:
'setcvar' not available from the console
'setcvar' not available from the console
'end' not available from the console
'setcvar' not available from the console
'setcvar' not available from the console
'end' not available from the console
So i'm pretty sure it's not executing as a script.. Instead it's tring to carry out the contents of the SCR file the same way it processes a CFG file.. But weirder yet.. Why does it say end not available twice and setcvar not available four times? That's odd since each SCR file only has 1 end and 2 setcvar commands. Dunno though..
Anyone know how to get a script file SCR (or SHADER?) to properly execute from the console?
callvote.cfg
[code:1]"Lean + Strafe" "exec" list
{
"Allowed" "leanOn.scr"
"Disallowed" "leanOff.scr"
}[/code:1]
leanOn.scr
[code:1]main:
if( int( getcvar( dmflags ) ) == 0 )
setcvar "dmflags" "262144"
if( int( getcvar( dmflags ) ) == 1048576 )
setcvar "dmflags" "1310720"
end[/code:1]
leanOff.scr
[code:1]main:
if( int( getcvar( dmflags ) ) == 262144 )
setcvar "dmflags" "0"
if( int( getcvar( dmflags ) ) == 1310720 )
setcvar "dmflags" "1048576"
end[/code:1]
Well here's what pops up on the console when one of these votes passes:
'setcvar' not available from the console
'setcvar' not available from the console
'end' not available from the console
'setcvar' not available from the console
'setcvar' not available from the console
'end' not available from the console
So i'm pretty sure it's not executing as a script.. Instead it's tring to carry out the contents of the SCR file the same way it processes a CFG file.. But weirder yet.. Why does it say end not available twice and setcvar not available four times? That's odd since each SCR file only has 1 end and 2 setcvar commands. Dunno though..
Anyone know how to get a script file SCR (or SHADER?) to properly execute from the console?