From d99b93d29e6f5ab140a4bb72480bbbe03ea60ebb Mon Sep 17 00:00:00 2001 From: zaCade Date: Mon, 28 Nov 2022 11:42:09 +0100 Subject: [PATCH] Leader2: Change to PlayerCmd: impulse201 --- Leader2/scripting/Leader2.sp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Leader2/scripting/Leader2.sp b/Leader2/scripting/Leader2.sp index 1fda948d..cfe35be8 100644 --- a/Leader2/scripting/Leader2.sp +++ b/Leader2/scripting/Leader2.sp @@ -63,8 +63,6 @@ public void OnPluginStart() LoadTranslations("common.phrases"); LoadTranslations("core.phrases"); - AddTempEntHook("Player Decal", HookDecal); - HookEvent("round_end", Event_RoundEnd); HookEvent("player_death", Event_PlayerDeath); //AddCommandListener(HookPlayerChat, "say"); @@ -653,16 +651,17 @@ public Action ManualPingMenu(int client, int args) //---------------------------------------------------------------------------------------------------- // Purpose: //---------------------------------------------------------------------------------------------------- -public Action HookDecal(const char[] sTEName, const int[] iClients, int iNumClients, float fSendDelay) +public Action OnPlayerRunCmd(int client, int& buttons, int& impulse, float vel[3], float angles[3], int& weapon, int& subtype, int& cmdnum, int& tickcount, int& seed, int mouse[2]) { - int client = TE_ReadNum("m_nPlayer"); - if(client == leaderClient) { - RemovePing3(); - pingEntity3 = SpawnPing(client, 0); - pingActive[3] = true; - PrintToChat(client, "[SM] 'Star' Ping (re)placed."); + if(impulse == 201) //Player spray + { + RemovePing3(); + pingEntity3 = SpawnPing(client, 0); + pingActive[3] = true; + PrintToChat(client, "[SM] 'Star' Ping (re)placed."); + } } return Plugin_Continue;