Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit c4eec18

Browse files
committed
Add Player.applyCondition
1 parent 77d85eb commit c4eec18

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
public void Message_ApplyCondition(const String:type[], const String:message[], const JSON_Object:jsondata, WebsocketHandle:websocket) {
2+
JSON_Object conditiondata = jsondata.GetObject("message")
3+
4+
int player = conditiondata.GetInt("id")
5+
int condition = conditiondata.GetInt("condition")
6+
int duration = conditiondata.GetFloat("duration")
7+
8+
if (IsClientInGame(player)) {
9+
if (duration == 0) {
10+
TF2_AddCondition(player, condition, TFCondDuration_Infinite, 0);
11+
} else {
12+
TF2_AddCondition(player, condition, duration, 0);
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)