View Single Post
Author Message
possibly_yaboi_mark
Junior Member
Join Date: Jul 2022
Old 10-29-2022 , 14:20   [tf2] need to grant a condition to capping players
Reply With Quote #1

i need to grant a condition to capping players, specifically through an sdkhook of the clients thinking. if "sdk of the clients thinking" is a bit too vauge, which i'll admit it probably is, i have a script below for elaborating on what i mean.

PHP Code:
#pragma semicolon 1
#include <sourcemod>

#include <tf2>
#include <sdkhooks>

#pragma newdecls required

public void OnMapStart() {
    for (
int i 1<= MaxClientsi++) {
        if (
IsClientInGame(i)) {
            
OnClientPutInServer(i);
        }
    }
}

public 
void OnClientPutInServer(int client) {
    
SDKHook(clientSDKHook_PostThinkPostOnClientPostThinkPost);
}

void OnClientPostThinkPost(int client) {
    if (
INSERT CHECK FOR WHETHER THE CLIENT IS CAPPING HERE) { //the check for whether the client is capping would go here
        
TF2_AddCondition(client421.0client);
    }

possibly_yaboi_mark is offline