Play sound fx get inventory [SOLVED]

Started by Candle, Fri 14/01/2005 19:08:07

Previous topic - Next topic

Candle

Try to find the code if you get a inventory item I can play a sound ?

Ishmael

Probably the easiest way is to use the Play Sound command (PlaySound(int sound); if you're scripting) just after the Add Inventory command.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Candle


Scorpiorus

Alternatively, the on_event function may be made use of:

main global script:

function on_event(int event, int data) {

Ã,  Ã, if (event == ADD_INVENTORY) PlaySound(xxx);
}

Candle

Thanks Scorpiorus , The sound was kind of annoying so went  with a txt prompt .

Ishmael

Ach, I had all forgotten on_event...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Candle

Wow that works slick for messages to .
function on_event(int event, int data) {

    if (event == ADD_INVENTORY) DisplayMessage(506);

}

SMF spam blocked by CleanTalk