-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtklib.inc
More file actions
154 lines (134 loc) · 7.21 KB
/
tklib.inc
File metadata and controls
154 lines (134 loc) · 7.21 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*****************************************\
* Tk Libraries (Tklib) *
* *
* Made by Tk /id/Teamkiller324 *
\*****************************************/
//Changelogs
// > Version 1.1.0
// + Fixed Set weapon ammo being only at 0.
// + Updated the code lines to be not filled with tab spaces.
// + Added numerous new set/change functions.
// + Added checks to return error if the client is invalid.
// > Version 1.1.1
// + Added Day of Defeat: Source
// + Added TFFlag event type support (Events related to example picking up, defending, capturing and dropping intelligence in tf2.)
// + Updated some enum structures to better match the existing ones.
// > Version 1.1.2
// + Added Return/Set client lifestate function. (1 = Dead, 0 = Alive)
// + Added TFFlag_Carrier to TFFlag enum structure.
// + Few other changes on some functions.
// > Version 1.2.0
// + Updated name to Tk Libraries from Tk Include.
// + More stuff added in /additionals subinclude.
// + Added CSGORank enum, making it easier to handle ranks.
// + Added CSGO_SetWeaponSkin and CSGO_GetWeaponSkin to get or set the clients current skin of their weapon.
// + Added CSGO_SetWeaponStatTrak and CSGO_SetWeaponStatTrak to get or set clients current stattrak of their weapon.
// + Added CSGO_SetWeaponOwner to set the owner of the weapon as the client specified.
// + Added CSGO_SetWeaponQuality to set the quality of the weapon. By default (3) adds a star to the weapon name.
// + Added CSGO_SetWeaponNametag and CSGO_GetWeaponNametag to set or get the clients current name of their weapon.
// + Added CSGO_SetCompetitiveOffset and CSGO_GetCompetitiveOffset to set or get the clients competitive offsets. Useful for the plugins that sets custom ranks.
// + Added CSGO_SetCompetitiveType and CSGO_GetCompetitiveType to set or get the clients competitive types. Also useful for the plugins that sets custom ranks.
// + Added CSGO_SetArmModel to be easier to set the model of the players arm.
// + Added EquipPlayerWeaponEx as alternative option to EquipPlayerWeapon. Fixes issues regarding EquipPlayerWeapon when it comes to spawning weapons. (Credit to bacardi for part of the code.)
// + Added GetEntityName to return the entitys name.
// + Added SetEntityName to set the entitys name.
// + Added FindEntity to return true or false wheter the entity by classname exists in the current map.
// + Added CreateEntityByNameEx which does same functionality as CreateEntityByName but it has additional string to put in the entitys custom name you specify.
// + Added SetEntityDisabled if the entity you target should start disabled or not as a boolean. true/false statement.
// + Added GetEntityModel as easier method to return the model of the entity.
// + Added GetClientAuth which is same as GetClientAuthId but it functions similiarly to GetClientAuthString.
// > Version 1.2.1
// + Updated L4DTeam enum L4DTeam_Zombie to L4DTeam_Infected
// > Version 1.2.2
// + Updated TF_GetPlayerWeaponSlot to TF2_GetPlayerWeaponSlot.
// + Added TFSlot_Invalid.
// + Added SetWeaponDefinitionIndex
// > Version 1.3.0
// + Loads of changes and new functions.
// + Integrated Game Identifier.
// > Version 1.3.1
// + Minor additions such as SetClientModel & TF2_SetClientModel and TF2_SetClassAnimations.
// + Minor fixes to certain functions to work correctly.
// + Updated Tk_Include_Version definition to Tklib_Version.
// + Integrated Fortress Forever include.
// > Version 1.3.2
// + Minor Corrections.
// > Version 1.3.3
// + Additional minor Corrections.
// + Fixed Bool & BoolEx having incorrect placements.
// + Added AddFolderToDownloadsTable.
// + Added AddFileToDownloadsTableEx.
// + Added <game>_GetTeamColour string table to gain the teams colour.
// + Updated the TFFlag enum to use 'TFFlag' than not having a main constructor.
// + Added new definitions to possibly replace 'view_as'. Example: 'view_as<int>(function)' turns into 'int(function)' or 'view_as<Database>(function)' into 'Database(function)' (Makes it easier!)
// - Removed SetClientCookieInt as it is practically useless. Use the updated clientprefs include instead.
// + Updated entities include as a methodmap.
// + Added 'This' definition as replacement for 'this', so it is seen as 'any' (Makes it easier to handle methodmaps)
// + Added 'Ent' definition to use for turning integer entity indexes to 'Entity' index. Example: Ent(function)
// + Updated the functions to check if the netprop exists on the entity/client before proceeding, preventing errors.
// > Version 1.3.4
// + Updated Entity.Health to properly check if the entity has the property 'm_iHealth', preventing errors.
// + Updated SetEntityHealth to force name via 'm_iName' over 'DispatchKeyValue'
// + Updated CSGO_SetClientArmModel.
// + Added CSGO_GetClientArmModel.
// + Updated entity stock functions in order for supporting the new Entity constructor.
// + Added SetEntPropStringEx (Same as SetEntPropString but returns true/false if the procedure was valid)
// + Added GetEntPropStringEx (Same as GetEntPropString but returns true/false if the procedure was valid)
// + Added HasEntPropEx (Same as HasEntProp but returns true/false if the network property and entity is valid)
// + Updated Entity methodmap for the new stock functions.
// + Updated TF2_IsEntityBuilding.
// + Updated TF2_IsEntityMiniBuilding.
// + Added TF2_SetBuildingLevel.
// + Added TF2_GetBuildingLevel.
// + Added TF2_SetBuildingMaxLevel.
// + Added TF2_GetBuildingMaxLevel.
// + Added TF2_SetBuildingMetalRequired.
// + Added TF2_GetBuildingMetalRequired.
// + Integrated Multicolors.
// + Updated SetClientObserverTarget.
// + Added GetClientObserverTarget.
// + Added GetClientObserverMode.
// + Updated GameIdentifier, adding Game_SDK2006, Game_SDK2007 & Game_SDK2013.
//SM Includes
#include <sdktools>
#include <sdkhooks>
#undef REQUIRE_EXTENSIONS
#undef REQUIRE_PLUGIN
#include <cstrike>
#include <tf2_stocks>
//Extra things that should be part of SourceMod, making it easier.
#define int(%1) view_as<int>(%1)
#define any(%1) view_as<any>(%1)
#define float(%1) view_as<float>(%1) //doesn't break float(int value) function. %1 means it is the first parameter, %2 would be second, and so on (you get it).
#define bool(%1) view_as<bool>(%1)
#define char(%1) view_as<char>(%1)
#define Handle(%1) view_as<Handle>(%1)
#define Database(%1) view_as<Database>(%1)
#define DBResult(%1) view_as<DBResult>(%1)
#define DBResultSet(%1) view_as<DBResultSet(%1)
#define APLRes(%1) view_as<APLRes>(%1)
#define AdminFlag(%1) view_as<AdminFlag>(%1)
#define PropFieldType(%1) view_as<PropFieldType>(%1)
#define PropType(%1) view_as<PropType>(%1)
#define Ent(%1) view_as<Entity>(%1)
#define This view_as<any>(this)
#define CONSOLE 0
#if defined Tklib_Included
#endinput
#endif
#define Tklib_Included
#define TKlib_Version "1.3.4"
//Core includes
#include "tklib/gameidentifier"
#include "tklib/resize"
#include "tklib/weapons"
#include "tklib/clients"
#include "tklib/entities"
#include "tklib/additional"
#include "tklib/tf2"
#include "tklib/cstrike"
#include "tklib/csgo"
#include "tklib/l4d"
#include "tklib/dods"
#include "tklib/fortress_forever"
#include "tklib/multicolors"