Hey making a private plugin for someone and hit a roadblock. I'm looking to open a menu when the player dies it opens a menu with the Title "Was that a nice kill" "Yes" or "No" options. If the player selects yes it informs the killer that they have made a nice kill and no acts the same as MenuAction_End.
Here is what I have so far, willing to donate to the person who completes this task first!
PHP Code:
public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new killer = GetClientOfUserId(GetEventInt(event, "attacker"));
new victim = GetClientOfUserId(GetEventInt(event, "userid"));
GetClientName(killer, killer_name, sizeof(killer_name));
if(killer == victim)
{
return;
}
else
{
new Handle:PlayerDeathMenu = CreateMenu(PlayerDeathMenu_Handler);
SetMenuTitle(PlayerDeathMenu, "Was that a nice kill?");
AddMenuItem(PlayerDeathMenu, "1", "Yes");
AddMenuItem(PlayerDeathMenu, "2", "No");
SetMenuExitBackButton(PlayerDeathMenu, true);
DisplayMenu(PlayerDeathMenu, victim, 30);
}
return Plugin_Continue
}
public PlayerDeathMenu_Handler(Handle:menu, MenuAction:action, victim, killer)
{
switch (action)
{
case MenuAction_End:
{
CloseHandle(menu);
}
if (action == MenuAction_Select)
{
case 0:
{
CPrintToChat(killer, "{mediumorchid}[Kill Info]{default} You have made a nice kill");
}
case 1:
{
//
}
}
}
}
Hope to hear from you guys soon,
Matt