Skip to content
Permalink
Browse files

Reset roundslays on forgive rdm

  • Loading branch information...
Bara committed Jul 2, 2019
1 parent 97fae82 commit e17579401c0f69ae121b99aae74ef1a37e6f6450
Showing with 22 additions and 2 deletions.
  1. +5 −0 addons/sourcemod/scripting/ghostdm.sp
  2. +17 −2 addons/sourcemod/scripting/ttt/ttt.sp
@@ -327,6 +327,11 @@ public Action Timer_Respawn(Handle timer, int userid)

public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon)
{
if (!g_cEnable.BoolValue)
{
return Plugin_Continue;
}

if(g_bRedie[client])
{
if (buttons & IN_ATTACK)
@@ -3860,14 +3860,14 @@ void manageRDM(int client)
Format(sForgive, sizeof(sForgive), "%T", "Forgive", client);
Format(sPunish, sizeof(sPunish), "%T", "Punish", client);

Menu menu = new Menu(manageRDMHandle);
Menu menu = new Menu(Menu_RDM);
menu.SetTitle(display);
menu.AddItem("Forgive", sForgive);
menu.AddItem("Punish", sPunish);
menu.Display(client, 10);
}

public int manageRDMHandle(Menu menu, MenuAction action, int client, int option)
public int Menu_RDM(Menu menu, MenuAction action, int client, int option)
{
if (!TTT_IsClientValid(client))
{
@@ -3888,29 +3888,44 @@ public int manageRDMHandle(Menu menu, MenuAction action, int client, int option)
{
CPrintToChat(client, "%s %T", g_sTag, "Choose Forgive Victim", client, iAttacker);
CPrintToChat(iAttacker, "%s %T", g_sTag, "Choose Forgive Attacker", iAttacker, client);

TTT_SetRoundSlays(iAttacker, 0, true);

g_iRDMAttacker[client] = -1;
}
if (StrEqual(info, "Punish", false))
{
LoopValidClients(i)
{
CPrintToChat(i, "%s %T", g_sTag, "Choose Punish", i, client, iAttacker);
}

TTT_AddRoundSlays(iAttacker, g_cRoundSlayPlayerRDM.IntValue, true);

TTT_SetRoundSlays(iAttacker, 0, true);

g_iRDMAttacker[client] = -1;
}
}
else if (action == MenuAction_Cancel)
{
CPrintToChat(client, "%s %T", g_sTag, "Choose Forgive Victim", client, iAttacker);
CPrintToChat(iAttacker, "%s %T", g_sTag, "Choose Forgive Attacker", iAttacker, client);

g_iRDMAttacker[client] = -1;

TTT_SetRoundSlays(iAttacker, 0, true);
}
else if (action == MenuAction_End)
{
delete menu;
CPrintToChat(client, "%s %T", g_sTag, "Choose Forgive Victim", client, iAttacker);
CPrintToChat(iAttacker, "%s %T", g_sTag, "Choose Forgive Attacker", iAttacker, client);

g_iRDMAttacker[client] = -1;

TTT_SetRoundSlays(iAttacker, 0, true);

delete menu;
}
}

0 comments on commit e175794

Please sign in to comment.
You can’t perform that action at this time.