AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hostage Sounds (https://forums.alliedmods.net/showthread.php?t=19663)

Evaldas 10-22-2005 16:01

Hostage Sounds
 
I'm using one old AMX plugin, and want to make it work on my server. So here is what I have (done some changes):

Code:

#include <amxmodx>

#define SOUNDS_NUM 8

new sounds_list[SOUNDS_NUM][] = {"misc/hostages/getouttahere.wav", "misc/hostages/illfollow.wav", "misc/hostages/youlead.wav", "misc/hostages/letsdoit.wav", "misc/hostages/letsgo.wav", "misc/hostages/letshurry.wav", "misc/hostages/letsmove.wav", "misc/hostages/okletsgo.wav"}

public plugin_precache()
{
        precache_sound("misc/hostages/getouttahere.wav")
        precache_sound("misc/hostages/illfollow.wav")
        precache_sound("misc/hostages/youlead.wav")
        precache_sound("misc/hostages/letsdoit.wav")
        precache_sound("misc/hostages/letsgo.wav")
        precache_sound("misc/hostages/letshurry.wav")
        precache_sound("misc/hostages/letsmove.wav")
        precache_sound("misc/hostages/okletsgo.wav")
}

public plugin_init()
{
        register_plugin("Hostage Sounds", "x.x", "xxxxx")
        return PLUGIN_CONTINUE
}

public EmitSound(entity, channel, const sample[])
{
        if(equal(sample, "hostage/hos1.wav") || equal(sample, "hostage/hos2.wav")
        || equal(sample, "hostage/hos3.wav") || equal(sample, "hostage/hos4.wav")
        || equal(sample, "hostage/hos5.wav") || equal(sample, "hostage/hos6.wav")
        || equal(sample, "hostage/hos7.wav"))
        {
                emit_sound(entity, CHAN_VOICE, sounds_list[random_num(0, SOUNDS_NUM-1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
                return PLUGIN_HANDLED
        }
        return PLUGIN_CONTINUE
}

Tested, but hostages still use hos...wav instead new ones. What is wrong?

WaZZeR++ 10-22-2005 18:05

becasue there is no EmitSound.
check the wiki if there is some new function, but i think you have to register an event....not sure witch
http://www.amxmodx.org/funcwiki.php

atomic 10-22-2005 18:06

do you think he will understand what you said?

WaZZeR++ 10-22-2005 18:18

no.....but maybe someone can help him, becasue i have now clue what function or event that can be.
I just told the next persone whats worng so he souldnt need to think: "Hummm, whats the problem here?"
saving-others-time-thing.... :P

atomic 10-22-2005 18:20

:P

XxAvalanchexX 10-22-2005 19:26

The problem is that you never register FM_EmitSound with Fakemeta.

Evaldas 10-22-2005 21:16

Thank you XxAvalanchexX. Now plugin works, and looks like:

Code:
#include <amxmodx> #include <engine> #include <fakemeta> public plugin_init() {     register_plugin("Hostage Sounds", "0.6", "Evaldas")     register_forward( FM_EmitSound, "EmitSound" ) } public plugin_precache() {     precache_sound("misc/hostages/okletsgo.wav")     precache_sound("misc/hostages/getouttahere.wav")     precache_sound("misc/hostages/letsgo.wav")     precache_sound("misc/hostages/illfollow.wav")     precache_sound("misc/hostages/youlead.wav") } public EmitSound(entity, channel, const sound[]) {     if( equal( sound, "hostage/hos1.wav" ))     {         emit_sound(entity, channel, "misc/hostages/okletsgo.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)         return FMRES_SUPERCEDE;     }     if( equal( sound, "hostage/hos2.wav" ))     {         emit_sound(entity, channel, "misc/hostages/getouttahere.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)         return FMRES_SUPERCEDE;     }     if( equal( sound, "hostage/hos3.wav" ))     {         emit_sound(entity, channel, "misc/hostages/letsgo.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)         return FMRES_SUPERCEDE;     }     if( equal( sound, "hostage/hos3.wav" ))     {         emit_sound(entity, channel, "misc/hostages/letsgo.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)         return FMRES_SUPERCEDE;     }     if( equal( sound, "hostage/hos4.wav" ))     {         emit_sound(entity, channel, "misc/hostages/illfollow.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)         return FMRES_SUPERCEDE;     }     if( equal( sound, "hostage/hos5.wav" ))     {         emit_sound(entity, channel, "misc/hostages/youlead.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)         return FMRES_SUPERCEDE;     }         return FMRES_IGNORED; }

ch3cker 01-08-2006 08:52

i know this is old but i found it :D :D

This plugin doesnt work on my Linux Server.
When i touch a hostage it comes no Sound.

The Sounds are on the Server and on the clients computer. It comes no errors in the logs so can someone help me plz ???

Evaldas 01-08-2006 16:31

Do you have the sound files?

ch3cker 01-09-2006 09:02

yes i have
i changed the line to the sound file like this
Code:

emit_sound(entity, channel, "misc/fun/hostages/hos1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
and

Code:

precache_sound("misc/fun/hostages/hos1.wav")


All times are GMT -4. The time now is 23:53.

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