AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   loading sound custom (https://forums.alliedmods.net/showthread.php?t=60549)

vl@d 09-06-2007 17:33

loading sound custom
 
I dont understand why this plugin does not work :|
Code:


new sound[] = {"hl_loading"}

public plugin_init(){
    //bla, bla
}

public client_connect(id){

    client_cmd(id,"mp3 play hl/%s",sound)

}

public plugin_precache(){

precache_sound("hl/hl_loading.mp3")
}

The sound directory is cstrike/sound/hl and the sound is hl_loading.mp3
Any Ideas?

ConnorMcLeod 09-06-2007 17:55

Re: loading sound custom
 
client_cmd(id,"mp3 play sound/hl/%s",sound)

Arkshine 09-06-2007 18:22

Re: loading sound custom
 
Code:
    new const sound[] = "sound/hl/hl_loading.mp3";     public plugin_init()     {         // bla, bla     }     public client_connect( id )     {         client_cmd( id, "mp3 play %s", sound );     }     public plugin_precache()     {         precache_generic( sound );     }

vl@d 09-07-2007 05:51

Re: loading sound custom
 
thx arkshine & connorr

ConnorMcLeod 09-07-2007 10:44

Re: loading sound custom
 
Yes you'll have errors if you use precache_sound with a mp3, so arkshine is right for that.
But only reason your code didn't work is because you didn't put sound/ in the path.

vl@d 09-08-2007 04:20

Re: loading sound custom
 
btw what is the difference between new sound and new const sound ?


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

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