Skip to content

Commit d27cba6

Browse files
committed
Add support for Roles (formner Roles are now Teams)
1 parent 44ac072 commit d27cba6

File tree

119 files changed

+3123
-1421
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+3123
-1421
lines changed

addons/sourcemod/scripting/ghostdm.sp

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,7 @@ public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadca
253253

254254
if (IsClientValid(victim) && Player[victim].Deathmatch)
255255
{
256-
if (Player[victim].Respawn != null)
257-
{
258-
ClearTimer(Player[victim].Respawn);
259-
}
256+
delete g_iPlayer[victim].Respawn;
260257

261258
PrintToChat(victim, "You will be respawned in %.1f seconds!", g_fRespawn);
262259
Player[victim].Respawn = CreateTimer(g_fRespawn, Timer_Respawn, GetClientUserId(victim), TIMER_FLAG_NO_MAPCHANGE);
@@ -581,10 +578,7 @@ void SetRedie(int client, bool bDeathmatch = false)
581578

582579
if (bDeathmatch)
583580
{
584-
if (Player[client].Spawn != null)
585-
{
586-
ClearTimer(Player[client].Spawn);
587-
}
581+
delete g_iPlayer[victim].Spawn;
588582

589583
Player[client].Spawn = CreateTimer(g_fSpawnProt, Timer_Spawn, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
590584

@@ -705,8 +699,8 @@ void ResetClient(int client)
705699

706700
if (IsClientInGame(client))
707701
{
708-
ClearTimer(Player[client].Respawn);
709-
ClearTimer(Player[client].Spawn);
702+
delete g_iPlayer[client].Respawn;
703+
delete g_iPlayer[client].Spawn;
710704

711705
SetListener(client);
712706

@@ -750,12 +744,3 @@ bool IsClientValid(int client, bool nobots = false)
750744

751745
return false;
752746
}
753-
754-
void ClearTimer(Handle &timer, bool autoClose = false)
755-
{
756-
if (timer != null)
757-
{
758-
KillTimer(timer, autoClose);
759-
timer = null;
760-
}
761-
}

addons/sourcemod/scripting/include/colorlib_map.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ enum CL_Color
1919
CL_Color_Role_i = 0x04,
2020
CL_Color_Role_t = 0x02,
2121
CL_Color_Role_d = 0x0C,
22+
CL_Color_Role_m = 0x10,
2223
CL_Color_Warning = 0x0F,
2324
CL_Color_Error = 0x07,
2425
CL_Color_Setting = 0x02,
@@ -172,6 +173,11 @@ CL_Color _CL_ColorMap(const char[] color, int& length)
172173
length = 7;
173174
return CL_Color_Role_d;
174175
}
176+
else if (color[5] == 'm')
177+
{
178+
length = 7;
179+
return CL_Color_Role_m;
180+
}
175181
}
176182
else if (color[1] == 'e')
177183
{
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#if defined _fourcc_included
2+
#endinput
3+
#endif
4+
#define _fourcc_included
5+
6+
stock int FourCC_FromString(char[] buffer)
7+
{
8+
int value = 0;
9+
value += buffer[0] << 24;
10+
value += buffer[1] << 16;
11+
value += buffer[2] << 8;
12+
value += buffer[3];
13+
14+
return value;
15+
}
16+
17+
stock void FourCC_ToString(int value, char[] buffer)
18+
{
19+
buffer[0] = view_as<char>(value >> 24);
20+
buffer[1] = view_as<char>(value >> 16);
21+
buffer[2] = view_as<char>(value >> 8);
22+
buffer[3] = view_as<char>(value);
23+
}

0 commit comments

Comments
 (0)