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

Adding command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cirovic
Senior Member
Join Date: Sep 2019
Old 04-19-2021 , 11:11   Adding command
Reply With Quote #1

Can someone add /musicoff in this plugin, so when you type that command, u wont hear music, even after map change. With this plugin you can play sound for online players.




#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <fakemeta>
#include <engine>
#include <colorchat>

new name[33]

public plugin_init()
{
register_plugin("Muzika Plugin", "4.0", "Toni_Kroos#8" );
register_clcmd("amx_muzika", "muzika_menu");
}

public plugin_precache()
{
precache_sound("tpezaske.mp3")
}

public muzika_menu(id)
{
if ( ( get_user_flags(id) & ADMIN_RCON))
{
new menu = menu_create("[FUSION - Deathrun]:^nIzaberi pesmu:", "muzika_biraj")
menu_additem(menu, "Tpe za ske")
menu_additem(menu, "Stopiraj")

menu_display(id, menu)
}
else
{
ColorChat(id, TEAM_COLOR, "^4[FUSION - Deathrun] ^1You are not admin, type /store");
}
}
//return PLUGIN_HANDLED

public muzika_biraj(id, menu, item)
{
switch(item)
{
case MENU_EXIT:
{
menu_destroy(menu)
}

case 0:
{
client_cmd(0, "mp3 play sound/tpezaske.mp3")
muzika_menu(id)
get_user_name(id, name, 31)
ColorChat(0, TEAM_COLOR, "^4[FUSION - Deathrun] ^3Admin ^4%s ^3played song: ^4Tpe za ske.", name)
}
}
}
Cirovic is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 04-19-2021 , 16:48   Re: Adding command
Reply With Quote #2

Copy and paste the part in italics. Rename command to /musicoff. Most users I would like to think if they are that peeved by MP3 they could bind a key on their own.
bind ?? "mp3 stop"


#include amxmodx
#include fakemeta

public plugin_init()

register_plugin("MP3 stopper", "1.0", "SPiNX") && register_forward(FM_CmdStart, "CmdStart") &&
register_clcmd("say .mp3","@speech", 0, "-Hold TAB to stop mp3");

@speech(id)client_cmd(id, "mp3 stop");


public CmdStart(id, uc_handle, seed)
if (is_user_connected(id)
&& (get_uc(uc_handle, UC_Buttons) & IN_SCORE)
&& (pev(id, pev_oldbuttons) & IN_SCORE))
client_cmd(id, "mp3 stop") && @speech(id);
__________________

Last edited by DJEarthQuake; 04-19-2021 at 17:32. Reason: CRUCIAL EDIT...Cbuf_AddTextToBuffer: overflow via client_print(id, print_center,"Ahoy!");
DJEarthQuake is offline
Cirovic
Senior Member
Join Date: Sep 2019
Old 04-20-2021 , 07:38   Re: Adding command
Reply With Quote #3

that was not my request.
Cirovic is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 04-20-2021 , 08:32   Re: Adding command
Reply With Quote #4

Replace "say .mp3" with "/musicoff". 2 lines. I trust you to add these 2 lines. If this is not what you wanted then please clarify.


public plugin_init()

{

register_plugin("Muzika Plugin", "4.0a", "Toni_Kroos#8" );
register_clcmd("amx_muzika", "muzika_menu");
register_clcmd("/musicoff","@addingcmd");
}

@addingcmd(id)client_cmd(id, "mp3 stop");
__________________

Last edited by DJEarthQuake; 04-20-2021 at 12:43. Reason: coffee
DJEarthQuake is offline
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 10:10.


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