PHP Code:
#include < amxmodx >
#define PLUGIN "Vivo ou Morto JailBreak"
#define VERSION "1.0"
#define AUTHOR "Viictor #"
new szSoundM[] = { "misc/morto.wav" } // remove sound/ from path unless sound is located in cstrike/sound/sound/...
new szSoundV[] = { "misc/vivo.wav" }
new bool:g_bCmdHasBeenUsed
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /brincadeiras", "ClCmd_FunnyTask")
}
public plugin_precache()
{
precache_sound(szSoundM)
precache_sound(szSoundV)
}
public ClCmd_FunnyTask( id )
{
if( g_bCmdHasBeenUsed )
{
client_print(id, print_chat, "Outra pessoa ja esta usando o menu de brincadeiras")
return PLUGIN_HANDLED
}
g_bCmdHasBeenUsed = true
new menu = menu_create("\yVivo ou Morto!\r By Viictor#:", "hVivoMortoMenuHandled")
menu_additem(menu, "\yVivo!")
menu_additem(menu, "\yMorto!")
menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER)
menu_display(id, menu, 0)
return PLUGIN_CONTINUE
}
public hVivoMortoMenuHandled(id, menu, item)
{
switch( item ) // MENU_EXIT implied there, also MEXIT_NEVER is set so there is no exit option
{
case 0:
{
client_cmd(0, "spk %s", szSoundV)
set_hudmessage(0, 255, 0, 0.48, 0.36, 0, 6.0, 3.0,_,_,-1)
show_hudmessage(0, "VIVO!")
}
case 1:
{
client_cmd(0, "spk %s", szSoundM)
set_hudmessage(0, 255, 0, 0.48, 0.36, 0, 6.0, 3.0,_,_,-1)
show_hudmessage(0, "MORTO!")
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
__________________