hey guys its me again with the problem, I hope I don't offend anyone by my lack of knowledge in programing.

Function add_money()
// in next line of code I get syntax error
if (cash == 0) {cash_pan, visible = on;}

// so I tried it this way
if (cash == 0) {cash_pan = VISIBLE;}
// I still get syntax error, don't know any other way to fix this. Will anyone help me?

here is the full code:
Code:
var cash = 0;

function add_money();
function buy_me();


STRING* snipergun_mdl = "snipergun.mdl";
STRING* gotcash_snd = "gotcash.wav";
STRING* spentcash_snd = "spntcash.wav";
BMAP* cash_map = "cashpan.bmp";
/////////////////////////////////////////////
// collects cash from items etc.
FONT* arial_font = "Arial#20b";
PANEL* cash_pan =
{
        bmap = cash_map;
	digits (40, 22, 4, Arial#20b, 1, cash); 
	flags = transparent, overlay, refresh, d3d;;
}
action get_cash()
{
	set (my, ENABLE_IMPACT);
	my.event = add_money;
}
function add_money()
{
	wait (1);
	if (my.skill1 == 0) {my.skill1 = 20;} // default = 20 bucks 
	if (cash == 0) {cash_pan, visible = on;}
	cash += my.skill1;
	snd_play (gotcash_snd, 70, 0);
	ent_remove (me);
}
/////////////////////////////////////////////////
action buy_items()
{
	set (my, ENABLE_CLICK);
	my.event = buy_me;
}
function buy_me()
{
	wait (1);
	if (event_type != EVENT_CLICK || cash < my.skill1) {return;}
	cash -= my.skill1;
	snd_play (spentcash_snd, 70, 0);
	ent_remove (me);
}






Honesty will get you far, were dishonesty will get you only so far in life.