• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code Simple Program...or not?

Alkyra

FNG / Fresh Meat
Jul 16, 2009
1
0
Hi!

I'd like to write a simple (?) program, but i don't have much time to learn all the things from uscript(exams, work etc..).

What i'd like to do is to simply play a sound for a self-made package which everyone can hear regardless where they are when i type a certain command in the console or even a better a certain word at the chat.

The sound can not be spammed, so once it's playing the other players can't play the sound again till it's ended AND a certain ammount of time passed(like 5 seconds maybe)

I had a vague idea how it should look, but i can't seem to get it work.
I placed the program into KFPlayersInput.uc as the Legacy Wiki suggested but the same error keeps coming (can't find file piac).

Here's the program code i bashed together:


exec function piac()

{

class piacclass extends piacactor;

#exec OBJ LOAD FILE="..\Sounds\alkysounds.uax"

function piacplay()
{
PlaySound(sound'alkysounds.piac' ,optional ESoundSlot 573, optional bool bNoOverride=TRUE)
ClientMessage("piac");

}

DefaultProperties
{

}