This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Adding a INI file


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
tedaimlocks
Senior Member
Join Date: Jan 2024
Old 04-18-2024 , 11:58   Adding a INI file
Reply With Quote #1

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;
}
tedaimlocks 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 20:36.


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