Update FTT

This commit is contained in:
Jackzie 2021-11-09 10:25:34 -06:00
parent 956df81ba8
commit ca2831ec53
No known key found for this signature in database
GPG key ID: 1E834FE36520537A
10 changed files with 271 additions and 127 deletions

View file

@ -53,16 +53,18 @@ bool ToggleMarkPlayer(int client, int target) {
}
}
stock int FindIdlePlayerBot(int client) {
for(int i = 1; i <= MaxClients; i++) {
if(IsClientConnected(i) && IsFakeClient(i)) {
int user = GetEntProp(i, Prop_Send, "m_humanSpectatorUserID");
int bot = GetClientOfUserId(user);
return bot > 0 ? bot : client;
}
// Finds the survivor bot that took over an idle player
int GetSpectatorClient(int bot) {
if(!IsFakeClient(bot)) return -1;
static char netclass[16];
GetEntityNetClass(bot, netclass, sizeof(netclass));
if(strcmp(netclass, "SurvivorBot") == 0 ) {
int user = GetEntProp(bot, Prop_Send, "m_humanSpectatorUserID");
if(user > 0) return GetClientOfUserId(user);
}
return client;
return -1;
}
stock bool IsPlayerIncapped(int client) {
return GetEntProp(client, Prop_Send, "m_isIncapacitated") == 1;
}
@ -237,15 +239,4 @@ void DropItem(int victim, int slot) {
if(slot != 1 || DoesClientHaveMelee(victim)) {
SDKHooks_DropWeapon(victim, wpn, NULL_VECTOR);
}
}
int GetSpectatorClient(int bot) {
if(!IsFakeClient(bot)) return -1;
static char netclass[16];
GetEntityNetClass(bot, netclass, sizeof(netclass));
if(strcmp(netclass, "SurvivorBot") == 0 ) {
int user = GetEntProp(bot, Prop_Send, "m_humanSpectatorUserID");
if(user > 0) return GetClientOfUserId(user);
}
return -1;
}