Skip to content

Commit

Permalink
Some love for 285
Browse files Browse the repository at this point in the history
Fixed vote extend command (i think can't test)
Fixed missing speed after completing a stage
Made the HUD bigger
When checking profiles rank is displayed correctly
  • Loading branch information
qawery-just-sad committed Jun 8, 2020
1 parent d9aaca6 commit 0a13390
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
4 changes: 2 additions & 2 deletions addons/sourcemod/scripting/SurfTimer.sp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#pragma semicolon 1

// Plugin Info
#define VERSION "285"
#define VERSION "286 - jokes on u"

// Database Definitions
#define MYSQL 0
Expand Down Expand Up @@ -124,7 +124,7 @@
#define MAX_LOCS 1024

//CSGO HUD Hint Fix
#define MAX_HINT_SIZE 225
#define MAX_HINT_SIZE 254

/*====================================
= Enumerations =
Expand Down
6 changes: 6 additions & 0 deletions addons/sourcemod/scripting/surftimer/commands.sp
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,12 @@ public Action Command_normalMode(int client, int args)
return Plugin_Handled;

Client_Stop(client, 1);
g_iCurrentStyle[client] = 0;
g_iInitalStyle[client] = 0;
Format(g_szInitalStyle[client], 128, "Normal");
Format(g_szStyleHud[client], 32, "");
g_bRankedStyle[client] = true;
g_bFunStyle[client] = false;
g_bPracticeMode[client] = false;
Command_Restart(client, 1);

Expand Down
6 changes: 4 additions & 2 deletions addons/sourcemod/scripting/surftimer/cvote.sp
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ public int Handle_VoteMenuExtend(Menu menu, MenuAction action, int param1, int p
GetMenuVoteInfo(param2, votes, totalVotes);

if (strcmp(item, VOTE_NO) == 0 && param1 == 1)
votes = totalVotes - votes;
{
votes = totalVotes - votes;
}

percent = view_as<float>(votes) / view_as<float>(totalVotes);
percent = float(votes / totalVotes);

GetCurrentMaptime();
int iTimeLimit = GetConVarInt(mapTime);
Expand Down
11 changes: 7 additions & 4 deletions addons/sourcemod/scripting/surftimer/misc.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3322,6 +3322,7 @@ public void CenterHudAlive(int client)
case 4: Format(module[i], 128, "LG %s", module[i]);
case 5: Format(module[i], 128, "SM %s", module[i]);
case 6: Format(module[i], 128, "FF %s", module[i]);
case 7: Format(module[i], 128, "FS %s", module[i]);
}
}
}
Expand Down Expand Up @@ -3504,7 +3505,7 @@ public void CenterHudAlive(int client)
if (IsValidEntity(client) && 1 <= client <= MaxClients && !g_bOverlay[client])
{
// PrintCSGOHUDText(client, "<font face=''>%s%s\n%s%s\n%s%s</font>", module[0], module2, module[2], module4, module[4], module6);
PrintCSGOHUDText(client, "<pre><font class='fontSize-sm'>%15s\t %15s\n%15s\t %15s\n%15s\t %15s</font></pre>", module[0], module[1], module[2], module[3], module[4], module[5]);
PrintCSGOHUDText(client, "<pre><font>%15s\t %15s\n%15s\t %15s\n%15s\t %15s</font></pre>", module[0], module[1], module[2], module[3], module[4], module[5]);
}
}
}
Expand Down Expand Up @@ -4632,11 +4633,13 @@ void PrintCSGOHUDText(int client, const char[] format, any ...)
{
char buff[MAX_HINT_SIZE];
VFormat(buff, sizeof(buff), format, 3);
Format(buff, sizeof(buff), "</font>%s ", buff);
Format(buff, sizeof(buff), "</font>%s", buff);

for(int i = strlen(buff); i < sizeof(buff); i++)
for(int i = strlen(buff); i < sizeof(buff) - 1; i++)
buff[i] = '\n';

buff[sizeof(buff) - 1] = '\0';

Protobuf pb = view_as<Protobuf>(StartMessageOne("TextMsg", client, USERMSG_RELIABLE | USERMSG_BLOCKHOOKS));
pb.SetInt("msg_dst", 4);
pb.AddString("params", "#SFUI_ContractKillStart");
Expand All @@ -4647,4 +4650,4 @@ void PrintCSGOHUDText(int client, const char[] format, any ...)
pb.AddString("params", NULL_STRING);

EndMessage();
}
}
3 changes: 2 additions & 1 deletion addons/sourcemod/scripting/surftimer/sql.sp
Original file line number Diff line number Diff line change
Expand Up @@ -2647,7 +2647,8 @@ public void SQL_ViewAllRecordsCallback2(Handle owner, Handle hndl, const char[]
char szSteamId[32];
char szMapName[128];

int rank = SQL_GetRowCount(hndl);
int rank = SQL_FetchInt(hndl,0);

WritePackCell(data, rank);
ResetPack(data);
ReadPackString(data, szName, MAX_NAME_LENGTH);
Expand Down

0 comments on commit 0a13390

Please sign in to comment.