Here's what I'm trying:
servercommandhandler.scr
servercommand local.player local.command local.args:
switch(local.command)
{
case "cb_rifle":
if(local.player isadmin)
{
//local.text = (local.command + " " + local.args)
local.text = ("toggle " + local.command)
local.cb_riflestatus = getcvar(cb_rifle)
local.admin_name = netname local.player
setcvar "currentAdmin" local.admin_name
wait 1
stuffsrv local.text
wait 1
for(local.i = 1; local.i <= $player.size; local.i++)
{
local.player = $player[local.i]
if(local.i == 1 && local.player.dmteam == spectator)
{
// do nothing
// because this might be a fake player
// on a 'virgin' dedicated server
// stufftexting will eventually crash the server
}
else
{
local.player stufftext ("setu cb_rifle" + " " + local.cb_riflestatus)
}
}
}
break
}
rcontool.urc
resource
CheckBox
{
title "cb_rifle"
name "Default"
rect 455 235 100 20
fgcolor 0.70 0.90 0.00 1.00
bgcolor 0.00 0.00 0.00 0.80
borderstyle "3D_BORDER"
linkcvar "cb_rifle"
stuffcommand "scmd cb_rifle"
}
It all seems to work except the display on the menu resets to unchecked every time I close the menu. Any thoughts?