Raised This Month: $ Target: $400
 0% 

[HELP] adding sounds when buying


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
omega88
Junior Member
Join Date: Dec 2008
Old 01-20-2009 , 04:15   [HELP] adding sounds when buying
Reply With Quote #1

Anyone knows how to add sounds whenever a person buys a certain item ?
omega88 is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 01-20-2009 , 11:41   Re: [HELP] adding sounds when buying
Reply With Quote #2

oh yea it's possible...
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
Speed!
BANNED
Join Date: Jan 2009
Old 01-20-2009 , 16:29   Re: [HELP] adding sounds when buying
Reply With Quote #3

there are many ways
the easy way:
client_cmd(id, "spk folder/file.mp3")

if u r using customs sounds, remember to precache
Speed! is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 01-21-2009 , 03:03   Re: [HELP] adding sounds when buying
Reply With Quote #4

Quote:
Originally Posted by Speed! View Post
if u r using customs sounds, remember to precache
You must do it even with already included sounds... not just with custom.
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
Mlk27
Veteran Member
Join Date: May 2008
Old 01-21-2009 , 06:52   Re: [HELP] adding sounds when buying
Reply With Quote #5

it's something like this..

Code:
public plugin_precache()
{
	precache_sound("path/to/sound/file.wav") // in sound folder
}

public zp_extra_item_selected(player, itemid)
{
	if(itemid == g_itemid_example)
	{
		// ..
		client_cmd(player, "speak path/to/sound/file.wav")
	}
}
Mlk27 is offline
omega88
Junior Member
Join Date: Dec 2008
Old 01-21-2009 , 09:01   Re: [HELP] adding sounds when buying
Reply With Quote #6

I still can't seem to add the sound , am I doing it right ? Because this is my first time doing this ...

Code:
}

public plugin_precache()
{
    precache_sound("ambience/the_horror3.wav") // in sound folder
}

public zp_item(player, itemid)
{
    if(itemid == g_fumado)
    {
        // ..
        client_cmd(player, "ambience/the_horror3.wav")
    }
}
omega88 is offline
Mlk27
Veteran Member
Join Date: May 2008
Old 01-21-2009 , 09:11   Re: [HELP] adding sounds when buying
Reply With Quote #7

client_cmd(player, "ambience/the_horror3.wav")

->

client_cmd(player, "speak ambience/the_horror3.wav")
Mlk27 is offline
Speed!
BANNED
Join Date: Jan 2009
Old 01-21-2009 , 13:02   Re: [HELP] adding sounds when buying
Reply With Quote #8

Quote:
Originally Posted by Fry! View Post
You must do it even with already included sounds... not just with custom.
not at all, if the server already precache it, its done. ie: radio commnds sounds
Speed! is offline
MeRcyLeZZ
Veteran Member
Join Date: Dec 2007
Old 01-28-2009 , 14:39   Re: [HELP] adding sounds when buying
Reply With Quote #9

I'd recommend using emit_sound() and let the engine handle it.

client_cmd() should be used for reliable stuff only.
__________________
MeRcyLeZZ is offline
Speed!
BANNED
Join Date: Jan 2009
Old 01-28-2009 , 14:41   Re: [HELP] adding sounds when buying
Reply With Quote #10

yes
engfunc(EngFunc_EmitSound.... rlz but it was harder to explain on a forum
Speed! is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:29.


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