AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Need some help (https://forums.alliedmods.net/showthread.php?t=232496)

SkumTomteN 12-31-2013 12:49

Need some help
 
So im creating a new mod for cz. and need some scripting help.

so lets say a player. and when he got a specific model. lets say "coolguy model"

or something.

I want it to play random sounds.(for all) and i want that playermodel to have it own special knife, death sounds too.

so, death sounds, knife sounds, and randomly played sounds.

Ive gotten this far..

Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Sounds Custom Mod"
#define VERSION "1.0"
#define AUTHOR "Rui"

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}

public plugin_precache()
{
        precache_sound("Custommod/knife_slash.wav")
        precache_sound("Custommod/knife_stab.wav")
        precache_sound("Custommod/random_1.wav")
        precache_sound("Custommod/random_2.wav")
        precache_sound("Custommod/random_3.wav")
        precache_sound("Custommod/random_4.wav")
        precache_sound("Custommod/random_5.wav")
        precache_sound("Custommod/death_1.wav")
        precache_sound("Custommod/death_2.wav")
        precache_sound("Custommod/ready_round.wav")
}

public random_sound()
{
switch (random_num(0, 4))       
{
                case 0:
                {
 set_task(30.0, "random_1")
                }
              case 1:
                {
 set_task(50.0, "random_2")
                }
                    case 2:
                {
 set_task(80.0, "random_3")
                }
                    case 3:
                {
 set_task(120.0, "random_4")
                }
              case 4:
                {
 set_task(160.0, "random_5")
      }
  }
}
public random_1()
{
        client_cmd(0, "spk Custommod/random_1")
}

public random_2()
{
        client_cmd(0, "spk Custommod/random_2")
}

public random_3()
{
 
        client_cmd(0, "spk Custommod/random_3")
}

public random_4()
{
        client_cmd(0, "spk Custommod/random_4")
}

public random_5()
{
        client_cmd(0, "spk Custommod/random_5")
}

but thats only the random sounds that will be played.

I want death,knife, round start sounds too, round start sound i can code myself. but it would be a "+" if you did it.

Thanks, be sure to come to the new server when its finished!, credits will be shown in a hud msg. or any other kind.

EDIT: ive seen that the code will only play 1 sound, then it will stop i think.

could you change it so it will play all the sounds randomly, and more times in 1 round?.


All times are GMT -4. The time now is 20:39.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.