TF2_SetPlayerClass Function

Sets a client's class.

Note: If setting player class in a player spawn hook weapons should be set to false.

void TF2_SetPlayerClass(int client, TFClassType classType, bool weapons, bool persistent)

Parameters

int client

Player's index.

TFClassType classType

TFClassType class symbol.

bool weapons

This parameter is ignored.

bool persistent

If true, changes the player's desired class so the change stays after death.

Errors

Invalid client index.