Well.....in my eyes there are many errors....but I can't say that precisely because I don't know waht's exactly in the shooter template.
I have modified it a bit...hope it works...i did not test it....
Just try out and just post the errors...I will take a look at them..;)
With your script you can only use predefined amounts of money (one, five, ten).
With the new code you can set the amount of money yourself in the WED and set a default value. Furthermore you can change the amount to 3, 8 or 154.
code:
"
//////////////////////////////////////////////////////////////////////
//
// money.wdl by Matt Fritz modified by Dennis
//
// -> WDL Script to handle money pickups
//
// version 0.1

//
//////////////////////////////////////////////////////////////////////
SOUND money_fetch <moneyPickup.wav>;
var MoneyAmountDefault = 10;
define MoneyAmount,skill50;
define Live,skill51;
string Temp_Str[1000];
function MoneyPickup_Event()
{
// Return other entities
if(EVENT_TYPE == EVENT_PUSH && YOU != player) { return; }
if(EVENT_TYPE == EVENT_ENTITY && YOU != player) { return; }
// Display it
str_for_num(Temp_Str,my.MoneyAmount);
str_cpy(msg.string,"Got");
str_cat(msg.string,Temp_Str);
str_cat(msg.string," euros/dollars");
// Player gets the money
player.MoneyAmount += my.MoneyAmount;
// Sound
snd_play(money_fetch,50,0);
// Removing through setting the "live"-skill to zero
// I think that prevents an error if your pc wants to
// access the money in its endless loop in the action-definition
wait(1);
my.Live = 0;
}
action Money_Act()
{
if(my.MoneyAmount == 0) { my.MoneyAmount = MoneyAmountDefault; }
// Init
my.Live = 1;
my.enable_push = on;
my.enable_entity = on;
my.event = MoneyPickup_Event;
// Endless loop
while(my.Live)
{
// Some item stuff....
// eg. rotating
my.pan += 1*time_step;
// or a light effect with a certain color
my.light = on;
my.red = 255;
my.green = 50;
my.blue = 50;
// add....more stuff here
wait(1);
}
// Kill...well...Remove me....
ent_remove(me);
}
"