mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 02:18:26 +00:00
commit
c28de91fd4
@ -23,7 +23,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#define _shavit_included
|
#define _shavit_included
|
||||||
|
|
||||||
#define SHAVIT_VERSION "2.0.0"
|
#define SHAVIT_VERSION "2.0.1"
|
||||||
#define STYLE_LIMIT 256
|
#define STYLE_LIMIT 256
|
||||||
#define MAX_ZONES 64
|
#define MAX_ZONES 64
|
||||||
|
|
||||||
|
|||||||
@ -400,24 +400,11 @@ public void OnMapStart()
|
|||||||
SetFailState("Could not load the styles configuration file. Make sure it exists (addons/sourcemod/configs/shavit-styles.cfg) and follows the proper syntax!");
|
SetFailState("Could not load the styles configuration file. Make sure it exists (addons/sourcemod/configs/shavit-styles.cfg) and follows the proper syntax!");
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Call_StartForward(gH_Forwards_OnStyleConfigLoaded);
|
|
||||||
Call_PushCell(gI_Styles);
|
|
||||||
Call_Finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
// messages
|
// messages
|
||||||
if(!LoadMessages())
|
if(!LoadMessages())
|
||||||
{
|
{
|
||||||
SetFailState("Could not load the chat messages configuration file. Make sure it exists (addons/sourcemod/configs/shavit-messages.cfg) and follows the proper syntax!");
|
SetFailState("Could not load the chat messages configuration file. Make sure it exists (addons/sourcemod/configs/shavit-messages.cfg) and follows the proper syntax!");
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Call_StartForward(gH_Forwards_OnChatConfigLoaded);
|
|
||||||
Call_Finish();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnMapEnd()
|
public void OnMapEnd()
|
||||||
@ -1511,6 +1498,10 @@ bool LoadStyles()
|
|||||||
gI_Styles = i;
|
gI_Styles = i;
|
||||||
gB_Registered = true;
|
gB_Registered = true;
|
||||||
|
|
||||||
|
Call_StartForward(gH_Forwards_OnStyleConfigLoaded);
|
||||||
|
Call_PushCell(gI_Styles);
|
||||||
|
Call_Finish();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1572,6 +1563,9 @@ bool LoadMessages()
|
|||||||
ReplaceString(gS_ChatStrings[i], 128, "{RGBA}", "\x08");
|
ReplaceString(gS_ChatStrings[i], 128, "{RGBA}", "\x08");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Call_StartForward(gH_Forwards_OnChatConfigLoaded);
|
||||||
|
Call_Finish();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -677,6 +677,7 @@ void UpdateHUD(int client)
|
|||||||
{
|
{
|
||||||
int track = Shavit_GetClientTrack(target);
|
int track = Shavit_GetClientTrack(target);
|
||||||
char[] sTrack = new char[32];
|
char[] sTrack = new char[32];
|
||||||
|
GetTrackName(client, track, sTrack, 32);
|
||||||
|
|
||||||
if(!IsFakeClient(target))
|
if(!IsFakeClient(target))
|
||||||
{
|
{
|
||||||
@ -728,7 +729,6 @@ void UpdateHUD(int client)
|
|||||||
|
|
||||||
if(track != Track_Main)
|
if(track != Track_Main)
|
||||||
{
|
{
|
||||||
GetTrackName(client, track, sTrack, 32);
|
|
||||||
Format(sHintText, 512, "%s[<font color='#FFFFFF'>%s</font>] ", sHintText, sTrack);
|
Format(sHintText, 512, "%s[<font color='#FFFFFF'>%s</font>] ", sHintText, sTrack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1498,19 +1498,6 @@ public Action Command_Tele(int client, int args)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckpointsCache cpcache[PCPCACHE_SIZE];
|
|
||||||
GetCheckpoint(client, index, cpcache);
|
|
||||||
|
|
||||||
float pos[3];
|
|
||||||
CopyArray(cpcache[fCPPosition], pos, 3);
|
|
||||||
|
|
||||||
if(IsNullVector(pos))
|
|
||||||
{
|
|
||||||
Shavit_PrintToChat(client, "%T", "MiscCheckpointsEmpty", client, (index + 1), gS_ChatStrings[sMessageWarning], gS_ChatStrings[sMessageText]);
|
|
||||||
|
|
||||||
return Plugin_Handled;
|
|
||||||
}
|
|
||||||
|
|
||||||
TeleportToCheckpoint(client, index, false);
|
TeleportToCheckpoint(client, index, false);
|
||||||
|
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
@ -1705,6 +1692,13 @@ bool SaveCheckpoint(int client, int index)
|
|||||||
int style = Shavit_GetReplayBotStyle(target);
|
int style = Shavit_GetReplayBotStyle(target);
|
||||||
int track = Shavit_GetReplayBotTrack(target);
|
int track = Shavit_GetReplayBotTrack(target);
|
||||||
|
|
||||||
|
if(style < 0 || track < 0)
|
||||||
|
{
|
||||||
|
Shavit_PrintToChat(client, "%T", "CommandAliveSpectate", client, gS_ChatStrings[sMessageVariable], gS_ChatStrings[sMessageText], gS_ChatStrings[sMessageVariable], gS_ChatStrings[sMessageText]);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
snapshot[bTimerEnabled] = true;
|
snapshot[bTimerEnabled] = true;
|
||||||
snapshot[fCurrentTime] = Shavit_GetReplayTime(style, track);
|
snapshot[fCurrentTime] = Shavit_GetReplayTime(style, track);
|
||||||
snapshot[bClientPaused] = false;
|
snapshot[bClientPaused] = false;
|
||||||
@ -1737,7 +1731,13 @@ void TeleportToCheckpoint(int client, int index, bool suppressMessage)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CheckpointsCache cpcache[PCPCACHE_SIZE];
|
CheckpointsCache cpcache[PCPCACHE_SIZE];
|
||||||
GetCheckpoint(client, index, cpcache);
|
|
||||||
|
if(!GetCheckpoint(client, index, cpcache))
|
||||||
|
{
|
||||||
|
Shavit_PrintToChat(client, "%T", "MiscCheckpointsEmpty", client, (index + 1), gS_ChatStrings[sMessageWarning], gS_ChatStrings[sMessageText]);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
float pos[3];
|
float pos[3];
|
||||||
CopyArray(cpcache[fCPPosition], pos, 3);
|
CopyArray(cpcache[fCPPosition], pos, 3);
|
||||||
|
|||||||
@ -401,6 +401,11 @@ public int Native_GetReplayTime(Handle handler, int numParams)
|
|||||||
int style = GetNativeCell(1);
|
int style = GetNativeCell(1);
|
||||||
int track = GetNativeCell(2);
|
int track = GetNativeCell(2);
|
||||||
|
|
||||||
|
if(style < 0 || track < 0)
|
||||||
|
{
|
||||||
|
return view_as<int>(0.0);
|
||||||
|
}
|
||||||
|
|
||||||
if(gB_CentralBot)
|
if(gB_CentralBot)
|
||||||
{
|
{
|
||||||
if(gA_CentralCache[iCentralReplayStatus] == Replay_End)
|
if(gA_CentralCache[iCentralReplayStatus] == Replay_End)
|
||||||
|
|||||||
@ -173,15 +173,6 @@ public void OnPluginStart()
|
|||||||
// cache
|
// cache
|
||||||
gA_ValidMaps = new ArrayList(192);
|
gA_ValidMaps = new ArrayList(192);
|
||||||
|
|
||||||
for(int i = 0; i < STYLE_LIMIT; i++)
|
|
||||||
{
|
|
||||||
for(int j = 0; j < TRACKS_SIZE; j++)
|
|
||||||
{
|
|
||||||
gA_Leaderboard[i][j] = new ArrayList();
|
|
||||||
gI_RecordAmount[i][j] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL_SetPrefix();
|
SQL_SetPrefix();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,7 +361,13 @@ public void Shavit_OnStyleConfigLoaded(int styles)
|
|||||||
{
|
{
|
||||||
if(i < styles)
|
if(i < styles)
|
||||||
{
|
{
|
||||||
|
if(gA_Leaderboard[i][j] == null)
|
||||||
|
{
|
||||||
|
gA_Leaderboard[i][j] = new ArrayList();
|
||||||
|
}
|
||||||
|
|
||||||
gA_Leaderboard[i][j].Clear();
|
gA_Leaderboard[i][j].Clear();
|
||||||
|
gI_RecordAmount[i][j] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -544,7 +541,7 @@ public int Native_GetRankForTime(Handle handler, int numParams)
|
|||||||
int style = GetNativeCell(1);
|
int style = GetNativeCell(1);
|
||||||
int track = GetNativeCell(3);
|
int track = GetNativeCell(3);
|
||||||
|
|
||||||
if(gA_Leaderboard[style][track].Length == 0)
|
if(gA_Leaderboard[style][track] == null || gA_Leaderboard[style][track].Length == 0)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user