Raised This Month: $51 Target: $400
 12% 

[Help] Voice Player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 04-26-2020 , 14:56   [Help] Voice Player
Reply With Quote #1

Hello !. i need help to make a voice player . I Know how to play a voice in a plugin but i dont know places and downloading voices .
For the example i make a slash command to voice
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <colorchat>

#define PLUGIN    "slash commands"
#define VERSION    "0.1"
#define AUTHOR    "Thew_ConFiger"
#define ACCESS ADMIN_CVAR

new g_pCvarchname
new g_pCvarNoSay
new block

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_pCvarchname register_cvar("sv_noname""0")
    
register_forward(FM_ClientUserInfoChanged"ClientUserInfoChanged")
    

    
    
register_clcmd("say /anon1","anon",ACCESS)

public 
anon(idlevelcid

    if(
cmd_access(id,levelcid1)) 
    { 
        new 
name[32
        
get_user_info(id"name"name31)
                
ColorChat(0GREEN,"*** Server Will Be Reset For Mistakes ***"); 
        
ColorChat(0GREEN,"*** Server Will Be Reset For Mistakes  ***"); 
        
ColorChat(0GREEN,"*** Server Will Be Reset For Mistakes  ***"); 
        
ColorChat(0GREEN,"*** Server Will Be Reset For Mistakes  ***"); 
    
client_cmd(0"spk ^"vox/bizwarn coded user apprehend^"")
    } 
    return 
PLUGIN_HANDLED 

i was see "spk ^"vox/bizwarn coded user apprehend^"" in quit plugin and i use it . it working but i want to know better .

for example i have a voice is name "Voice1" and i want to add on server , players download it and i use a slash like "/Avc" for play this voice
what to replace "spk ^"vox/bizwarn coded user apprehend^"" and how enable downloading this voice ??
Mikaeel123 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-26-2020 , 15:03   Re: [Help] Voice Player
Reply With Quote #2

If you want files to be downloaded, you have to have the plugin precache them. Look at the code that already does this to see how it's done.
__________________
fysiks is offline
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 04-26-2020 , 15:12   Re: [Help] Voice Player
Reply With Quote #3

its have download code ??
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <colorchat>

#define PLUGIN "[QUIT] ADMIN CMD"
#define VERSION "1.0"
#define AUTHOR "Mr.TaLaL"

#define ADMIN_ACCESS    ADMIN_IMMUNITY


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_concmd("amx_quit""cmd_quit"ADMIN_ACCESS"<nick> - shut down player's counter-strike" )
}

public 
cmd_quit(idlevelcid)
{
    if (!
cmd_access(idlevelcid2))
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
arg[32]
    
    
read_argv(1arg31)
    
    new 
player cmd_target(idargCMDTARGET_OBEY_IMMUNITY CMDTARGET_ALLOW_SELF CMDTARGET_ONLY_ALIVE)
    
    if (!
player)
    {
        return 
PLUGIN_HANDLED
    
}
    
    
client_cmd(0"spk ^"vox/bizwarn coded user apprehend^"")
    
client_cmd(player,"quit")
    
    new 
name[32], name2[32]
    
    
get_user_name(playername231)
    
get_user_name(idname31)
    
    
ColorChat(0GREEN"^4[QUIT]^1 ADMIN ^3%s ^1shut down ^3%s^1's Counter-Strike!"namename2)
    
    return 
PLUGIN_HANDLED

Mikaeel123 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-26-2020 , 19:40   Re: [Help] Voice Player
Reply With Quote #4

Do you see the word "precache" in there? Search for precache_sound(). Or since built-in plugins already do this, you can look at them (in GitHub).
__________________
fysiks is offline
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 04-27-2020 , 01:07   Re: [Help] Voice Player
Reply With Quote #5

And what do i do for play ??
i paste the "Voice1" In Cstrike/sound/A/Voice1 For Download
now what do i do for play ?
Spk ...............
Mikaeel123 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-27-2020 , 08:43   Re: [Help] Voice Player
Reply With Quote #6

The same you did for the other sounds?

Code:
client_cmd(0, "spk ^"sound/A/Voice1.wav^"")
__________________

Last edited by OciXCrom; 04-27-2020 at 08:44.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 04-27-2020 , 12:19   Re: [Help] Voice Player
Reply With Quote #7

Its dont work . its download the voice but dont play
Precache Plugins :
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
#define ANON1    "ASound/Anon1.wav"
#define ANON2    "ASound/Anon2.wav"
#define ANON3    "ASound/Anon3.wav"

public plugin_precache()
{
    
    
precache_soundANON1 );
    
precache_soundANON2 );
    
precache_soundANON3 );

Main plugin :
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <colorchat>

#define PLUGIN    "Anon"
#define VERSION    "1"
#define AUTHOR    "Thew_ConFIger"
#define ACCESS ADMIN_CVAR

new g_pCvarchname
new g_pCvarNoSay
new block

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_pCvarchname register_cvar("sv_noname""0")
    
register_forward(FM_ClientUserInfoChanged"ClientUserInfoChanged")
    

    
    
register_clcmd("say /anon1","anon",ACCESS)
    
register_clcmd("say /anon2","anon2",ACCESS)
    
register_clcmd("say /anon3","anon3",ACCESS)

public 
anon(idlevelcid

    if(
cmd_access(id,levelcid1)) 
    { 
        new 
name[32
        
get_user_info(id"name"name31)
                
ColorChat(0GREEN,"*** Server Braye Tamirate Dakheli Resetart Mishavard ***"); 
        
ColorChat(0GREEN,"*** Server Braye Tamirate Dakheli Resetart Mishavard ***"); 
        
ColorChat(0GREEN,"*** Server Braye Tamirate Dakheli Resetart Mishavard  ***"); 
        
ColorChat(0GREEN,"*** Server Braye Tamirate Dakheli Resetart Mishavard  ***"); 
    
client_cmd(0"spk ^"sound/ASound/Anon1.wav^"")
    } 
    return 
PLUGIN_HANDLED 
}
public 
anon2(idlevelcid

    if(
cmd_access(id,levelcid1)) 
    { 
        new 
name[32
        
get_user_info(id"name"name31)
                
ColorChat(0RED,"*** Server Braye Tamirate Dakheli 5 Dagige Az Dasres Kharej Mishavad ***"); 
        
ColorChat(0RED,"*** Server Braye Tamirate Dakheli 5 Dagige Az Dasres Kharej Mishavad  ***"); 
        
ColorChat(0RED,"*** Server Braye Tamirate Dakheli 5 Dagige Az Dasres Kharej Mishavad  ***"); 
        
ColorChat(0RED,"*** Server Braye Tamirate Dakheli 5 Dagige Az Dasres Kharej Mishavad  ***"); 
    
client_cmd(0"spk ^"sound/ASound/Anon2.wav^"")
    } 
    return 
PLUGIN_HANDLED 
}
public 
anon3(idlevelcid

    if(
cmd_access(id,levelcid1)) 
    { 
        new 
name[32
        
get_user_info(id"name"name31)
                
ColorChat(0BLUE,"*** Server Braye Tamirate Dakheli Change Map Mishavad ***"); 
        
ColorChat(0BLUE,"*** Server Braye Tamirate Dakheli Change Map Mishavad  ***"); 
        
ColorChat(0BLUE,"*** Server Braye Tamirate Dakheli Change Map Mishavad  ***"); 
        
ColorChat(0BLUE,"*** Server Braye Tamirate Dakheli Change Map Mishavad  ***"); 
    
client_cmd(0"spk ^"sound/ASound/Anon3.wav^"")
    } 
    return 
PLUGIN_HANDLED 

Whats my mistake ?
Mikaeel123 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-27-2020 , 13:40   Re: [Help] Voice Player
Reply With Quote #8

#define ANON1 "ASound/Anon1.wav"
client_cmd(0, "spk ^"sound/ASound/Anon3.wav^"")

You use the "sound/" folder when precaching, not when playing.
__________________

Last edited by OciXCrom; 04-27-2020 at 13:40.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-27-2020 , 19:01   Re: [Help] Voice Player
Reply With Quote #9

Also, i know that wav files need specific settings in order to be able to played in cs 1.6.

Quote:
Originally Posted by redivcram View Post
In goldsource, sound files only work properly in mono and 22050kHz of sampling rate.
Also check this: https://forums.alliedmods.net/showthread.php?t=297597
and this: https://forums.alliedmods.net/showth...=147122&page=2

Quote:
Originally Posted by GXLZPGX View Post
MyDoom, you obviously don't know whats wrong. CS:S (as far as I know) players wav files in different formats, and higher quality thats for sure. Get a wav file converter, or an mp3 converter, and change the settings of the .wav to mono stereo and I believe.. 22050 Hz
Otherwise, it won't play in CS1.6
__________________

Last edited by Napoleon_be; 04-27-2020 at 19:06.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 20:20.


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