Thread: sound message
View Single Post
abaskime
Junior Member
Join Date: Dec 2020
Old 01-17-2022 , 13:19   Re: sound message
Reply With Quote #3

Quote:
Originally Posted by Yusochan View Post
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cromchat>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define ADMINACCESS    ADMIN_KICK

new const g_Sound[] = "misc/yoursound.wav";

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /ctc""Sound");
    
register_clcmd("say_team /ctc""Sound");
}

public 
plugin_precache() {    
    
precache_sound(g_Sound);
}

public 
Sound(id) {
    if(
is_user_access(id)) {
        
        new 
szName[32];
        
get_user_name(idszName31);
        
CC_SendMessage(0"&x01ADMIN: &x04%s &x03Joined the game &x01!"szName);
        
client_cmd(0"spk %s"g_Sound);
    }
    else {
        
CC_SendMessage(id"&x03You don't have access to this &x04command !");
    }
}
    
bool:is_user_access(id)
    return !!(
get_user_flags(id) & ADMINACCESS
Thank you it works
Can you add a hud message in place of CC_SendMessage(0, "&x01ADMIN: &x04%s &x03Joined the game &x01!", szName);
abaskime is offline