Hello, how is everybody?
Well i've finished this code and it works and compiles fine but when I bring up the first menu for the radio commands all the sounds go to the correct number, THEN when I hit Continue to go onto the next menu i'll press ONE on the next menu and it'll play the sound from the first menu instead of the second one, how come?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Custom Radio Commands"
#define VERSION "1.0"
#define AUTHOR "X-Script"
#define radio_menu (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)
#define radio_menu1 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)
new custom_radio
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /radio", "C_RADIO")
register_clcmd("say /radio1", "C_RADIO1")
register_concmd("/radio", "C_RADIO")
register_concmd("/radio1", "C_RADIO1")
register_menucmd(register_menuid("RADIO"), radio_menu, "SelectRadio")
register_menucmd(register_menuid("RADIO1"), radio_menu1, "SelectRadio1")
custom_radio = register_cvar("amx_newradio", "1")
}
public client_putinserver(id)
{
set_task(10.0, "connectmessage", id)
}
public connectmessage(id)
{
client_print(id, print_chat, "This server is running Custom Radio Commands by X-Script!")
client_print(id, print_chat, "Bind two keys to the commands: /radio and /radio1 then press the keys for the Radio Menus")
return PLUGIN_HANDLED
}
public plugin_precache()
{
precache_sound("RADIO/roger.wav")
precache_sound("RADIO/negative.wav")
precache_sound("RADIO/go.wav")
precache_sound("RADIO/followme.wav")
precache_sound("RADIO/stormfront.wav")
precache_sound("RADIO/locknload.wav")
precache_sound("RADIO/matedown.wav")
precache_sound("RADIO/com_reportin.wav")
precache_sound("RADIO/fireinhole.wav")
precache_sound("RADIO/imhit.wav")
precache_sound("RADIO/needbackup.wav")
precache_sound("RADIO/position.wav")
precache_sound("RADIO/regroup.wav")
precache_sound("RADIO/blow.wav")
precache_sound("RADIO/clear.wav")
return PLUGIN_HANDLED
}
public C_RADIO(id)
{
show_menu(id, radio_menu, "Custom Radio Menu^n^n1. Roger^n2. Negative^n3. Go^n4. Follow Me^n5. Move It^n6. Move Out^n7. Man Down^n8. Status^n9. Fire In Hole^n0. More^n^n", -1, "RADIO")
return PLUGIN_HANDLED
}
public SelectRadio(id, key)
{
/* Radio Commands:
* 1: Roger
* 2: Negative
* 3: Go
* 4: Follow Me
* 5: Move It
* 6: Move Out
* 7: Man Down
* 8: Status
* 9: Fire In Hole
* 0: More
*
*/
if ( get_pcvar_num(custom_radio) == 0 )
{
return PLUGIN_HANDLED
}
switch(key)
{
case 0:
{
client_cmd(0,"spk RADIO/roger.wav")
}
case 1:
{
client_cmd(0,"spk RADIO/negative.wav")
}
case 2:
{
client_cmd(0,"spk RADIO/go.wav")
}
case 3:
{
client_cmd(0,"spk RADIO/followme.wav")
}
case 4:
{
client_cmd(0,"spk RADIO/stormfront.wav")
}
case 5:
{
client_cmd(0,"spk RADIO/locknload.wav")
}
case 6:
{
client_cmd(0,"spk RADIO/matedown.wav")
}
case 7:
{
client_cmd(0,"spk RADIO/com_reportin.wav")
}
case 8:
{
client_cmd(0,"spk RADIO/fireinhole.wav")
}
case 9:
{
C_RADIO1(id)
}
}
return PLUGIN_HANDLED
}
public C_RADIO1(id)
{
show_menu(id, radio_menu1, "Custom Radio Menu^n^n1. Taking Fire^n2. Need Backup^n3. Cover Area^n4. Return Base^n5. Get Down^n6. Clear^n0. Exit^n^n", -1, "RADIO1")
return PLUGIN_HANDLED
}
public SelectRadio1(id, key)
{
/* Radio Commands:
* 1: Taking Fire
* 2: Need Backup
* 3: Cover Area
* 4: Return Base
* 5: Get Down
* 6: Clear
* 0: Exit
*
*
*/
if ( get_pcvar_num(custom_radio) == 0 )
{
return PLUGIN_HANDLED
}
switch(key)
{
case 0:
{
client_cmd(0,"spk RADIO/imhit.wav")
}
case 1:
{
client_cmd(0,"spk RADIO/needbackup.wav")
}
case 2:
{
client_cmd(0,"spk RADIO/position.wav")
}
case 3:
{
client_cmd(0,"spk RADIO/regroup.wav")
}
case 4:
{
client_cmd(0,"spk RADIO/blow.wav")
}
case 5:
{
client_cmd(0,"spk RADIO/clear.wav")
}
case 6:
{
}
}
return PLUGIN_HANDLED
}