added lazy clan tag fix
This commit is contained in:
@@ -10,7 +10,7 @@ public Plugin myinfo =
|
|||||||
name = "Racetimer Rank",
|
name = "Racetimer Rank",
|
||||||
author = "jenz",
|
author = "jenz",
|
||||||
description = "Give racetimer points as a level clan tag to players, also for chat tag",
|
description = "Give racetimer points as a level clan tag to players, also for chat tag",
|
||||||
version = "1.2",
|
version = "1.3",
|
||||||
url = ""
|
url = ""
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -373,3 +373,40 @@ public void set_level_tag(int client, int lvl)
|
|||||||
Format(tag, sizeof(tag), "\x07%s[L\x07%sV\x07%sL %s] ", hexadecimals, hexadecimals2, hexadecimals3, coloured_numbers);
|
Format(tag, sizeof(tag), "\x07%s[L\x07%sV\x07%sL %s] ", hexadecimals, hexadecimals2, hexadecimals3, coloured_numbers);
|
||||||
CCC_SetTag(client, tag);
|
CCC_SetTag(client, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//just a lazy place for applying server side fix for clan tags
|
||||||
|
//needed since august 24th 2026.
|
||||||
|
public Action OnClientCommandKeyValues(int client, KeyValues kv)
|
||||||
|
{
|
||||||
|
if (client <= 0 || client > MaxClients || !IsClientInGame(client) || IsFakeClient(client))
|
||||||
|
return Plugin_Continue;
|
||||||
|
|
||||||
|
char clanTag[32];
|
||||||
|
kv.GetString("tag", clanTag, sizeof(clanTag), "");
|
||||||
|
|
||||||
|
if (clanTag[0] == '\0')
|
||||||
|
return Plugin_Continue;
|
||||||
|
|
||||||
|
DataPack dp;
|
||||||
|
CreateDataTimer(0.1, Timer_SetClanTag, dp);
|
||||||
|
dp.WriteCell(GetClientUserId(client));
|
||||||
|
dp.WriteString(clanTag);
|
||||||
|
|
||||||
|
return Plugin_Continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Action Timer_SetClanTag(Handle timer, DataPack pack)
|
||||||
|
{
|
||||||
|
pack.Reset();
|
||||||
|
int userId = pack.ReadCell();
|
||||||
|
int client = GetClientOfUserId(userId);
|
||||||
|
|
||||||
|
char clanTag[32];
|
||||||
|
pack.ReadString(clanTag, sizeof(clanTag));
|
||||||
|
|
||||||
|
if (client && IsClientInGame(client))
|
||||||
|
{
|
||||||
|
CS_SetClientClanTag(client, clanTag);
|
||||||
|
}
|
||||||
|
return Plugin_Stop;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user