попробуй так
Код
#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <hamsandwich>
#define VERSION "0.1"
new g_MaxClients;
new victim;
public plugin_init()
{
register_plugin("Kill Menu", VERSION, "Byv@liy");
register_event("DeathMsg", "event_death", "a");
g_MaxClients = get_maxplayers()
}
public event_death()
{
new killer = read_data(1);
new victim = read_data(2);
if ( !( 1 <= killer <= g_MaxClients ) || killer == victim )
{
return PLUGIN_CONTINUE;
}
new vicname[32], killname[32]
get_user_name(victim,vicname,31);
get_user_name(killer,killname,31);
new menu=menu_create("\rПричина убийства:","menu_handler")
menu_additem(menu,"\wНе выполнил приказ","1")
menu_additem(menu,"\wПроиграл в игру","2")
menu_additem(menu,"\wАтаковал надзирателей","3")
menu_additem(menu,"\wАФК","4")
menu_additem(menu,"\wДругое","5")
menu_setprop(menu,MPROP_EXIT,MEXIT_ALL)
menu_display(killer,menu,0)
return PLUGIN_HANDLED
}
public menu_handler(killer,menu,item)
{
if(item==MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6],iName[64],access, callback
menu_item_getinfo(menu,item,access,data,5,iName,63,callback)
new key = str_to_num(data)
switch(key) {
case 1:{
client_printcolor(0, "/g[Тюрьма] /yИгрок %s убит за невыполнение приказа!", victim)
}
case 2:{
client_printcolor(0, "/g[Тюрьма] /yИгрок %s убит за приогрыш в игре!", victim)
}
case 3:{
client_printcolor(0, "/g[Тюрьма] /yИгрок %s убит за атаку надзирателей!", victim)
}
case 4:{
client_printcolor(0, "/g[Тюрьма] /yИгрок %s убит за АФК!", victim)
}
case 5:{
client_printcolor(0, "/g[Тюрьма] /yИгрок %s убит за неизвестную причину!", victim)
}
}
return PLUGIN_HANDLED
}stock client_printcolor ( const id, const input[], any:... )
{
new iCount = 1, iPlayers[32]
new sNewMsg[191]
vformat( sNewMsg, charsmax ( sNewMsg ), input, 3 )
//format ( sNewMsg, charsmax ( sNewMsg ), "^4[x^1 %s", sNewMsg )
replace_all ( sNewMsg, charsmax ( sNewMsg ), "/g", "^4") // green txt
replace_all ( sNewMsg, charsmax ( sNewMsg ), "/y", "^1") // orange txt
replace_all ( sNewMsg, charsmax ( sNewMsg ), "/t", "^3") // team txt
if ( id )
iPlayers[0] = id
else
get_players ( iPlayers, iCount, "ch" )
for ( new i; i < iCount; i++ )
{
if ( is_user_connected ( iPlayers[i] ) )
{
message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "SayText" ), _, iPlayers[i] )
write_byte ( iPlayers[i])
write_string ( sNewMsg)
message_end ()
}
}
}