forked from bklol/Misc-Plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kid-thirdperson.sp
66 lines (57 loc) · 1.24 KB
/
kid-thirdperson.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <sourcemod>
#include <sdktools_functions>
#include <shavit>
#pragma newdecls required
#pragma semicolon 1
bool gB_ThirdPerson[MAXPLAYERS + 1];
bool gB_Ignore[MAXPLAYERS + 1];
public Plugin myinfo =
{
name = "Thirdperson",
author = "KiD Fearless",
description = "https://steamcommunity.com/id/kidfearless/",
version = "",
url = "www.joinsg.net"
}
public void OnPluginStart()
{
HookEvent("player_jump", Event_PlayerJump);
}
public void Event_PlayerJump(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
if(!gB_Ignore[client])
{
if(gB_ThirdPerson[client] == true)
{
ClientCommand(client, "thirdperson");
}
else
{
ClientCommand(client, "firstperson");
}
}
}
public void Shavit_OnStyleChanged(int client, int oldstyle, int newstyle)
{
char sSpecial[128];
Shavit_GetStyleStrings(newstyle, sSpecialString, sSpecial, 128);
if(StrContains(sSpecial, "thirdperson", false) == -1)
{
gB_ThirdPerson[client] = false;
ClientCommand(client, "firstperson");
}
else
{
gB_ThirdPerson[client] = true;
ClientCommand(client, "thirdperson");
}
if(StrContains(sSpecial, "tas", false) != -1)
{
gB_Ignore[client] = true;
}
else
{
gB_Ignore[client] = false;
}
}