How can i use a INI file and make something like this?
[tedaimlocks]
SOUND = sound/spkzm/tedaimlocks.mp3
SOUND_CMD = say /ted
[andrei]
SOUND = sound/spkzm/andrei.mp3
SOUND_CMD = say /andrei
HTML Code:
#include <amxmodx>
#include <colorchat>
#define PLUGIN "Sounds VIA Chat"
#define VERSION "1.0"
#define AUTHOR "tedaimlocks"
#define SOUND_FLAG ADMIN_RCON
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say /ted", "tedaimlocks")
register_clcmd("say /andrei", "andrei")
}
public plugin_precache() {
precache_generic("sound/spkzm/tedaimlocks.mp3")
precache_generic("sound/spkzm/andrei.mp3")
return PLUGIN_HANDLED;
}
public tedaimlocks(id) {
if(!(get_user_flags(id) & SOUND_FLAG)) {
return PLUGIN_HANDLED;
}
new szName[32];
get_user_name(id, szName, charsmax(szName));
client_cmd(0, "MP3Volume 1")
client_cmd(0, "mp3 play sound/spkzm/tedaimlocks.mp3")
ColorChat(0, GREEN, "^x01[^x04SPK ZM^x01]^x04 %s ^x03played the sound^x04 ted", szName);
return PLUGIN_HANDLED;
}
public andrei(id) {
if(!(get_user_flags(id) & SOUND_FLAG)) {
return PLUGIN_HANDLED;
}
new szName[32];
get_user_name(id, szName, charsmax(szName));
client_cmd(0, "MP3Volume 1")
client_cmd(0, "mp3 play sound/spkzm/andrei.mp3")
ColorChat(0, GREEN, "^x01[^x04SPK ZM^x01]^x04 %s ^x03played the sound^x04 andrei", szName);
return PLUGIN_HANDLED;
}