Raised This Month: $ Target: $400
 0% 

why doesn't the sound play?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Watermelonnable
Member
Join Date: Feb 2017
Old 01-16-2020 , 19:10   why doesn't the sound play?
Reply With Quote #1

Hello! I'm trying to play a sound in a plugin. Literally just copied and pasted another of my working snippets and it doesn't do anything. This is what I did:

PHP Code:
new const g_szSound[1][FILELENGHT];

public 
plugin_precache()
{
    
amx_load_setting_string(SETTINGSFILE"Invisibility Cloak""SOUND"g_szSound[0], charsmax(g_szSound[]));
    
precache_sound(g_szSound[0]);
}

public 
plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
    
register_concmd("invisound""PlaySound"ADMIN_SLAY);
}

public 
PlaySound(id)
{
    
emit_sound(idCHAN_BODYg_szSound[0], 1.0ATTN_NORM0PITCH_NORM);

Suggestions? The sound is 2 seconds length and it's a wav converted from mp3

Last edited by Watermelonnable; 01-16-2020 at 19:11.
Watermelonnable is offline
 



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 18:03.


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