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; i <= MaxClients; i++) {
if (IsClientInGame(i)) {
OnClientPutInServer(i);
}
}
}
public void OnClientPutInServer(int client) {
SDKHook(client, SDKHook_PostThinkPost, OnClientPostThinkPost);
}
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(client, 42, 1.0, client);
}
}