AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Force to Download (https://forums.alliedmods.net/showthread.php?t=22916)

HuTcH 01-06-2006 20:35

Force to Download
 
Ey.
How do I play a sound on my server so everybody can hear it?
is it:
Code:
public client_cmd (0, play klaxon.wav)

And how do I force a player to downlod the sound?

thank you.

Hawk552 01-06-2006 20:49

Code:
// NOT MEANT TO BE USED, THIS IS AN EXAMPLE #include <amxmodx> #include <amxmisc> #define SOUND_LOCATION "sounds/misc/whatever.wav" public plugin_init() {     register_plugin("Play Sound","1.0","Hawk552");         register_concmd("amx_playsound","PlaySound",ADMIN_KICK," - plays sound"); } public plugin_precache() {     precache_sound(SOUND_LOCATION); } public PlaySound(id,level,cid) {     if(!cmd_access(id,level,cid,1))     {         return;     }         client_cmd(0,"play %s",SOUND_LOCATION);         // or you can use emit_sound()         return; }

SubFive 01-06-2006 20:49

Use plugin_precache.

Code:
public plugin_precache() {     precache_sound("klaxon.wav") }

Des12 01-06-2006 20:54

And forcing to download = Going into your maps folder, finding mapname.res, and adding the sound to it

syslevel2 01-06-2006 21:07

Quote:

Originally Posted by Des12
And forcing to download = Going into your maps folder, finding mapname.res, and adding the sound to it

Adding stuff to the .res file won't go over precache limit?

Hawk552 01-06-2006 21:11

Quote:

Originally Posted by Des12
And forcing to download = Going into your maps folder, finding mapname.res, and adding the sound to it

Wrong. Precaching it forces the download. Sorry.

Des12 01-06-2006 21:11

I don't think so, it might, but I think its more the plugin_precache that matters.

Xanimos 01-06-2006 21:12

Quote:

Originally Posted by Hawk552
Quote:

Originally Posted by Des12
And forcing to download = Going into your maps folder, finding mapname.res, and adding the sound to it

Wrong. Precaching it forces the download. Sorry.

Both do. but using the .res makes it only download for that map.

Hawk552 01-06-2006 21:19

I thought he was implying that you need both the plugin and a .res file.

Des12 01-06-2006 21:35

Oh nice, time to take some stuff out of my res file!


All times are GMT -4. The time now is 16:03.

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