forked from Pelipoika/The-unfinished-and-abandoned
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlayerTauntSoundLoopStart.sp
43 lines (35 loc) · 1.03 KB
/
PlayerTauntSoundLoopStart.sp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <sdktools>
#include <sdkhooks>
#pragma newdecls required
public Plugin myinfo =
{
name = "[TF2] PlayerTauntSoundLoopStart",
author = "Pelipoika",
description = "",
version = "1.0",
url = "http://www.sourcemod.net/plugins.php?author=Pelipoika&search=1"
};
public void OnPluginStart()
{
HookUserMessage(GetUserMessageId("PlayerTauntSoundLoopStart"), HookTauntMessage, true);
}
public Action HookTauntMessage(UserMsg msg_id, BfRead msg, const int[] players, int playersNum, bool reliable, bool init)
{
int byte = msg.ReadByte();
char string[PLATFORM_MAX_PATH];
msg.ReadString(string, PLATFORM_MAX_PATH);
PrintToServer("%i %s", byte, string);
if (StrEqual(string, "music.conga_loop"))
{
RequestFrame(ReSendWithNewSound, byte);
return Plugin_Handled;
}
return Plugin_Continue;
}
public void ReSendWithNewSound(int byte)
{
Handle message = StartMessageAll("PlayerTauntSoundLoopStart");
BfWriteByte(message, byte);
BfWriteString(message, "music.aerobic_loop");
EndMessage();
}