mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-09 19:38:25 +00:00
add chat properties for rank ranges
@ntoxin66 I really appreciate Dynamic, this is fantastic! also added Shavit_OnRankUpdated() forward
This commit is contained in:
parent
7c60a38fc2
commit
89a100d867
@ -14,6 +14,7 @@ a bhop server should be simple
|
|||||||
* [SourceMod 1.8 and above](http://www.sourcemod.net/downloads.php)
|
* [SourceMod 1.8 and above](http://www.sourcemod.net/downloads.php)
|
||||||
* `clientprefs` plugin/extension. Comes built-in with SourceMod.
|
* `clientprefs` plugin/extension. Comes built-in with SourceMod.
|
||||||
* [The RTLer](https://forums.alliedmods.net/showthread.php?p=1649882) is required to *compile* `shavit-chat` and you don't need Simple Chat Processor as listed in Ther RTLer's requirements.
|
* [The RTLer](https://forums.alliedmods.net/showthread.php?p=1649882) is required to *compile* `shavit-chat` and you don't need Simple Chat Processor as listed in Ther RTLer's requirements.
|
||||||
|
* [Dynamic](https://forums.alliedmods.net/showthread.php?t=270519) for compilation and runtime of `shavit-chat`.
|
||||||
|
|
||||||
# Optional requirements:
|
# Optional requirements:
|
||||||
* [DHooks](http://users.alliedmods.net/~drifter/builds/dhooks/2.0/) - required for static 250 prestrafe (bhoptimer 1.2b and above)
|
* [DHooks](http://users.alliedmods.net/~drifter/builds/dhooks/2.0/) - required for static 250 prestrafe (bhoptimer 1.2b and above)
|
||||||
@ -70,6 +71,7 @@ General
|
|||||||
- [x] Migrate DBI to the 1.7 transitional syntax.
|
- [x] Migrate DBI to the 1.7 transitional syntax.
|
||||||
- [x] Migrate events to the 1.7 transitional syntax.
|
- [x] Migrate events to the 1.7 transitional syntax.
|
||||||
- [x] Migrate ADT_Arrays to ArrayList.
|
- [x] Migrate ADT_Arrays to ArrayList.
|
||||||
|
- [ ] **ENDGAME**: Migrate all the cached stuff (timer variables, HUD, chat cache) to Dynamic if I find it good and simple enough.
|
||||||
|
|
||||||
Core
|
Core
|
||||||
--
|
--
|
||||||
@ -113,6 +115,7 @@ Stats
|
|||||||
- [x] Make style names editable from shavit.inc (like I did to the rest of modules) (dynamic!)
|
- [x] Make style names editable from shavit.inc (like I did to the rest of modules) (dynamic!)
|
||||||
- [x] Make a submenu per style, for aesthetics.
|
- [x] Make a submenu per style, for aesthetics.
|
||||||
- [x] [rankings] Points implementation.
|
- [x] [rankings] Points implementation.
|
||||||
|
- [ ] Make MVP count the amount of WRs the player has.
|
||||||
|
|
||||||
Miscellaneous
|
Miscellaneous
|
||||||
--
|
--
|
||||||
@ -150,7 +153,7 @@ Chat **(NEW!)**
|
|||||||
- [x] Add logic that processes chat without requiring an external plugin such as `Simple Chat Processor (Redux)`.
|
- [x] Add logic that processes chat without requiring an external plugin such as `Simple Chat Processor (Redux)`.
|
||||||
- [x] [RTLer](https://forums.alliedmods.net/showthread.php?p=1649882) support.
|
- [x] [RTLer](https://forums.alliedmods.net/showthread.php?p=1649882) support.
|
||||||
- [x] Custom chat titles/colors per individual player.
|
- [x] Custom chat titles/colors per individual player.
|
||||||
- [ ] Custom chat titles/colors for rank ranges.
|
- [x] Custom chat titles/colors for rank ranges.
|
||||||
- [ ] Update cache for everyone when a player finishes a map.
|
- [x] Update cache for a player when his rank updates.
|
||||||
- [ ] Add `sm_ranks` `sm_chatranks`
|
- [ ] Add `sm_ranks` `sm_chatranks`
|
||||||
- [ ] Add `Shavit_FormatChat` native
|
- [ ] Add `Shavit_FormatChat` native
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
// Use SteamID3 for a value if you want a per-client setting.
|
// Use SteamID3 for a value if you want a per-client setting.
|
||||||
// "Custom" is for per-client settings.
|
// "Custom" is for per-client settings.
|
||||||
// "Ranks" is for rank range settings.
|
// "Ranks" is for rank range settings. (Limited to 64 entries)
|
||||||
//
|
//
|
||||||
// Available settings:
|
// Available settings:
|
||||||
// "rank_from" - rank range to start with
|
// "rank_from" - rank range to start with
|
||||||
// "rank_to" - rank range to end with; you can use "infinity" if it's for every player below "rank_from".
|
// "rank_to" - rank range to end with; you can use "infinity" if it's for every player below "rank_from".
|
||||||
//
|
//
|
||||||
// "prefix" - prefix before the name
|
// "prefix" - prefix before the name (don't add a space after it)
|
||||||
// "name" - custom name appearance
|
// "name" - custom name appearance
|
||||||
// "message" - the message itself
|
// "message" - the message itself
|
||||||
//
|
//
|
||||||
@ -47,17 +47,9 @@
|
|||||||
{
|
{
|
||||||
"prefix" "{green}/dev{green}/"
|
"prefix" "{green}/dev{green}/"
|
||||||
"name" "{default}{team}{clan}{name}"
|
"name" "{default}{team}{clan}{name}"
|
||||||
"message" "{message}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
"[U:1:108640137]" // friend
|
"-1" // lookup is due, shouldn't happen unless there's some error!
|
||||||
{
|
|
||||||
"prefix" "{green}noob "
|
|
||||||
"name" "{team}{name}"
|
|
||||||
"message" "{message}"
|
|
||||||
}
|
|
||||||
|
|
||||||
"-1" // lookup is due
|
|
||||||
{
|
{
|
||||||
"rank_from" "-1"
|
"rank_from" "-1"
|
||||||
"rank_to" "-1"
|
"rank_to" "-1"
|
||||||
@ -82,28 +74,33 @@
|
|||||||
"rank_from" "1"
|
"rank_from" "1"
|
||||||
"rank_to" "1"
|
"rank_to" "1"
|
||||||
|
|
||||||
"prefix" "{default}One True God"
|
"prefix" "{green}ONE TRUE GOD"
|
||||||
"name" "{team}{name}"
|
"name" "{clan}{team}{name}"
|
||||||
"message" "{message}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
"2"
|
"2"
|
||||||
{
|
{
|
||||||
"rank_from" "2"
|
"rank_from" "2"
|
||||||
"rank_to" "3"
|
"rank_to" "2"
|
||||||
|
|
||||||
"prefix" "{default}Decent"
|
"prefix" "LEGENDARY"
|
||||||
"name" "{team}{name}"
|
"name" "{name}"
|
||||||
"message" "{message}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
"3"
|
"3"
|
||||||
|
{
|
||||||
|
"rank_from" "3"
|
||||||
|
"rank_to" "3"
|
||||||
|
|
||||||
|
"prefix" "HERO"
|
||||||
|
"name" "{team}{name}"
|
||||||
|
}
|
||||||
|
|
||||||
|
"4"
|
||||||
{
|
{
|
||||||
"rank_from" "4"
|
"rank_from" "4"
|
||||||
"rank_to" "infinity"
|
"rank_to" "infinity"
|
||||||
|
|
||||||
"prefix" "{default}Noob"
|
"prefix" "scrub!"
|
||||||
"name" "{team}{name}"
|
|
||||||
"message" "{message}"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -389,6 +389,15 @@ forward void Shavit_OnPause(int client);
|
|||||||
*/
|
*/
|
||||||
forward void Shavit_OnResume(int client);
|
forward void Shavit_OnResume(int client);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a player's rank has updated or was just looked up.
|
||||||
|
* Will be called on initial rank lookup.
|
||||||
|
*
|
||||||
|
* @param client Client index.
|
||||||
|
* @noreturn
|
||||||
|
*/
|
||||||
|
forward void Shavit_OnRankUpdated(int client);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the game type the server is running.
|
* Returns the game type the server is running.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include <sourcemod>
|
#include <sourcemod>
|
||||||
#include <cstrike>
|
#include <cstrike>
|
||||||
|
#include <dynamic>
|
||||||
|
|
||||||
#define USES_CHAT_COLORS
|
#define USES_CHAT_COLORS
|
||||||
#include <shavit>
|
#include <shavit>
|
||||||
@ -35,14 +36,17 @@
|
|||||||
// cache
|
// cache
|
||||||
float gF_LastMessage[MAXPLAYERS+1];
|
float gF_LastMessage[MAXPLAYERS+1];
|
||||||
|
|
||||||
char gS_Custom_Prefix[MAXPLAYERS+1][32];
|
char gS_Cached_Prefix[MAXPLAYERS+1][32];
|
||||||
char gS_Custom_Name[MAXPLAYERS+1][MAX_NAME_LENGTH*2];
|
char gS_Cached_Name[MAXPLAYERS+1][MAX_NAME_LENGTH*2];
|
||||||
char gS_Custom_Message[MAXPLAYERS+1][255];
|
char gS_Cached_Message[MAXPLAYERS+1][255];
|
||||||
|
|
||||||
StringMap gSM_Custom_Prefix = null;
|
StringMap gSM_Custom_Prefix = null;
|
||||||
StringMap gSM_Custom_Name = null;
|
StringMap gSM_Custom_Name = null;
|
||||||
StringMap gSM_Custom_Message = null;
|
StringMap gSM_Custom_Message = null;
|
||||||
|
|
||||||
|
int gI_TotalChatRanks = 0;
|
||||||
|
Dynamic gD_ChatRanks[64]; // limited to 64 chat ranks right now, i really don't think there's a need for more.
|
||||||
|
|
||||||
// modules
|
// modules
|
||||||
bool gB_BaseComm = false;
|
bool gB_BaseComm = false;
|
||||||
bool gB_RTLer = false;
|
bool gB_RTLer = false;
|
||||||
@ -58,6 +62,7 @@ public Plugin myinfo =
|
|||||||
version = SHAVIT_VERSION,
|
version = SHAVIT_VERSION,
|
||||||
url = "https://github.com/shavitush/bhoptimer"
|
url = "https://github.com/shavitush/bhoptimer"
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnAllPluginsLoaded()
|
public void OnAllPluginsLoaded()
|
||||||
{
|
{
|
||||||
if(!LibraryExists("shavit-rankings"))
|
if(!LibraryExists("shavit-rankings"))
|
||||||
@ -86,11 +91,6 @@ public void OnMapStart()
|
|||||||
public void OnClientPutInServer(int client)
|
public void OnClientPutInServer(int client)
|
||||||
{
|
{
|
||||||
gF_LastMessage[client] = GetEngineTime();
|
gF_LastMessage[client] = GetEngineTime();
|
||||||
|
|
||||||
if(IsClientAuthorized(client))
|
|
||||||
{
|
|
||||||
LoadChatCache(client);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnLibraryAdded(const char[] name)
|
public void OnLibraryAdded(const char[] name)
|
||||||
@ -119,8 +119,37 @@ public void OnLibraryRemoved(const char[] name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Shavit_OnRankUpdated(int client)
|
||||||
|
{
|
||||||
|
LoadChatCache(client);
|
||||||
|
}
|
||||||
|
|
||||||
public void LoadChatCache(int client)
|
public void LoadChatCache(int client)
|
||||||
{
|
{
|
||||||
|
// assign rank properties
|
||||||
|
int iRank = Shavit_GetRank(client);
|
||||||
|
|
||||||
|
for(int i = 0; i < gI_TotalChatRanks; i++)
|
||||||
|
{
|
||||||
|
if(gD_ChatRanks[i].IsValid)
|
||||||
|
{
|
||||||
|
int iFrom = gD_ChatRanks[i].GetInt("rank_from");
|
||||||
|
int iTo = gD_ChatRanks[i].GetInt("rank_to");
|
||||||
|
|
||||||
|
if(iRank < iFrom || iRank > iTo)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
gD_ChatRanks[i].GetString("prefix", gS_Cached_Prefix[client], 32);
|
||||||
|
gD_ChatRanks[i].GetString("name", gS_Cached_Name[client], MAX_NAME_LENGTH*2);
|
||||||
|
gD_ChatRanks[i].GetString("message", gS_Cached_Message[client], 255);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(IsClientAuthorized(client))
|
||||||
|
{
|
||||||
|
// lookup custom properties in addition to the rank properties
|
||||||
char[] sAuthID = new char[32];
|
char[] sAuthID = new char[32];
|
||||||
GetClientAuthId(client, AuthId_Steam3, sAuthID, 32);
|
GetClientAuthId(client, AuthId_Steam3, sAuthID, 32);
|
||||||
|
|
||||||
@ -128,17 +157,18 @@ public void LoadChatCache(int client)
|
|||||||
|
|
||||||
if(gSM_Custom_Prefix.GetString(sAuthID, sBuffer, 255))
|
if(gSM_Custom_Prefix.GetString(sAuthID, sBuffer, 255))
|
||||||
{
|
{
|
||||||
strcopy(gS_Custom_Prefix[client], 32, sBuffer);
|
strcopy(gS_Cached_Prefix[client], 32, sBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gSM_Custom_Name.GetString(sAuthID, sBuffer, 255))
|
if(gSM_Custom_Name.GetString(sAuthID, sBuffer, 255))
|
||||||
{
|
{
|
||||||
strcopy(gS_Custom_Name[client], MAX_NAME_LENGTH*2, sBuffer);
|
strcopy(gS_Cached_Name[client], MAX_NAME_LENGTH*2, sBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gSM_Custom_Message.GetString(sAuthID, sBuffer, 255))
|
if(gSM_Custom_Message.GetString(sAuthID, sBuffer, 255))
|
||||||
{
|
{
|
||||||
strcopy(gS_Custom_Message[client], 255, sBuffer);
|
strcopy(gS_Cached_Message[client], 255, sBuffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,6 +182,16 @@ public void LoadConfig()
|
|||||||
gSM_Custom_Name = new StringMap();
|
gSM_Custom_Name = new StringMap();
|
||||||
gSM_Custom_Message = new StringMap();
|
gSM_Custom_Message = new StringMap();
|
||||||
|
|
||||||
|
for(int i = 0; i < 64; i++)
|
||||||
|
{
|
||||||
|
if(gD_ChatRanks[i].IsValid)
|
||||||
|
{
|
||||||
|
gD_ChatRanks[i].Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gI_TotalChatRanks = 0;
|
||||||
|
|
||||||
KeyValues kvConfig = new KeyValues("Chat");
|
KeyValues kvConfig = new KeyValues("Chat");
|
||||||
|
|
||||||
char[] sFile = new char[PLATFORM_MAX_PATH];
|
char[] sFile = new char[PLATFORM_MAX_PATH];
|
||||||
@ -170,30 +210,67 @@ public void LoadConfig()
|
|||||||
{
|
{
|
||||||
kvConfig.GetSectionName(sBuffer, 255);
|
kvConfig.GetSectionName(sBuffer, 255);
|
||||||
|
|
||||||
|
char[] sPrefix = new char[32];
|
||||||
|
kvConfig.GetString("prefix", sPrefix, 32);
|
||||||
|
|
||||||
|
char[] sName = new char[MAX_NAME_LENGTH*2];
|
||||||
|
kvConfig.GetString("name", sName, MAX_NAME_LENGTH*2);
|
||||||
|
|
||||||
|
char[] sMessage = new char[255];
|
||||||
|
kvConfig.GetString("message", sMessage, 255);
|
||||||
|
|
||||||
|
// custom
|
||||||
if(StrContains(sBuffer[0], "[U:") != -1)
|
if(StrContains(sBuffer[0], "[U:") != -1)
|
||||||
{
|
{
|
||||||
char[] sProperty = new char[255];
|
if(strlen(sPrefix) > 0)
|
||||||
kvConfig.GetString("prefix", sProperty, 255);
|
|
||||||
|
|
||||||
if(strlen(sProperty) > 0)
|
|
||||||
{
|
{
|
||||||
gSM_Custom_Prefix.SetString(sBuffer, sProperty);
|
gSM_Custom_Prefix.SetString(sBuffer, sPrefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
kvConfig.GetString("name", sProperty, 255);
|
if(strlen(sName) > 0)
|
||||||
|
|
||||||
if(strlen(sProperty) > 0)
|
|
||||||
{
|
{
|
||||||
gSM_Custom_Name.SetString(sBuffer, sProperty);
|
gSM_Custom_Name.SetString(sBuffer, sName);
|
||||||
}
|
}
|
||||||
|
|
||||||
kvConfig.GetString("message", sProperty, 255);
|
if(strlen(sMessage) > 0)
|
||||||
|
|
||||||
if(strlen(sProperty) > 0)
|
|
||||||
{
|
{
|
||||||
gSM_Custom_Message.SetString(sBuffer, sProperty);
|
gSM_Custom_Message.SetString(sBuffer, sMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ranks
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int iFrom = kvConfig.GetNum("rank_from", -2);
|
||||||
|
|
||||||
|
if(iFrom == -2)
|
||||||
|
{
|
||||||
|
LogError("Invalid \"rank_from\" value for \"%s\": %d or non-existant.", sBuffer, iFrom);
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
char[] sTo = new char[6];
|
||||||
|
kvConfig.GetString("rank_to", sTo, 6, "-2");
|
||||||
|
|
||||||
|
int iTo = StrEqual(sTo, "infinity")? 2147483647:StringToInt(sTo);
|
||||||
|
|
||||||
|
if(iTo == -2)
|
||||||
|
{
|
||||||
|
LogError("Invalid \"rank_to\" value for \"%s\": %d or non-existant.", sBuffer, iTo);
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
gD_ChatRanks[gI_TotalChatRanks] = Dynamic();
|
||||||
|
gD_ChatRanks[gI_TotalChatRanks].SetInt("rank_from", iFrom);
|
||||||
|
gD_ChatRanks[gI_TotalChatRanks].SetInt("rank_to", iTo);
|
||||||
|
gD_ChatRanks[gI_TotalChatRanks].SetString("prefix", sPrefix, 32);
|
||||||
|
gD_ChatRanks[gI_TotalChatRanks].SetString("name", sName, MAX_NAME_LENGTH*2);
|
||||||
|
gD_ChatRanks[gI_TotalChatRanks].SetString("message", sMessage, 255);
|
||||||
|
|
||||||
|
gI_TotalChatRanks++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while(kvConfig.GotoNextKey());
|
while(kvConfig.GotoNextKey());
|
||||||
@ -208,9 +285,11 @@ public void LoadConfig()
|
|||||||
|
|
||||||
for(int i = 1; i <= MaxClients; i++)
|
for(int i = 1; i <= MaxClients; i++)
|
||||||
{
|
{
|
||||||
if(IsValidClient(i))
|
if(IsValidClient(i)) // late loading
|
||||||
{
|
{
|
||||||
OnClientPutInServer(i); // late loading
|
gF_LastMessage[i] = GetEngineTime();
|
||||||
|
|
||||||
|
Shavit_OnRankUpdated(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -306,17 +385,19 @@ public void FormatChat(int client, const char[] sMessage, bool bAlive, int iTeam
|
|||||||
char[] sBuffer = new char[255];
|
char[] sBuffer = new char[255];
|
||||||
char[] sNewPrefix = new char[32];
|
char[] sNewPrefix = new char[32];
|
||||||
|
|
||||||
if(strlen(gS_Custom_Prefix[client]) > 0)
|
if(strlen(gS_Cached_Prefix[client]) > 0)
|
||||||
{
|
{
|
||||||
FormatVariables(client, sBuffer, 255, gS_Custom_Prefix[client], sMessage);
|
FormatVariables(client, sBuffer, 255, gS_Cached_Prefix[client], sMessage);
|
||||||
|
int iLen = strlen(sBuffer);
|
||||||
|
sBuffer[iLen] = (iLen > 0)? ' ':'\0';
|
||||||
strcopy(sNewPrefix, 32, sBuffer);
|
strcopy(sNewPrefix, 32, sBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
char[] sNewName = new char[MAX_NAME_LENGTH*2];
|
char[] sNewName = new char[MAX_NAME_LENGTH*2];
|
||||||
|
|
||||||
if(strlen(gS_Custom_Name[client]) > 0)
|
if(strlen(gS_Cached_Name[client]) > 0)
|
||||||
{
|
{
|
||||||
FormatVariables(client, sBuffer, 255, gS_Custom_Name[client], sMessage);
|
FormatVariables(client, sBuffer, 255, gS_Cached_Name[client], sMessage);
|
||||||
strcopy(sNewName, MAX_NAME_LENGTH*2, sBuffer);
|
strcopy(sNewName, MAX_NAME_LENGTH*2, sBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -338,9 +419,9 @@ public void FormatChat(int client, const char[] sMessage, bool bAlive, int iTeam
|
|||||||
RTLify(sFormattedText, maxlen, sFormattedText);
|
RTLify(sFormattedText, maxlen, sFormattedText);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strlen(gS_Custom_Message[client]) > 0)
|
if(strlen(gS_Cached_Message[client]) > 0)
|
||||||
{
|
{
|
||||||
FormatVariables(client, sBuffer, 255, gS_Custom_Message[client], sFormattedText);
|
FormatVariables(client, sBuffer, 255, gS_Cached_Message[client], sFormattedText);
|
||||||
strcopy(sFormattedText, 255, sBuffer);
|
strcopy(sFormattedText, 255, sBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -359,7 +440,7 @@ public void FormatVariables(int client, char[] buffer, int maxlen, const char[]
|
|||||||
char[] sClanTag = new char[32];
|
char[] sClanTag = new char[32];
|
||||||
CS_GetClientClanTag(client, sClanTag, 32);
|
CS_GetClientClanTag(client, sClanTag, 32);
|
||||||
int iLen = strlen(sClanTag);
|
int iLen = strlen(sClanTag);
|
||||||
sClanTag[iLen] = iLen > 0? ' ':'\0'; // add spacing after the clan tag if there is one
|
sClanTag[iLen] = (iLen > 0)? ' ':'\0';
|
||||||
ReplaceString(sTempFormattingRules, maxlen, "{clan}", sClanTag);
|
ReplaceString(sTempFormattingRules, maxlen, "{clan}", sClanTag);
|
||||||
|
|
||||||
ReplaceString(sTempFormattingRules, maxlen, "{message}", message);
|
ReplaceString(sTempFormattingRules, maxlen, "{message}", message);
|
||||||
|
|||||||
@ -29,6 +29,9 @@
|
|||||||
|
|
||||||
// #define DEBUG
|
// #define DEBUG
|
||||||
|
|
||||||
|
// forwards
|
||||||
|
Handle gH_Forwards_OnRankUpdated = null;
|
||||||
|
|
||||||
// cache
|
// cache
|
||||||
char gS_Map[256];
|
char gS_Map[256];
|
||||||
float gF_IdealTime = 0.0;
|
float gF_IdealTime = 0.0;
|
||||||
@ -83,6 +86,9 @@ public void OnAllPluginsLoaded()
|
|||||||
|
|
||||||
public void OnPluginStart()
|
public void OnPluginStart()
|
||||||
{
|
{
|
||||||
|
// forwards
|
||||||
|
gH_Forwards_OnRankUpdated = CreateGlobalForward("Shavit_OnRankUpdated", ET_Event, Param_Cell);
|
||||||
|
|
||||||
// database connections
|
// database connections
|
||||||
Shavit_GetDB(gH_SQL);
|
Shavit_GetDB(gH_SQL);
|
||||||
SQL_SetPrefix();
|
SQL_SetPrefix();
|
||||||
@ -748,6 +754,10 @@ public void SQL_UpdatePlayerRank_Callback(Database db, DBResultSet results, cons
|
|||||||
if(results.FetchRow())
|
if(results.FetchRow())
|
||||||
{
|
{
|
||||||
gI_PlayerRank[client] = results.FetchInt(0);
|
gI_PlayerRank[client] = results.FetchInt(0);
|
||||||
|
|
||||||
|
Call_StartForward(gH_Forwards_OnRankUpdated);
|
||||||
|
Call_PushCell(client);
|
||||||
|
Call_Finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user