Code Fixed By:Rei_Ayanami Thank you!

Please read entire post before taking action, if any action taken by you.

"Please Do Not Post, Replay Or Comment On Or To This Post." PM me if you have any questions.


Here is a code just to get this thing going and to show that I'm willing to pay for my ignorance.

I want to attach this code to any of my entities and then when walk close or collide/impact with the entity to give a player some money.
Some part of code works for me but when I try to collect money from entity I get proped window saying "invalid argument in add_money" then when I click ok I still get the money.
This code comes under 11 lines of code pricing $2.00, unless its been upgraded to more then what it is right now.

Code:
action get_cash()
{
   my.emask |= ENABLE_IMPACT;
	my.event = add_money;
	
}

function add_money()
{
	wait (1);
	if (event_type == ENABLE_IMPACT || cash > my.skill1) {return;}
	if (my.skill1 == 0) {my.skill1 = 20;} // default = 20 bucks 
	if (cash == 0) { set(cash_pan,SHOW); }
	cash += my.skill1;
	snd_play (gotcash_snd, 70, 0);
	ent_remove (my);
	
}




Last edited by Siwler; 01/21/12 23:49.

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