Updated to the newest Shavit include and Added a new feature

I added a funktion that works with the completions that gives less credits for players that already have completed the specific map.
This commit is contained in:
SaengerItsWar 2020-07-11 15:28:02 +02:00
parent d6bf08f338
commit 3a749826eb
5 changed files with 353 additions and 84 deletions

4
.gitignore vendored
View file

@ -70,3 +70,7 @@ scripting/include/vector.inc
scripting/include/version.inc
scripting/include/version_auto.inc
scripting/compile.dat
scripting/include/bhopstats.inc
scripting/include/dhooks.inc
scripting/include/rtler.inc
scripting/include/SteamWorks.inc

Binary file not shown.

View file

@ -23,7 +23,7 @@
#endif
#define _shavit_included
#define SHAVIT_VERSION "2.5.7"
#define SHAVIT_VERSION "2.6.0"
#define STYLE_LIMIT 256
#define MAX_ZONES 64
#define MAX_NAME_LENGTH_SQL 32
@ -217,6 +217,8 @@ enum struct timer_snapshot_t
int iTimerTrack;
int iMeasuredJumps;
int iPerfectJumps;
float fTimeOffset[2];
float fDistanceOffset[2];
}
enum struct cp_cache_t
@ -239,6 +241,7 @@ enum struct cp_cache_t
int iClassname;
ArrayList aFrames;
int iPreFrames;
int iTimerPreFrames;
bool bSegmented;
int iSerial;
bool bPractice;
@ -395,11 +398,12 @@ stock void FormatSeconds(float time, char[] newtime, int newtimesize, bool preci
float fSeconds = (iRounded % 60) + fTempTime - iRounded;
char sSeconds[8];
FormatEx(sSeconds, 8, precise? "%s%.03f":"%s%.01f", (time < 0.0)? "-":"", fSeconds);
FormatEx(sSeconds, 8, precise? "%.03f":"%.01f", fSeconds);
if(fTempTime < 60.0)
{
strcopy(newtime, newtimesize, sSeconds);
FormatEx(newtime, newtimesize, "%s%s", (time < 0.0) ? "-":"", sSeconds);
}
else
@ -788,6 +792,17 @@ forward Action Shavit_OnClanTagChangePre(int client, char[] clantag, int clantag
*/
forward void Shavit_OnClanTagChangePost(int client, char[] customtag, int customtaglength);
/**
* Called when a time offset is calculated
*
* @param client Client index.
* @param zonetype Zone type (Zone_Start or Zone_End).
* @param offset Time offset from the given zone.
* @param distance Distance used in time offset.
* @noreturn
*/
forward void Shavit_OnTimeOffsetCalculated(int client, int zonetype, float offset, float distance);
/**
* Called before the timer finish message is printed to the users.
*
@ -1096,6 +1111,16 @@ native void Shavit_GetPlayerPB(int client, int style, float &time, int track);
*/
native float Shavit_GetClientPB(int client, int style, int track);
/**
* Retrieves the completions of a player.
*
* @param client Client index.
* @param style Style to get the Completions for.
* @param track Timer track.
* @return Number of the player's Completions for given style/track.
*/
native int Shavit_GetClientCompletions(int client, int style, int track);
/**
* Get the amount of records on the current map/style on a track.
*
@ -1196,6 +1221,24 @@ native void Shavit_PauseTimer(int client);
*/
native void Shavit_ResumeTimer(int client, bool teleport = false);
/**
* Gets a players time offset given a zone.
*
* @param client Client index.
* @param teleport Zone type (Zone_Start or Zone_End).
* @return Time offset if any for the given zone type.
*/
native float Shavit_GetTimeOffset(int client, int zonetype);
/**
* Gets distance of a players distance offset given a zone.
*
* @param client Client index.
* @param teleport Zone type (Zone_Start or Zone_End).
* @return Distance offset if any for the given zone type/
*/
native float Shavit_GetDistanceOffset(int client, int zonetype);
/**
* Deletes the specified replay file.
* Replay data will be unloaded if necessary.
@ -1387,9 +1430,10 @@ native int Shavit_GetWRCount(int client);
*
* @param style Style index.
* @param StyleSettings Reference to the settings array.
* @param size Size of the StyleSettings buffer, e.g sizeof(stylesettings_t)
* @return SP_ERROR_NONE on success, anything else on failure.
*/
native int Shavit_GetStyleSettings(int style, any StyleSettings[sizeof(stylesettings_t)]);
native int Shavit_GetStyleSettings(int style, any[] StyleSettings, int size = sizeof(stylesettings_t));
/**
* Saves the style related strings on string references.
@ -1463,18 +1507,20 @@ native bool Shavit_IsPracticeMode(int client);
*
* @param client Client index.
* @param snapshot Full snapshot of the client's timer.
* @param size Size of the snapshot buffer, e.g sizeof(timer_snapshot_t)
* @noreturn
*/
native void Shavit_SaveSnapshot(int client, any snapshot[sizeof(timer_snapshot_t)]);
native void Shavit_SaveSnapshot(int client, any[] snapshot, int size = sizeof(timer_snapshot_t));
/**
* Restores the client's timer from a snapshot.
*
* @param client Client index.
* @param snapshot Full snapshot of the client's timer.
* @param size Size of the snapshot buffer, e.g sizeof(timer_snapshot_t)
* @noreturn
*/
native void Shavit_LoadSnapshot(int client, any snapshot[sizeof(timer_snapshot_t)]);
native void Shavit_LoadSnapshot(int client, any[] snapshot, int size = sizeof(timer_snapshot_t));
/**
* Sets a player's replay recording frames from a provided ArrayList.
@ -1495,6 +1541,15 @@ native void Shavit_SetReplayData(int client, ArrayList data);
*/
native ArrayList Shavit_GetReplayData(int client);
/**
* Starts a replay given a style and track.
* @param client Client index.
* @param style Bhop style.
* @param track Timer track.
* @noreturn
*/
native void Shavit_StartReplay(int style, int track, float delay, int client = 1);
/**
* Reloads a specific replay into the replay bot cache.
* Note: Not guaranteed to work with legacy replay bots.
@ -1504,7 +1559,7 @@ native ArrayList Shavit_GetReplayData(int client);
* @param restart Restart the playback of the replay bot if it's playing?
* @param path Path to the replay file. Use `BuildPath(Path_SM, ...)` to generate one. Leave as empty to use default.
* @return Was the replay loaded?
*/
*/
native bool Shavit_ReloadReplay(int style, int track, bool restart, char[] path = "");
/**
@ -1516,6 +1571,16 @@ native bool Shavit_ReloadReplay(int style, int track, bool restart, char[] path
*/
native int Shavit_ReloadReplays(bool restart);
/**
* Gets time from replay frame that is closest to client.
*
* @param Client index.
* @param Client style.
* @param Client track.
* @return Replay time.
*/
native float Shavit_GetClosestReplayTime(int client, int style, int track);
/**
* Use this native to stop the click sound that plays upon chat messages.
* Call it before each Shavit_PrintToChat().
@ -1618,22 +1683,25 @@ native void Shavit_LogMessage(const char[] format, any ...);
*
* @param client Client index
* @param index Index of CP to get
* @param cpcache Buffer to store cp data in
* @param cpcache Buffer to store cp data in sizeof(cp_cache_t)
* @param size Size of the cpcache buffer, e.g sizeof(cp_cache_t)
*
* @noreturn
*/
native bool Shavit_GetCheckpoint(int client, int index, any cpcache[sizeof(cp_cache_t)]);
native bool Shavit_GetCheckpoint(int client, int index, any[] cpcache, int size = sizeof(cp_cache_t));
/**
* Sets checkpoint data at the given index for the given client
*
* @param client Client index
* @param index Index of CP to set, or -1 to push cp as last
* @param cpcache Buffer to store cp data in sizeof(cp_cache_t)
* @param size Size of the cpcache buffer, e.g sizeof(cp_cache_t)
* @param cpcache Buffer with cp data
*
* @noreturn
*/
native void Shavit_SetCheckpoint(int client, int index, any cpcache[sizeof(cp_cache_t)]);
native void Shavit_SetCheckpoint(int client, int index, any[] cpcache, int size = sizeof(cp_cache_t));
/**
* Teleports client to the checkpoint at given index
@ -1730,15 +1798,35 @@ native void Shavit_SetCurrentCheckpoint(int client, int index);
*/
native int Shavit_GetPlayerPreFrame(int client);
/*
* returns the number of timer preframes in the players current run.
*
* @param client Client index
*
* @return Timer preframe count
*/
native int Shavit_GetPlayerTimerFrame(int client);
/*
* Sets player's preframe length.
*
* @param client Client index
* @param preframe preframe length
* @param PreFrame PreFrame length
* @param TimerPreFrame Timer start frame length
*
* @noreturn
*/
native void Shavit_SetPlayerPreFrame(int client, int preframe);
native void Shavit_SetPlayerPreFrame(int client, int PreFrame);
/*
* Sets player's timer preframe length.
*
* @param client Client index
* @param TimerPreFrame Timer start frame length
*
* @noreturn
*/
native void Shavit_SetPlayerTimerFrame(int client, int TimerPreFrame);
// same as Shavit_PrintToChat() but loops through the whole server
// code stolen from the base halflife.inc file
@ -1816,6 +1904,8 @@ public void __pl_shavit_SetNTVOptional()
MarkNativeAsOptional("Shavit_GetStyleSettings");
MarkNativeAsOptional("Shavit_GetStyleStrings");
MarkNativeAsOptional("Shavit_GetSync");
MarkNativeAsOptional("Shavit_GetTimeOffset");
MarkNativeAsOptional("Shavit_GetDistanceOffset");
MarkNativeAsOptional("Shavit_GetTimeForRank");
MarkNativeAsOptional("Shavit_GetTimer");
MarkNativeAsOptional("Shavit_GetTimerStatus");
@ -1850,6 +1940,7 @@ public void __pl_shavit_SetNTVOptional()
MarkNativeAsOptional("Shavit_SaveSnapshot");
MarkNativeAsOptional("Shavit_SetPracticeMode");
MarkNativeAsOptional("Shavit_SetReplayData");
MarkNativeAsOptional("Shavit_StartReplay");
MarkNativeAsOptional("Shavit_StartTimer");
MarkNativeAsOptional("Shavit_StopChatSound");
MarkNativeAsOptional("Shavit_StopTimer");
@ -1868,7 +1959,9 @@ public void __pl_shavit_SetNTVOptional()
MarkNativeAsOptional("Shavit_GetCurrentCheckpoint");
MarkNativeAsOptional("Shavit_SetCurrentCheckpoint");
MarkNativeAsOptional("Shavit_GetPlayerPreFrame");
MarkNativeAsOptional("Shavit_GetPlayerTimerframe");
MarkNativeAsOptional("Shavit_SetPlayerPreFrame");
MarkNativeAsOptional("Shavit_GetPlayerTimerFrame");
MarkNativeAsOptional("Shavit_SetPlayerPreFrame");
MarkNativeAsOptional("Shavit_GetClosestReplayTime");
MarkNativeAsOptional("Shavit_SetPlayerTimerFrame");
}
#endif

View file

@ -6,7 +6,7 @@
#pragma semicolon 1
#pragma newdecls required
#define PLUGIN_VERSION "1.4.2"
#define PLUGIN_VERSION "1.4.3"
chatstrings_t gS_ChatStrings;
stylesettings_t gA_StyleSettings[STYLE_LIMIT];
@ -25,14 +25,20 @@ Convar g_cvWREnabled;
Convar g_cvEnabledPb;
Convar g_cvT1Enabled;
Convar g_cvNormalAmount;
Convar g_cvNormalAmountAgain;
Convar g_cvWrAmount;
Convar g_cvWrAmountAgain;
Convar g_cvPBAmount;
Convar g_cvPBAmountAgain;
Convar g_cvBNormalEnabled;
Convar g_cvBWREnabled;
Convar g_cvEnabledBPb;
Convar g_cvNormalBAmount;
Convar g_cvNormalBAmountAgain;
Convar g_cvWrBAmount;
Convar g_cvWrBAmountAgain;
Convar g_cvBPbAmount;
Convar g_cvBPbAmountAgain;
Convar g_cvTasEnabled;
Convar g_cvNewCalc;
@ -41,6 +47,7 @@ char g_cMap[160];
int g_iTier;
int g_iStyle[MAXPLAYERS+1];
float g_fPB[MAXPLAYERS+1];
int g_iCompletions[MAXPLAYERS+1];
public void OnAllPluginsLoaded()
{
@ -61,20 +68,26 @@ public void OnAllPluginsLoaded()
public void OnPluginStart()
{
LoadTranslations("shavit-credits.phrases");
CreateConVar("shavit_credtis_version", PLUGIN_VERSION, "Zephyrus-Store : Shavit Credits for records", FCVAR_NOTIFY | FCVAR_DONTRECORD);
CreateConVar("shavit_credtis_version", PLUGIN_VERSION, "Kxnrl-Store : Shavit Credits for records", FCVAR_NOTIFY | FCVAR_DONTRECORD);
g_cvNormalEnabled = new Convar("credits_enable_normal", "1", "Enable Store credits given for finishing a map?", 0, true, 0.0, true, 1.0);
g_cvWREnabled = new Convar("credits_enable_wr", "1", "Enable Store credits given for greaking the map Record?", 0, true, 0.0, true, 1.0);
g_cvEnabledPb = new Convar("credits_enable_pb", "1", "Enable Store credits given for breaking the map Personal Best?", 0, true, 0.0, true, 1.0);
g_cvT1Enabled = new Convar("credits_enable_t1", "0", "Enable/Disable given credits for Tier 1. This has no effect on WRs and PBs!", 0, true, 0.0, true, 1.0);
g_cvNormalAmount = new Convar("credits_amount_normal", "10.0", "How many points should be given for finishing a Map?(will be claculated per Tier(amount_normal*Tier))", 0, true, 1.0, false);
g_cvNormalAmountAgain = new Convar("credits_amount_normal_again", "5.0", "How many points should be given for finishing a Map Again?(will be claculated per Tier(amount_normal*Tier))", 0, true, 1.0, false);
g_cvWrAmount = new Convar("credits_amount_wr", "25.0", "How many points should be given for breaking a Map record?(will be calculated per Tier(amount_wr*Tier))", 0, true, 1.0, false);
g_cvWrAmountAgain = new Convar("credits_amount_wr_again", "12.0", "How many points should be given for breaking a Map record Again?(will be calculated per Tier(amount_wr*Tier))", 0, true, 1.0, false);
g_cvPBAmount = new Convar("credits_amount_pb", "10.0", "How many point should be given for breaking the own Personal Best?(will be calculated per Tier(amount_pb*Tier))", 0, true, 1.0, false);
g_cvPBAmountAgain = new Convar("credits_amount_pb_again", "5.0", "How many point should be given for breaking the own Personal Best Again?(will be calculated per Tier(amount_pb*Tier))", 0, true, 1.0, false);
g_cvBNormalEnabled = new Convar("credits_enable_normal_bonus", "0", "Enable Store credits given for finishing a map?", 0, true, 0.0, true, 1.0);
g_cvBWREnabled = new Convar("credits_enable_wr_bonus", "0", "Enable Store credits given for greaking the map Record?", 0, true, 0.0, true, 1.0);
g_cvEnabledBPb = new Convar("credits_enable_pb_bonus", "0", "Enable Store credits given for breaking the map Personal Best?", 0, true, 0.0, true, 1.0);
g_cvNormalBAmount = new Convar("credits_amount_normal_bonus", "10.0", "How many points should be given for finishing a Map?", 0, true, 1.0, false);
g_cvNormalBAmountAgain = new Convar("credits_amount_normal_bonus_again", "5.0", "How many points should be given for finishing a Map Again?", 0, true, 1.0, false);
g_cvWrBAmount = new Convar("credits_amount_wr_bonus", "25.0", "How many points should be given for breaking a Map record?", 0, true, 1.0, false);
g_cvWrBAmountAgain = new Convar("credits_amount_wr_bonus_again", "12.0", "How many points should be given for breaking a Map record Again?", 0, true, 1.0, false);
g_cvBPbAmount = new Convar("credits_amount_pb_bonus", "10.0", "How many point should be given for breaking the own Personal Best?", 0, true, 1.0, false);
g_cvBPbAmountAgain = new Convar("credits_amount_pb_bonus_again", "5.0", "How many point should be given for breaking the own Personal Best Again?", 0, true, 1.0, false);
g_cvTasEnabled = new Convar("credits_tas_enabled", "0", "Enable Store Credits for a TAS Style?", 0, true, 0.0, true, 1.0);
g_cvNewCalc = new Convar("credits_new_calculation", "1", "Enable the New Calculation for the credits?", 0, true, 0.0, true, 1.0);
@ -122,6 +135,7 @@ public void Shavit_OnLeaveZone(int client, int zone, int track, int id, int enti
if (zone == Zone_Start) {
g_iStyle[client] = Shavit_GetBhopStyle(client);
g_fPB[client] = Shavit_GetClientPB(client, g_iStyle[client], track);
g_iCompletions[client] = Shavit_GetClientCompletions(client, g_iStyle[client], track);
}
}
@ -144,23 +158,44 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
if (track == Track_Main)
{
int iCredits;
if (g_cvNewCalc.BoolValue == true)
if (g_iCompletions[client] == 0)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = (g_cvNormalAmount.IntValue * g_iTier) * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
int iCredits;
if (g_cvNewCalc.BoolValue == true)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = (g_cvNormalAmount.IntValue * g_iTier) * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
}
else
{
iCredits = g_cvNormalAmount.IntValue * g_iTier;
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "NormalFinish", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
else
else if (g_iCompletions[client] >=1)
{
iCredits = g_cvNormalAmount.IntValue * g_iTier;
int iCredits;
if (g_cvNewCalc.BoolValue == true)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = (g_cvNormalAmountAgain.IntValue * g_iTier) * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
}
else
{
iCredits = g_cvNormalAmountAgain.IntValue * g_iTier;
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "NormalFinishAgain", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "NormalFinish", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
}
}
@ -169,21 +204,42 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
{
if (track == Track_Bonus)
{
int iCredits;
if (g_cvNewCalc.BoolValue == true)
if (g_iCompletions[client] == 0)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = g_cvNormalBAmount.IntValue * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
int iCredits;
if (g_cvNewCalc.BoolValue == true)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = g_cvNormalBAmount.IntValue * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
}
else
{
iCredits = g_cvNormalBAmount.IntValue;
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "NormalBonusFinish", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
else
else if (g_iCompletions[client] >=1)
{
iCredits = g_cvNormalBAmount.IntValue;
int iCredits;
if (g_cvNewCalc.BoolValue == true)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = g_cvNormalBAmountAgain.IntValue * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
}
else
{
iCredits = g_cvNormalBAmount.IntValue;
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "NormalBonusFinishAgain", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "NormalBonusFinish", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
}
@ -193,21 +249,42 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
{
if (track == Track_Main)
{
int iCredits;
if (g_cvNewCalc.BoolValue == true)
if (g_iCompletions[client] == 0)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = (g_cvPBAmount.IntValue * g_iTier) * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
int iCredits;
if (g_cvNewCalc.BoolValue == true)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = (g_cvPBAmount.IntValue * g_iTier) * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
}
else
{
iCredits = g_cvPBAmount.IntValue * g_iTier;
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "PersonalBest", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
else
else if (g_iCompletions[client] >=1)
{
iCredits = g_cvPBAmount.IntValue * g_iTier;
int iCredits;
if (g_cvNewCalc.BoolValue == true)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = (g_cvPBAmountAgain.IntValue * g_iTier) * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
}
else
{
iCredits = g_cvPBAmount.IntValue * g_iTier;
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "PersonalBestAgain", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "PersonalBest", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
}
}
@ -218,20 +295,42 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
{
if (track == Track_Bonus)
{
int iCredits;
if (g_cvNewCalc.BoolValue == true)
if (g_iCompletions[client] == 0)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = g_cvBPbAmount.IntValue * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
int iCredits;
if (g_cvNewCalc.BoolValue == true)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = g_cvBPbAmount.IntValue * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
}
else
{
iCredits = g_cvBPbAmount.IntValue;
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "BonusPersonalBest", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
else
else if (g_iCompletions[client] >=1)
{
iCredits = g_cvBPbAmount.IntValue;
int iCredits;
if (g_cvNewCalc.BoolValue == true)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = g_cvBPbAmountAgain.IntValue * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
}
else
{
iCredits = g_cvBPbAmount.IntValue;
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "BonusPersonalBestAgain", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "BonusPersonalBest", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
}
}
@ -253,21 +352,42 @@ public void Shavit_OnWorldRecord(int client, int style, float time, int jumps, i
{
if (track == Track_Main)
{
int iCredits;
if (g_cvNewCalc.BoolValue == true)
if (g_iCompletions[client] == 0)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = (g_cvWrAmount.IntValue * g_iTier) * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
int iCredits;
if (g_cvNewCalc.BoolValue == true)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = (g_cvWrAmount.IntValue * g_iTier) * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
}
else
{
iCredits = g_cvWrAmount.IntValue * g_iTier;
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "WorldRecord", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
else
else if (g_iCompletions[client] >=1)
{
iCredits = g_cvWrAmount.IntValue * g_iTier;
int iCredits;
if (g_cvNewCalc.BoolValue == true)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = (g_cvWrAmountAgain.IntValue * g_iTier) * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
}
else
{
iCredits = g_cvWrAmount.IntValue * g_iTier;
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "WorldRecordAgain", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "WorldRecord", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
}
@ -275,22 +395,44 @@ public void Shavit_OnWorldRecord(int client, int style, float time, int jumps, i
{
if (track == Track_Bonus)
{
int iCredits;
if (g_cvNewCalc.BoolValue == true)
if (g_iCompletions[client] == 0)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = g_cvWrBAmount.IntValue * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
int iCredits;
if (g_cvNewCalc.BoolValue == true)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = g_cvWrBAmount.IntValue * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
}
else
{
iCredits = g_cvWrBAmount.IntValue;
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "BonusWorldRecord", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
else
else if (g_iCompletions[client] >=1)
{
iCredits = g_cvWrBAmount.IntValue;
int iCredits;
if (g_cvNewCalc.BoolValue == true)
{
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
float fResult = g_cvWrBAmountAgain.IntValue * fMultiplier;
int iRoundResult = RoundFloat(fResult);
iCredits = iRoundResult;
}
else
{
iCredits = g_cvWrBAmount.IntValue;
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "BonusWorldRecordAgain", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
Store_SetClientCredits(client, Store_GetClientCredits(client) + iCredits);
Shavit_PrintToChat(client, "%t", "BonusWorldRecord", gS_ChatStrings.sVariable, iCredits, gS_ChatStrings.sText);
}
}
}

View file

@ -5,29 +5,59 @@
"#format" "{1:s},{2:d},{3:s}"
"en" "You have earned {1}{2}{3} credits for finishing this map."
}
"NormalFinishAgain"
{
"#format" "{1:s},{2:d},{3:s}"
"en" "You have earned {1}{2}{3} credits for finishing this map again."
}
"NormalBonusFinish"
{
"#format" "{1:s},{2:d},{3:s}"
"en" "You have earned {1}{2}{3} credits for finishing the Bonus of this map."
}
"NormalBonusFinishAgain"
{
"#format" "{1:s},{2:d},{3:s}"
"en" "You have earned {1}{2}{3} credits for finishing the Bonus of this map again."
}
"PersonalBest"
{
"#format" "{1:s},{2:d},{3:s}"
"en" "You have earned {1}{2}{3} credits for breaking your Personal Best."
}
"PersonalBestAgain"
{
"#format" "{1:s},{2:d},{3:s}"
"en" "You have earned {1}{2}{3} credits for breaking your Personal Best again."
}
"BonusPersonalBest"
{
"#format" "{1:s},{2:d},{3:s}"
"en" "You have earned {1}{2}{3} credits for breaking your bonus Personal Best."
}
"BonusPersonalBestAgain"
{
"#format" "{1:s},{2:d},{3:s}"
"en" "You have earned {1}{2}{3} credits for breaking your bonus Personal Best again."
}
"WorldRecord"
{
"#format" "{1:s},{2:d},{3:s}"
"en" "You have earned {1}{2}{3} credits for breaking the WR."
}
"WorldRecordAgain"
{
"#format" "{1:s},{2:d},{3:s}"
"en" "You have earned {1}{2}{3} credits for breaking the WR again."
}
"BonusWorldRecord"
{
"#format" "{1:s},{2:d},{3:s}"
"en" "You have earned {1}{2}{3} credits for breaking the Bonus WR."
}
}
"BonusWorldRecordAgain"
{
"#format" "{1:s},{2:d},{3:s}"
"en" "You have earned {1}{2}{3} credits for breaking the Bonus WR again."
}
}