-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUpgrades.sp
96 lines (83 loc) · 3.41 KB
/
Upgrades.sp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Copyright (C) 2024 Katsute | Licensed under CC BY-NC-SA 4.0
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <tf2>
#include <tf2_stocks>
public Plugin myinfo = {
name = "Premium Upgrades",
author = "Katsute",
description = "Premium upgrade station for MVM",
version = "1.1",
url = "https://github.com/KatsuteTF/MVM-Premium-Upgrades"
}
public void OnPluginStart(){
HookEvent("teamplay_round_start", OnStart);
}
public void OnStart(const Event event, const char[] name, const bool dontBroadcast){
Upgrades_Normal();
}
public Action OnClientSayCommand(int client, const char[] command, const char[] args){
if(strcmp(args, "!normal") == 0){
Upgrades_Normal();
}else if(strcmp(args, "!class") == 0){
Upgrades_Class(TFClassType:TF2_GetPlayerClass(client));
}else if(strcmp(args, "!premium") == 0){
Upgrades_Premium();
}else if(strcmp(args, "!support") == 0){
Upgrades_Support();
}else if(strcmp(args, "!package") == 0){
Upgrades_Package();
}
return Plugin_Continue;
}
public void SetCustomUpgradeFile(const char[] file){
SetVariantString(file);
AcceptEntityInput(FindEntityByClassname(-1, "tf_gamerules"), "SetCustomUpgradesFile");
}
public void Upgrades_Normal(){
SetCustomUpgradeFile("scripts/items/mvm_upgrades.txt");
PrintToChatAll("Changed upgrade station to %s", "Normal");
}
public void Upgrades_Premium(){
SetCustomUpgradeFile("scripts/ma_pu/mvm_pu.txt");
PrintToChatAll("Changed upgrade station to %s", "Premium");
}
public void Upgrades_Support(){
SetCustomUpgradeFile("scripts/ma_pu/mvm_pu_po.txt");
PrintToChatAll("Changed upgrade station to %s", "Support");
}
public void Upgrades_Package(){
SetCustomUpgradeFile("scripts/ma_pu/mvm_pu_pa.txt");
PrintToChatAll("Changed upgrade station to %s", "Package");
}
public void Upgrades_Class(const TFClassType class){
if(class == TFClass_Scout){
SetCustomUpgradeFile("scripts/ma_pu/mvm_pu_scout.txt");
PrintToChatAll("Changed upgrade station to %s", "Scout");
}else if(class == TFClass_Soldier){
SetCustomUpgradeFile("scripts/ma_pu/mvm_pu_soldier.txt");
PrintToChatAll("Changed upgrade station to %s", "Soldier");
}else if(class == TFClass_Pyro){
SetCustomUpgradeFile("scripts/ma_pu/mvm_pu_pyro.txt");
PrintToChatAll("Changed upgrade station to %s", "Pyro");
}else if(class == TFClass_DemoMan){
SetCustomUpgradeFile("scripts/ma_pu/mvm_pu_demoman.txt");
PrintToChatAll("Changed upgrade station to %s", "Demoman");
}else if(class == TFClass_Heavy){
SetCustomUpgradeFile("scripts/ma_pu/mvm_pu_heavy.txt");
PrintToChatAll("Changed upgrade station to %s", "Heavy");
}else if(class == TFClass_Engineer){
SetCustomUpgradeFile("scripts/ma_pu/mvm_pu_engineer.txt");
PrintToChatAll("Changed upgrade station to %s", "Engineer");
}else if(class == TFClass_Medic){
SetCustomUpgradeFile("scripts/ma_pu/mvm_pu_medic.txt");
PrintToChatAll("Changed upgrade station to %s", "Medic");
}else if(class == TFClass_Sniper){
SetCustomUpgradeFile("scripts/ma_pu/mvm_pu_sniper.txt");
PrintToChatAll("Changed upgrade station to %s", "Sniper");
}else if(class == TFClass_Spy){
SetCustomUpgradeFile("scripts/ma_pu/mvm_pu_spy.txt");
PrintToChatAll("Changed upgrade station to %s", "Spy");
}
}