mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-16 03:37:18 +00:00
Remove 'public' where not needed (#276)
This commit is contained in:
parent
572a343f2f
commit
8277312421
@ -137,7 +137,7 @@ public void OnClientSettingsChanged(int client)
|
||||
UpdateClanTag(client);
|
||||
}
|
||||
|
||||
public void UpdateClanTag(int client)
|
||||
void UpdateClanTag(int client)
|
||||
{
|
||||
if(IsValidClient(client) && strlen(gS_Cached_ClanTag[client]) > 0)
|
||||
{
|
||||
@ -191,7 +191,7 @@ public void Shavit_OnRankUpdated(int client)
|
||||
LoadChatCache(client);
|
||||
}
|
||||
|
||||
public void LoadChatCache(int client)
|
||||
void LoadChatCache(int client)
|
||||
{
|
||||
// assign rank properties
|
||||
int iRank = Shavit_GetRank(client);
|
||||
@ -257,7 +257,7 @@ public void LoadChatCache(int client)
|
||||
UpdateClanTag(client);
|
||||
}
|
||||
|
||||
public void ResetCache()
|
||||
void ResetCache()
|
||||
{
|
||||
for(int i = 0; i < 64; i++)
|
||||
{
|
||||
@ -272,7 +272,7 @@ public void ResetCache()
|
||||
gI_UnrankedTitle = -1;
|
||||
}
|
||||
|
||||
public void LoadConfig()
|
||||
void LoadConfig()
|
||||
{
|
||||
delete gSM_Custom_Prefix;
|
||||
delete gSM_Custom_Name;
|
||||
@ -615,7 +615,7 @@ public Action OnClientSayCommand(int client, const char[] command, const char[]
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
public void FormatChatLine(int client, const char[] sMessage, bool bAlive, int iTeam, bool bTeam, char[] buffer, int maxlen)
|
||||
void FormatChatLine(int client, const char[] sMessage, bool bAlive, int iTeam, bool bTeam, char[] buffer, int maxlen)
|
||||
{
|
||||
char[] sTeam = new char[32];
|
||||
|
||||
@ -716,7 +716,7 @@ public void FormatChatLine(int client, const char[] sMessage, bool bAlive, int i
|
||||
FormatEx(buffer, maxlen, "\x01%s%s%s\x03%s%s %s %s", gEV_Type == Engine_CSGO? " ":"", (bAlive || iTeam == CS_TEAM_SPECTATOR)? "":"*DEAD* ", sTeam, sNewPrefix, sNewName, gEV_Type == Engine_CSGO? ":\x01":"\x01:", sFormattedText);
|
||||
}
|
||||
|
||||
public void FormatVariables(int client, char[] buffer, int maxlen, const char[] formattingrules, const char[] message)
|
||||
void FormatVariables(int client, char[] buffer, int maxlen, const char[] formattingrules, const char[] message)
|
||||
{
|
||||
char[] sTempFormattingRules = new char[maxlen];
|
||||
strcopy(sTempFormattingRules, maxlen, formattingrules);
|
||||
@ -735,16 +735,14 @@ public void FormatVariables(int client, char[] buffer, int maxlen, const char[]
|
||||
|
||||
do
|
||||
{
|
||||
GetRandomHex(sColorBuffer, 6);
|
||||
Format(sColorBuffer, 16, "\x07%s", sColorBuffer);
|
||||
Format(sColorBuffer, 16, "\x07%x%x%x", RealRandomInt(1, 255), RealRandomInt(1, 255), RealRandomInt(1, 255));
|
||||
}
|
||||
|
||||
while(ReplaceStringEx(sTempFormattingRules, maxlen, "{RGBX}", sColorBuffer) > 0);
|
||||
|
||||
do
|
||||
{
|
||||
GetRandomHex(sColorBuffer, 8);
|
||||
Format(sColorBuffer, 16, "\x08%s", sColorBuffer);
|
||||
Format(sColorBuffer, 16, "\x08%x%x%x%x", RealRandomInt(1, 255), RealRandomInt(1, 255), RealRandomInt(1, 255), RealRandomInt(1, 255));
|
||||
}
|
||||
|
||||
while(ReplaceStringEx(sTempFormattingRules, maxlen, "{RGBAX}", sColorBuffer) > 0);
|
||||
@ -773,7 +771,7 @@ public void FormatVariables(int client, char[] buffer, int maxlen, const char[]
|
||||
strcopy(buffer, maxlen, sTempFormattingRules);
|
||||
}
|
||||
|
||||
public void ChatMessage(int from, int[] clients, int count, const char[] sMessage)
|
||||
void ChatMessage(int from, int[] clients, int count, const char[] sMessage)
|
||||
{
|
||||
Handle hSayText2 = StartMessage("SayText2", clients, count);
|
||||
|
||||
@ -834,20 +832,8 @@ public int Native_FormatChat(Handle handler, int numParams)
|
||||
return SetNativeString(6, sBuffer, maxlength);
|
||||
}
|
||||
|
||||
public void GetRandomHex(char[] buffer, int size)
|
||||
{
|
||||
char[] sHex = "0123456789abcdef";
|
||||
|
||||
for(int i = 0; i < size; i++)
|
||||
{
|
||||
buffer[i] = sHex[RealRandomInt(0, 15)];
|
||||
}
|
||||
|
||||
buffer[size+1] = '\0';
|
||||
}
|
||||
|
||||
// from SMLib
|
||||
public int RealRandomInt(int min, int max)
|
||||
int RealRandomInt(int min, int max)
|
||||
{
|
||||
int random = GetURandomInt();
|
||||
|
||||
|
||||
@ -590,7 +590,7 @@ public int StyleMenu_Handler(Menu m, MenuAction action, int param1, int param2)
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void ChangeClientStyle(int client, BhopStyle style)
|
||||
void ChangeClientStyle(int client, BhopStyle style)
|
||||
{
|
||||
if(!IsValidClient(client))
|
||||
{
|
||||
@ -837,7 +837,7 @@ public int Native_GetChatStrings(Handle handler, int numParams)
|
||||
return SetNativeString(2, gS_ChatStrings[GetNativeCell(1)], GetNativeCell(3));
|
||||
}
|
||||
|
||||
public void StartTimer(int client)
|
||||
void StartTimer(int client)
|
||||
{
|
||||
if(!IsValidClient(client, true) || GetClientTeam(client) < 2 || IsFakeClient(client))
|
||||
{
|
||||
@ -868,7 +868,7 @@ public void StartTimer(int client)
|
||||
SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", gA_StyleSettings[gBS_Style[client]][fSpeedMultiplier]);
|
||||
}
|
||||
|
||||
public void StopTimer(int client)
|
||||
void StopTimer(int client)
|
||||
{
|
||||
if(!IsValidClient(client) || IsFakeClient(client))
|
||||
{
|
||||
@ -885,7 +885,7 @@ public void StopTimer(int client)
|
||||
gI_GoodGains[client] = 0;
|
||||
}
|
||||
|
||||
public void PauseTimer(int client)
|
||||
void PauseTimer(int client)
|
||||
{
|
||||
if(!IsValidClient(client) || IsFakeClient(client))
|
||||
{
|
||||
@ -900,7 +900,7 @@ public void PauseTimer(int client)
|
||||
Call_Finish();
|
||||
}
|
||||
|
||||
public void ResumeTimer(int client)
|
||||
void ResumeTimer(int client)
|
||||
{
|
||||
if(!IsValidClient(client) || IsFakeClient(client))
|
||||
{
|
||||
@ -915,7 +915,7 @@ public void ResumeTimer(int client)
|
||||
Call_Finish();
|
||||
}
|
||||
|
||||
public float CalculateTime(int client)
|
||||
float CalculateTime(int client)
|
||||
{
|
||||
float time = 0.0;
|
||||
|
||||
@ -1035,7 +1035,7 @@ public void SQL_InsertUser_Callback(Database db, DBResultSet results, const char
|
||||
}
|
||||
}
|
||||
|
||||
public bool LoadStyles()
|
||||
bool LoadStyles()
|
||||
{
|
||||
char[] sPath = new char[PLATFORM_MAX_PATH];
|
||||
BuildPath(Path_SM, sPath, PLATFORM_MAX_PATH, "configs/shavit-styles.cfg");
|
||||
@ -1134,7 +1134,7 @@ public Action Command_StyleChange(int client, int args)
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public bool LoadMessages()
|
||||
bool LoadMessages()
|
||||
{
|
||||
char[] sPath = new char[PLATFORM_MAX_PATH];
|
||||
BuildPath(Path_SM, sPath, PLATFORM_MAX_PATH, "configs/shavit-messages.cfg");
|
||||
@ -1177,7 +1177,7 @@ public bool LoadMessages()
|
||||
return true;
|
||||
}
|
||||
|
||||
public void SQL_SetPrefix()
|
||||
void SQL_SetPrefix()
|
||||
{
|
||||
char[] sFile = new char[PLATFORM_MAX_PATH];
|
||||
BuildPath(Path_SM, sFile, PLATFORM_MAX_PATH, "configs/shavit-prefix.txt");
|
||||
@ -1205,7 +1205,7 @@ public void SQL_SetPrefix()
|
||||
delete fFile;
|
||||
}
|
||||
|
||||
public void SQL_DBConnect()
|
||||
void SQL_DBConnect()
|
||||
{
|
||||
if(gH_SQL != null)
|
||||
{
|
||||
@ -1344,7 +1344,8 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
|
||||
}
|
||||
|
||||
// +strafe block
|
||||
if(gA_StyleSettings[gBS_Style[client]][bBlockPStrafe] && Inconsistency(vel, buttons))
|
||||
if(gA_StyleSettings[gBS_Style[client]][bBlockPStrafe] && // newlining this because it's really long
|
||||
(vel[0] > 0.0 && (buttons & IN_FORWARD) == 0) || (vel[0] < 0.0 && (buttons & IN_BACK) == 0) || (vel[1] < 0.0 && (buttons & IN_MOVELEFT) == 0) || (vel[1] > 0.0 && (buttons & IN_MOVERIGHT) == 0))
|
||||
{
|
||||
float fTime = GetEngineTime();
|
||||
|
||||
@ -1538,13 +1539,8 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public void StopTimer_Cheat(int client, const char[] message)
|
||||
void StopTimer_Cheat(int client, const char[] message)
|
||||
{
|
||||
Shavit_StopTimer(client);
|
||||
Shavit_PrintToChat(client, "%sTimer stopped! %s%s", gS_ChatStrings[sMessageWarning], gS_ChatStrings[sMessageText], message);
|
||||
}
|
||||
|
||||
public bool Inconsistency(const float[] vel, const int buttons)
|
||||
{
|
||||
return ((vel[0] > 0.0 && (buttons & IN_FORWARD) == 0) || (vel[0] < 0.0 && (buttons & IN_BACK) == 0) || (vel[1] < 0.0 && (buttons & IN_MOVELEFT) == 0) || (vel[1] > 0.0 && (buttons & IN_MOVERIGHT) == 0));
|
||||
}
|
||||
|
||||
@ -200,7 +200,7 @@ public Action Command_HUD(int client, int args)
|
||||
return ShowHUDMenu(client, 0);
|
||||
}
|
||||
|
||||
public Action ShowHUDMenu(int client, int item)
|
||||
Action ShowHUDMenu(int client, int item)
|
||||
{
|
||||
if(!IsValidClient(client))
|
||||
{
|
||||
@ -355,7 +355,7 @@ public Action UpdateHUD_Timer(Handle Timer)
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public void TriggerHUDUpdate(int client)
|
||||
void TriggerHUDUpdate(int client)
|
||||
{
|
||||
UpdateHUD(client);
|
||||
SetEntProp(client, Prop_Data, "m_bDrawViewmodel", ((gI_HUDSettings[client] & HUD_HIDEWEAPON) > 0)? 0:1);
|
||||
@ -386,7 +386,7 @@ public void TriggerHUDUpdate(int client)
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateHUD(int client)
|
||||
void UpdateHUD(int client)
|
||||
{
|
||||
int target = GetHUDTarget(client);
|
||||
|
||||
@ -599,7 +599,7 @@ public void UpdateHUD(int client)
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateKeyOverlay(int client, Panel panel, bool &draw)
|
||||
void UpdateKeyOverlay(int client, Panel panel, bool &draw)
|
||||
{
|
||||
if((gI_HUDSettings[client] & HUD_KEYOVERLAY) == 0)
|
||||
{
|
||||
@ -656,7 +656,7 @@ public void Bunnyhop_OnJumpPressed(int client)
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateCenterKeys(int client)
|
||||
void UpdateCenterKeys(int client)
|
||||
{
|
||||
if((gI_HUDSettings[client] & HUD_KEYOVERLAY) == 0)
|
||||
{
|
||||
@ -685,7 +685,7 @@ public void UpdateCenterKeys(int client)
|
||||
PrintCenterText(client, "%s", sCenterText);
|
||||
}
|
||||
|
||||
public void UpdateSpectatorList(int client, Panel panel, bool &draw)
|
||||
void UpdateSpectatorList(int client, Panel panel, bool &draw)
|
||||
{
|
||||
if((gI_HUDSettings[client] & HUD_SPECTATORS) == 0)
|
||||
{
|
||||
@ -742,7 +742,7 @@ public void UpdateSpectatorList(int client, Panel panel, bool &draw)
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateTopLeftHUD(int client, bool wait)
|
||||
void UpdateTopLeftHUD(int client, bool wait)
|
||||
{
|
||||
if((!wait || gI_Cycle % 25 == 0) && (gI_HUDSettings[client] & HUD_TOPLEFT) > 0)
|
||||
{
|
||||
@ -785,7 +785,7 @@ public void UpdateTopLeftHUD(int client, bool wait)
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateKeyHint(int client)
|
||||
void UpdateKeyHint(int client)
|
||||
{
|
||||
if((gI_Cycle % 10) == 0 && ((gI_HUDSettings[client] & HUD_SYNC) > 0 || (gI_HUDSettings[client] & HUD_TIMELEFT) > 0))
|
||||
{
|
||||
@ -857,7 +857,7 @@ public void UpdateKeyHint(int client)
|
||||
}
|
||||
}
|
||||
|
||||
public int GetHUDTarget(int client)
|
||||
int GetHUDTarget(int client)
|
||||
{
|
||||
int target = client;
|
||||
|
||||
@ -879,6 +879,7 @@ public int GetHUDTarget(int client)
|
||||
return target;
|
||||
}
|
||||
|
||||
|
||||
public int PanelHandler_Nothing(Menu m, MenuAction action, int param1, int param2)
|
||||
{
|
||||
// i don't need anything here
|
||||
|
||||
@ -371,7 +371,7 @@ public void OnMapStart()
|
||||
CreateTimer(gF_AdvertisementInterval, Timer_Advertisement, 0, TIMER_FLAG_NO_MAPCHANGE);
|
||||
}
|
||||
|
||||
public bool LoadAdvertisementsConfig()
|
||||
bool LoadAdvertisementsConfig()
|
||||
{
|
||||
gA_Advertisements.Clear();
|
||||
|
||||
@ -588,7 +588,7 @@ public Action Timer_Advertisement(Handle Timer)
|
||||
return Plugin_Stop;
|
||||
}
|
||||
|
||||
public void UpdateScoreboard(int client)
|
||||
void UpdateScoreboard(int client)
|
||||
{
|
||||
float fPB = 0.0;
|
||||
Shavit_GetPlayerPB(client, view_as<BhopStyle>(0), fPB);
|
||||
@ -888,7 +888,7 @@ public int MenuHandler_Teleport(Menu menu, MenuAction action, int param1, int pa
|
||||
char[] info = new char[16];
|
||||
menu.GetItem(param2, info, 16);
|
||||
|
||||
if(Teleport(param1, StringToInt(info)) == -1)
|
||||
if(!Teleport(param1, StringToInt(info)))
|
||||
{
|
||||
Command_Teleport(param1, 0);
|
||||
}
|
||||
@ -902,13 +902,13 @@ public int MenuHandler_Teleport(Menu menu, MenuAction action, int param1, int pa
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int Teleport(int client, int targetserial)
|
||||
bool Teleport(int client, int targetserial)
|
||||
{
|
||||
if(!IsPlayerAlive(client))
|
||||
{
|
||||
Shavit_PrintToChat(client, "You can teleport only if you are alive.");
|
||||
|
||||
return -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
int iTarget = GetClientFromSerial(targetserial);
|
||||
@ -917,14 +917,14 @@ public int Teleport(int client, int targetserial)
|
||||
{
|
||||
Shavit_PrintToChat(client, "You %scannot teleport%s inside the %sstart/end zones%s.", gS_ChatStrings[sMessageWarning], gS_ChatStrings[sMessageText], gS_ChatStrings[sMessageVariable], gS_ChatStrings[sMessageText]);
|
||||
|
||||
return -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
if(iTarget == 0)
|
||||
{
|
||||
Shavit_PrintToChat(client, "Invalid target.");
|
||||
|
||||
return -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
float vecPosition[3];
|
||||
@ -934,7 +934,7 @@ public int Teleport(int client, int targetserial)
|
||||
|
||||
TeleportEntity(client, vecPosition, NULL_VECTOR, NULL_VECTOR);
|
||||
|
||||
return 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
public Action Command_Weapon(int client, int args)
|
||||
@ -999,7 +999,7 @@ public Action Command_Weapon(int client, int args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
public void SetWeaponAmmo(int client, int weapon)
|
||||
void SetWeaponAmmo(int client, int weapon)
|
||||
{
|
||||
int iAmmo = GetEntProp(weapon, Prop_Send, "m_iPrimaryAmmoType");
|
||||
SetEntData(client, gI_Ammo + (iAmmo * 4), 255, 4, true);
|
||||
@ -1212,7 +1212,7 @@ public Action Respawn(Handle Timer, any data)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
public void RestartTimer(int client)
|
||||
void RestartTimer(int client)
|
||||
{
|
||||
if(Shavit_ZoneExists(Zone_Start))
|
||||
{
|
||||
|
||||
@ -203,7 +203,7 @@ public void OnClientPutInServer(int client)
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdatePointsToDatabase(int client)
|
||||
void UpdatePointsToDatabase(int client)
|
||||
{
|
||||
char[] sAuthID3 = new char[32];
|
||||
|
||||
@ -444,7 +444,7 @@ public Action Command_Top(int client, int args)
|
||||
return ShowTopMenu(client);
|
||||
}
|
||||
|
||||
public Action ShowTopMenu(int client)
|
||||
Action ShowTopMenu(int client)
|
||||
{
|
||||
char[] sQuery = new char[192];
|
||||
FormatEx(sQuery, 192, "SELECT name, %s points, auth FROM %susers WHERE points > 0.0 ORDER BY points DESC LIMIT %d;", gB_MySQL? "FORMAT(points, 2)":"points", gS_MySQLPrefix, gI_TopAmount);
|
||||
@ -653,7 +653,7 @@ public void SQL_SetTier_Callback(Database db, DBResultSet results, const char[]
|
||||
UpdateRecordPoints();
|
||||
}
|
||||
|
||||
public void UpdateRecordPoints()
|
||||
void UpdateRecordPoints()
|
||||
{
|
||||
if(gF_MapTier == -1.0)
|
||||
{
|
||||
@ -725,7 +725,7 @@ public void SQL_UpdateRecords_Callback(Database db, DBResultSet results, const c
|
||||
}
|
||||
}
|
||||
|
||||
public void WeighPoints(const char[] auth, int serial)
|
||||
void WeighPoints(const char[] auth, int serial)
|
||||
{
|
||||
if(!gB_MySQL)
|
||||
{
|
||||
@ -755,7 +755,8 @@ public void SQL_WeighPoints_Callback(Database db, DBResultSet results, const cha
|
||||
}
|
||||
}
|
||||
|
||||
public float CalculatePoints(float time, BhopStyle style, float tier)
|
||||
#if defined DEBUG
|
||||
float CalculatePoints(float time, BhopStyle style, float tier)
|
||||
{
|
||||
float fWRTime = 0.0;
|
||||
Shavit_GetWRTime(view_as<BhopStyle>(0), fWRTime);
|
||||
@ -767,6 +768,7 @@ public float CalculatePoints(float time, BhopStyle style, float tier)
|
||||
|
||||
return (((fWRTime / time) * (tier * gF_PointsPerTier)) * view_as<float>(gA_StyleSettings[style][fRankingMultiplier]));
|
||||
}
|
||||
#endif
|
||||
|
||||
public void Shavit_OnFinish_Post(int client, BhopStyle style, float time, int jumps, int strafes, float sync, int rank)
|
||||
{
|
||||
@ -777,7 +779,7 @@ public void Shavit_OnFinish_Post(int client, BhopStyle style, float time, int ju
|
||||
UpdateRecordPoints();
|
||||
}
|
||||
|
||||
public void UpdatePlayerPoints(int client)
|
||||
void UpdatePlayerPoints(int client)
|
||||
{
|
||||
if(!IsClientAuthorized(client))
|
||||
{
|
||||
@ -849,7 +851,7 @@ public void SQL_UpdatePointsTable_Callback(Database db, DBResultSet results, con
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdatePlayerRank(int client)
|
||||
void UpdatePlayerRank(int client)
|
||||
{
|
||||
if(!IsValidClient(client) || gH_SQL == null)
|
||||
{
|
||||
@ -907,7 +909,7 @@ public void SQL_UpdatePlayerRank_Callback(Database db, DBResultSet results, cons
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateRankedPlayers()
|
||||
void UpdateRankedPlayers()
|
||||
{
|
||||
char[] sQuery = new char[128];
|
||||
FormatEx(sQuery, 128, "SELECT COUNT(*) FROM %susers WHERE points > 0.0 LIMIT 1;", gS_MySQLPrefix);
|
||||
@ -956,7 +958,7 @@ public Action CheckForSQLInfo(Handle Timer)
|
||||
return SetSQLInfo();
|
||||
}
|
||||
|
||||
public Action SetSQLInfo()
|
||||
Action SetSQLInfo()
|
||||
{
|
||||
if(gH_SQL == null)
|
||||
{
|
||||
@ -975,7 +977,7 @@ public Action SetSQLInfo()
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public void SQL_SetPrefix()
|
||||
void SQL_SetPrefix()
|
||||
{
|
||||
char[] sFile = new char[PLATFORM_MAX_PATH];
|
||||
BuildPath(Path_SM, sFile, PLATFORM_MAX_PATH, "configs/shavit-prefix.txt");
|
||||
@ -1003,7 +1005,7 @@ public void SQL_SetPrefix()
|
||||
delete fFile;
|
||||
}
|
||||
|
||||
public void SQL_DBConnect()
|
||||
void SQL_DBConnect()
|
||||
{
|
||||
if(gH_SQL != null)
|
||||
{
|
||||
|
||||
@ -379,7 +379,7 @@ public void Shavit_OnChatConfigLoaded()
|
||||
}
|
||||
}
|
||||
|
||||
public bool LoadReplay(BhopStyle style)
|
||||
bool LoadReplay(BhopStyle style)
|
||||
{
|
||||
if(!ReplayEnabled(style))
|
||||
{
|
||||
@ -455,7 +455,7 @@ public bool LoadReplay(BhopStyle style)
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool SaveReplay(BhopStyle style)
|
||||
bool SaveReplay(BhopStyle style)
|
||||
{
|
||||
if(!ReplayEnabled(style))
|
||||
{
|
||||
@ -504,7 +504,7 @@ public bool SaveReplay(BhopStyle style)
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool DeleteReplay(BhopStyle style)
|
||||
bool DeleteReplay(BhopStyle style)
|
||||
{
|
||||
if(!ReplayEnabled(style))
|
||||
{
|
||||
@ -559,7 +559,7 @@ public void OnClientPutInServer(int client)
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateReplayInfo(int client, BhopStyle style, float time)
|
||||
void UpdateReplayInfo(int client, BhopStyle style, float time)
|
||||
{
|
||||
if(!gB_Enabled || !IsValidClient(client) || !IsFakeClient(client))
|
||||
{
|
||||
@ -865,7 +865,7 @@ public Action StartReplay(Handle Timer, any data)
|
||||
return Plugin_Stop;
|
||||
}
|
||||
|
||||
public bool ReplayEnabled(any style)
|
||||
bool ReplayEnabled(any style)
|
||||
{
|
||||
return (!gA_StyleSettings[style][bUnranked] && !gA_StyleSettings[style][bNoReplay]);
|
||||
}
|
||||
@ -969,7 +969,7 @@ public Action Hook_SayText2(UserMsg msg_id, any msg, const int[] players, int pl
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public void ClearFrames(int client)
|
||||
void ClearFrames(int client)
|
||||
{
|
||||
gA_PlayerFrames[client].Clear();
|
||||
gI_PlayerFrames[client] = 0;
|
||||
@ -1083,7 +1083,7 @@ public int DeleteConfirmation_Callback(Menu m, MenuAction action, int param1, in
|
||||
return 0;
|
||||
}
|
||||
|
||||
public BhopStyle GetReplayStyle(int client)
|
||||
BhopStyle GetReplayStyle(int client)
|
||||
{
|
||||
for(int i = 0; i < gI_Styles; i++)
|
||||
{
|
||||
@ -1104,7 +1104,7 @@ public BhopStyle GetReplayStyle(int client)
|
||||
* @param source Input file
|
||||
* @param destination Output file
|
||||
*/
|
||||
stock bool File_Copy(const char[] source, const char[] destination)
|
||||
bool File_Copy(const char[] source, const char[] destination)
|
||||
{
|
||||
File file_source = OpenFile(source, "rb");
|
||||
|
||||
|
||||
@ -188,7 +188,7 @@ public void Shavit_OnFinish_Post(int client, BhopStyle style, float time, int ju
|
||||
}
|
||||
}
|
||||
|
||||
public void PlayEventSound(int client, bool everyone, const char[] sound)
|
||||
void PlayEventSound(int client, bool everyone, const char[] sound)
|
||||
{
|
||||
int[] clients = new int[MaxClients];
|
||||
int count = 0;
|
||||
|
||||
@ -188,7 +188,7 @@ public Action CheckForSQLInfo(Handle Timer)
|
||||
return SetSQLInfo();
|
||||
}
|
||||
|
||||
public Action SetSQLInfo()
|
||||
Action SetSQLInfo()
|
||||
{
|
||||
if(gH_SQL == null)
|
||||
{
|
||||
@ -205,7 +205,7 @@ public Action SetSQLInfo()
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public void SQL_SetPrefix()
|
||||
void SQL_SetPrefix()
|
||||
{
|
||||
char[] sFile = new char[PLATFORM_MAX_PATH];
|
||||
BuildPath(Path_SM, sFile, PLATFORM_MAX_PATH, "configs/shavit-prefix.txt");
|
||||
@ -259,7 +259,7 @@ public void Shavit_OnWorldRecord(int client)
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateWRs(int client)
|
||||
void UpdateWRs(int client)
|
||||
{
|
||||
if(gH_SQL == null)
|
||||
{
|
||||
@ -340,7 +340,7 @@ public Action Command_Profile(int client, int args)
|
||||
return OpenStatsMenu(client, gS_TargetAuth[client]);
|
||||
}
|
||||
|
||||
public Action OpenStatsMenu(int client, const char[] authid)
|
||||
Action OpenStatsMenu(int client, const char[] authid)
|
||||
{
|
||||
// big ass query, looking for optimizations
|
||||
char[] sQuery = new char[2048];
|
||||
@ -532,7 +532,7 @@ public Action Timer_DBFailure(Handle timer, any data)
|
||||
return Plugin_Stop;
|
||||
}
|
||||
|
||||
public void ShowMaps(int client)
|
||||
void ShowMaps(int client)
|
||||
{
|
||||
// database not found, display with a 3 seconds delay
|
||||
if(gH_SQL == null)
|
||||
|
||||
@ -109,7 +109,7 @@ public Action CheckForSQLInfo(Handle Timer)
|
||||
return SetSQLInfo();
|
||||
}
|
||||
|
||||
public Action SetSQLInfo()
|
||||
Action SetSQLInfo()
|
||||
{
|
||||
if(gH_SQL == null)
|
||||
{
|
||||
@ -126,7 +126,7 @@ public Action SetSQLInfo()
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public void SQL_SetPrefix()
|
||||
void SQL_SetPrefix()
|
||||
{
|
||||
char[] sFile = new char[PLATFORM_MAX_PATH];
|
||||
BuildPath(Path_SM, sFile, PLATFORM_MAX_PATH, "configs/shavit-prefix.txt");
|
||||
@ -154,7 +154,7 @@ public void SQL_SetPrefix()
|
||||
delete fFile;
|
||||
}
|
||||
|
||||
public void StartCalculating()
|
||||
void StartCalculating()
|
||||
{
|
||||
if(gH_SQL != null)
|
||||
{
|
||||
@ -235,7 +235,7 @@ public void SQL_GetMapTimes(Database db, DBResultSet results, const char[] error
|
||||
}
|
||||
}
|
||||
|
||||
public void SetLimit(int time)
|
||||
void SetLimit(int time)
|
||||
{
|
||||
gCV_TimeLimit.IntValue = time;
|
||||
gCV_RoundTime.IntValue = time;
|
||||
|
||||
@ -165,7 +165,7 @@ public Action CheckForSQLInfo(Handle Timer)
|
||||
return SetSQLInfo();
|
||||
}
|
||||
|
||||
public Action SetSQLInfo()
|
||||
Action SetSQLInfo()
|
||||
{
|
||||
if(gH_SQL == null)
|
||||
{
|
||||
@ -327,7 +327,7 @@ public void OnClientPutInServer(int client)
|
||||
UpdateClientCache(client);
|
||||
}
|
||||
|
||||
public void UpdateClientCache(int client)
|
||||
void UpdateClientCache(int client)
|
||||
{
|
||||
char sAuthID[32];
|
||||
GetClientAuthId(client, AuthId_Steam3, sAuthID, 32);
|
||||
@ -366,7 +366,7 @@ public void SQL_UpdateCache_Callback(Database db, DBResultSet results, const cha
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateWRCache()
|
||||
void UpdateWRCache()
|
||||
{
|
||||
char sQuery[512];
|
||||
// thanks Ollie Jones from stackoverflow! http://stackoverflow.com/a/36239523/5335680
|
||||
@ -573,7 +573,7 @@ public int MenuHandler_Delete(Menu m, MenuAction action, int param1, int param2)
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void OpenDelete(int client, BhopStyle style)
|
||||
void OpenDelete(int client, BhopStyle style)
|
||||
{
|
||||
char[] sQuery = new char[512];
|
||||
FormatEx(sQuery, 512, "SELECT p.id, u.name, p.time, p.jumps FROM %splayertimes p JOIN %susers u ON p.auth = u.auth WHERE map = '%s' AND style = '%d' ORDER BY time ASC LIMIT 1000;", gS_MySQLPrefix, gS_MySQLPrefix, gS_Map, style);
|
||||
@ -814,10 +814,10 @@ public Action Command_WorldRecord(int client, int args)
|
||||
GetCmdArgString(gS_ClientMap[client], 192);
|
||||
}
|
||||
|
||||
return ShowWRStyleMenu(client, gS_ClientMap[client]);
|
||||
return ShowWRStyleMenu(client);
|
||||
}
|
||||
|
||||
public Action ShowWRStyleMenu(int client, const char[] map)
|
||||
Action ShowWRStyleMenu(int client)
|
||||
{
|
||||
Menu menu = new Menu(MenuHandler_StyleChooser);
|
||||
menu.SetTitle("Choose a style:");
|
||||
@ -842,7 +842,6 @@ public Action ShowWRStyleMenu(int client, const char[] map)
|
||||
}
|
||||
|
||||
menu.ExitButton = true;
|
||||
|
||||
menu.Display(client, 30);
|
||||
|
||||
return Plugin_Handled;
|
||||
@ -882,7 +881,7 @@ public int MenuHandler_StyleChooser(Menu menu, MenuAction action, int param1, in
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void StartWRMenu(int client, const char[] map, int style)
|
||||
void StartWRMenu(int client, const char[] map, int style)
|
||||
{
|
||||
DataPack dp = new DataPack();
|
||||
dp.WriteCell(GetClientSerial(client));
|
||||
@ -1023,13 +1022,13 @@ public int WRMenu_Handler(Menu m, MenuAction action, int param1, int param2)
|
||||
|
||||
else
|
||||
{
|
||||
ShowWRStyleMenu(param1, gS_ClientMap[param1]);
|
||||
ShowWRStyleMenu(param1);
|
||||
}
|
||||
}
|
||||
|
||||
else if(action == MenuAction_Cancel && param2 == MenuCancel_ExitBack)
|
||||
{
|
||||
ShowWRStyleMenu(param1, gS_ClientMap[param1]);
|
||||
ShowWRStyleMenu(param1);
|
||||
}
|
||||
|
||||
else if(action == MenuAction_End)
|
||||
@ -1139,13 +1138,13 @@ public int RRMenu_Handler(Menu m, MenuAction action, int param1, int param2)
|
||||
|
||||
else
|
||||
{
|
||||
ShowWRStyleMenu(param1, gS_ClientMap[param1]);
|
||||
ShowWRStyleMenu(param1);
|
||||
}
|
||||
}
|
||||
|
||||
else if(action == MenuAction_Cancel && param2 == MenuCancel_ExitBack)
|
||||
{
|
||||
ShowWRStyleMenu(param1, gS_ClientMap[param1]);
|
||||
ShowWRStyleMenu(param1);
|
||||
}
|
||||
|
||||
else if(action == MenuAction_End)
|
||||
@ -1156,7 +1155,7 @@ public int RRMenu_Handler(Menu m, MenuAction action, int param1, int param2)
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void OpenSubMenu(int client, int id)
|
||||
void OpenSubMenu(int client, int id)
|
||||
{
|
||||
char[] sQuery = new char[512];
|
||||
FormatEx(sQuery, 512, "SELECT u.name, p.time, p.jumps, p.style, u.auth, p.date, p.map, p.strafes, p.sync, p.points FROM %splayertimes p JOIN %susers u ON p.auth = u.auth WHERE p.id = %d LIMIT 1;", gS_MySQLPrefix, gS_MySQLPrefix, id);
|
||||
@ -1302,7 +1301,7 @@ public int SubMenu_Handler(Menu m, MenuAction action, int param1, int param2)
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void SQL_SetPrefix()
|
||||
void SQL_SetPrefix()
|
||||
{
|
||||
char[] sFile = new char[PLATFORM_MAX_PATH];
|
||||
BuildPath(Path_SM, sFile, PLATFORM_MAX_PATH, "configs/shavit-prefix.txt");
|
||||
@ -1330,7 +1329,7 @@ public void SQL_SetPrefix()
|
||||
delete fFile;
|
||||
}
|
||||
|
||||
public void SQL_DBConnect()
|
||||
void SQL_DBConnect()
|
||||
{
|
||||
if(gH_SQL != null)
|
||||
{
|
||||
@ -1572,7 +1571,7 @@ public void SQL_OnFinish_Callback(Database db, DBResultSet results, const char[]
|
||||
UpdateClientCache(client);
|
||||
}
|
||||
|
||||
public void UpdateLeaderboards()
|
||||
void UpdateLeaderboards()
|
||||
{
|
||||
char[] sQuery = new char[192];
|
||||
FormatEx(sQuery, 192, "SELECT style, time FROM %splayertimes WHERE map = '%s' ORDER BY time ASC;", gS_MySQLPrefix, gS_Map);
|
||||
@ -1619,7 +1618,7 @@ public void SQL_UpdateLeaderboards_Callback(Database db, DBResultSet results, co
|
||||
}
|
||||
}
|
||||
|
||||
public int GetRankForTime(BhopStyle style, float time)
|
||||
int GetRankForTime(BhopStyle style, float time)
|
||||
{
|
||||
if(time < gF_WRTime[style])
|
||||
{
|
||||
|
||||
@ -224,7 +224,7 @@ public Action CheckForSQLInfo(Handle Timer)
|
||||
return SetSQLInfo();
|
||||
}
|
||||
|
||||
public Action SetSQLInfo()
|
||||
Action SetSQLInfo()
|
||||
{
|
||||
if(gH_SQL == null)
|
||||
{
|
||||
@ -341,7 +341,7 @@ public int Native_IsClientCreatingZone(Handle handler, int numParams)
|
||||
return (gI_MapStep[GetNativeCell(1)] != 0);
|
||||
}
|
||||
|
||||
public bool LoadZonesConfig()
|
||||
bool LoadZonesConfig()
|
||||
{
|
||||
char[] sPath = new char[PLATFORM_MAX_PATH];
|
||||
BuildPath(Path_SM, sPath, PLATFORM_MAX_PATH, "configs/shavit-zones.cfg");
|
||||
@ -450,7 +450,7 @@ public void Shavit_OnChatConfigLoaded()
|
||||
}
|
||||
|
||||
// 0 - all zones
|
||||
public void UnloadZones(int zone)
|
||||
void UnloadZones(int zone)
|
||||
{
|
||||
if(!zone)
|
||||
{
|
||||
@ -506,7 +506,7 @@ public void UnloadZones(int zone)
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshZones()
|
||||
void RefreshZones()
|
||||
{
|
||||
char[] sQuery = new char[512];
|
||||
FormatEx(sQuery, 512, "SELECT type, corner1_x, corner1_y, corner1_z, corner2_x, corner2_y, corner2_z, rot_ang, fix1_x, fix1_y, fix2_x, fix2_y, destination_x, destination_y, destination_z FROM %smapzones WHERE map = '%s';", gS_MySQLPrefix, gS_Map);
|
||||
@ -721,7 +721,7 @@ public void SQL_DeleteCustom_Spawn_Callback(Database db, DBResultSet results, co
|
||||
Shavit_PrintToChat(client, "Deleted Custom Spawn sucessfully.");
|
||||
}
|
||||
|
||||
public void ClearCustomSpawn()
|
||||
void ClearCustomSpawn()
|
||||
{
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
@ -957,7 +957,7 @@ public int Select_Type_MenuHandler(Menu menu, MenuAction action, int param1, int
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void Reset(int client)
|
||||
void Reset(int client)
|
||||
{
|
||||
gF_Modifier[client] = 10.0;
|
||||
gI_MapStep[client] = 0;
|
||||
@ -979,7 +979,7 @@ public void Reset(int client)
|
||||
}
|
||||
|
||||
// neat idea for this part is by alongub, you have a cool way of thinking. :)
|
||||
public void ShowPanel(int client, int step)
|
||||
void ShowPanel(int client, int step)
|
||||
{
|
||||
gI_MapStep[client] = step;
|
||||
|
||||
@ -1188,7 +1188,7 @@ public int CreateZoneConfirm_Handler(Menu menu, MenuAction action, int param1, i
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void CreateEditMenu(int client)
|
||||
void CreateEditMenu(int client)
|
||||
{
|
||||
Menu menu = new Menu(CreateZoneConfirm_Handler, MENU_ACTIONS_DEFAULT|MenuAction_DisplayItem);
|
||||
menu.SetTitle("Confirm?");
|
||||
@ -1223,7 +1223,7 @@ public void CreateEditMenu(int client)
|
||||
menu.Display(client, 600);
|
||||
}
|
||||
|
||||
public void CreateAdjustMenu(int client, int page)
|
||||
void CreateAdjustMenu(int client, int page)
|
||||
{
|
||||
Menu hMenu = new Menu(ZoneAdjuster_Handler);
|
||||
hMenu.SetTitle("Adjust the zone's position.\nUse \"sm_modifier <number>\" to set a new modifier.");
|
||||
@ -1307,7 +1307,7 @@ public int ZoneAdjuster_Handler(Menu menu, MenuAction action, int param1, int pa
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void CreateRotateMenu(int client)
|
||||
void CreateRotateMenu(int client)
|
||||
{
|
||||
Menu hMenu = new Menu(ZoneRotate_Handler);
|
||||
hMenu.SetTitle("Rotate the zone.\nUse \"sm_modifier <number>\" to set a new modifier.");
|
||||
@ -1359,7 +1359,7 @@ public int ZoneRotate_Handler(Menu menu, MenuAction action, int param1, int para
|
||||
}
|
||||
}
|
||||
|
||||
public void CreateWidthLengthMenu(int client, int page)
|
||||
void CreateWidthLengthMenu(int client, int page)
|
||||
{
|
||||
Menu hMenu = new Menu(ZoneEdge_Handler);
|
||||
hMenu.SetTitle("Rotate the zone.\nUse \"sm_modifier <number>\" to set a new modifier.");
|
||||
@ -1448,7 +1448,7 @@ public int ZoneEdge_Handler(Menu menu, MenuAction action, int param1, int param2
|
||||
}
|
||||
}
|
||||
|
||||
public bool EmptyZone(float vZone[3])
|
||||
bool EmptyZone(float vZone[3])
|
||||
{
|
||||
if(vZone[0] == 0.0 && vZone[1] == 0.0 && vZone[2] == 0.0)
|
||||
{
|
||||
@ -1458,7 +1458,7 @@ public bool EmptyZone(float vZone[3])
|
||||
return false;
|
||||
}
|
||||
|
||||
public void InsertZone(int client)
|
||||
void InsertZone(int client)
|
||||
{
|
||||
MapZones type = gMZ_Type[client];
|
||||
|
||||
@ -1665,7 +1665,7 @@ public Action Timer_Draw(Handle Timer, any data)
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public bool UsedFixes(float[2][2] fixes)
|
||||
bool UsedFixes(float[2][2] fixes)
|
||||
{
|
||||
for(int a = 0; a < 2; a++)
|
||||
{
|
||||
@ -1692,7 +1692,7 @@ public bool UsedFixes(float[2][2] fixes)
|
||||
* returns true if a player is inside the given zone
|
||||
* returns false if they aren't in it
|
||||
*/
|
||||
public bool InsideZone(int client, int zone)
|
||||
bool InsideZone(int client, int zone)
|
||||
{
|
||||
float playerPos[3];
|
||||
GetEntPropVector(client, Prop_Send, "m_vecOrigin", playerPos);
|
||||
@ -1768,7 +1768,7 @@ public bool InsideZone(int client, int zone)
|
||||
}
|
||||
|
||||
// like InsideZone but for teleport zones
|
||||
public bool InsideTeleportZone(int client, int zone)
|
||||
bool InsideTeleportZone(int client, int zone)
|
||||
{
|
||||
float fPlayerPos[3];
|
||||
GetEntPropVector(client, Prop_Send, "m_vecOrigin", fPlayerPos);
|
||||
@ -1806,7 +1806,7 @@ public bool InsideTeleportZone(int client, int zone)
|
||||
* if client == 0, it draws it for all players in the game
|
||||
* if client index is between 0 and MaxClients+1, it draws for the specified client
|
||||
*/
|
||||
public void DrawZone(float array[8][3], int beamsprite, int halosprite, int color[4], float life)
|
||||
void DrawZone(float array[8][3], int beamsprite, int halosprite, int color[4], float life)
|
||||
{
|
||||
for(int i = 0, i2 = 3; i2 >= 0; i += i2--)
|
||||
{
|
||||
@ -1822,7 +1822,7 @@ public void DrawZone(float array[8][3], int beamsprite, int halosprite, int colo
|
||||
}
|
||||
|
||||
// Rotating point around 2d axis
|
||||
public void PointRotate(float angle, float axis[3], float point[3])
|
||||
void PointRotate(float angle, float axis[3], float point[3])
|
||||
{
|
||||
/*
|
||||
a - rotation degree as radians
|
||||
@ -1860,7 +1860,7 @@ public void PointRotate(float angle, float axis[3], float point[3])
|
||||
}
|
||||
|
||||
// Rotating point around 2d axis with constant sin and cos
|
||||
public void PointConstRotate(float sin, float cos, float axis[3], float point[3])
|
||||
void PointConstRotate(float sin, float cos, float axis[3], float point[3])
|
||||
{
|
||||
/*
|
||||
a - rotation degree as radians
|
||||
@ -1896,7 +1896,7 @@ public void PointConstRotate(float sin, float cos, float axis[3], float point[3]
|
||||
}
|
||||
|
||||
// Translate 2D Point
|
||||
public void PointTranslate(float point[3], float t[2])
|
||||
void PointTranslate(float point[3], float t[2])
|
||||
{
|
||||
point[0] += t[0];
|
||||
point[1] += t[1];
|
||||
@ -1911,7 +1911,7 @@ public void PointTranslate(float point[3], float t[2])
|
||||
* norotate - don't rotate zone points
|
||||
* all - calculate all 8 zone points
|
||||
*/
|
||||
public void CreateZonePoints(float point[8][3], float angle, float fix1[2], float fix2[2], int zone, bool norotate, bool all)
|
||||
void CreateZonePoints(float point[8][3], float angle, float fix1[2], float fix2[2], int zone, bool norotate, bool all)
|
||||
{
|
||||
if(all)
|
||||
{
|
||||
@ -1963,7 +1963,7 @@ public void CreateZonePoints(float point[8][3], float angle, float fix1[2], floa
|
||||
}
|
||||
|
||||
// Translating Zone
|
||||
public void TranslateZone(float point[8][3], float fix1[2], float fix2[2])
|
||||
void TranslateZone(float point[8][3], float fix1[2], float fix2[2])
|
||||
{
|
||||
float fix[2];
|
||||
// X Translate
|
||||
@ -1999,7 +1999,7 @@ public void TranslateZone(float point[8][3], float fix1[2], float fix2[2])
|
||||
}
|
||||
|
||||
//Rotating Zone by constant sin and cos
|
||||
public void RotateZone(float point[8][3], float sin, float cos)
|
||||
void RotateZone(float point[8][3], float sin, float cos)
|
||||
{
|
||||
for(int i = 1; i < 8; i++)
|
||||
{
|
||||
@ -2008,8 +2008,7 @@ public void RotateZone(float point[8][3], float sin, float cos)
|
||||
}
|
||||
|
||||
// thanks a lot for those stuff, I couldn't do it without you blacky!
|
||||
|
||||
public void SQL_SetPrefix()
|
||||
void SQL_SetPrefix()
|
||||
{
|
||||
char[] sFile = new char[PLATFORM_MAX_PATH];
|
||||
BuildPath(Path_SM, sFile, PLATFORM_MAX_PATH, "configs/shavit-prefix.txt");
|
||||
@ -2037,7 +2036,7 @@ public void SQL_SetPrefix()
|
||||
delete fFile;
|
||||
}
|
||||
|
||||
public void SQL_DBConnect()
|
||||
void SQL_DBConnect()
|
||||
{
|
||||
if(gH_SQL != null)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user