Skip to content

Commit

Permalink
some love tabs and reordering
Browse files Browse the repository at this point in the history
  • Loading branch information
qawery-just-sad committed May 3, 2021
1 parent d89d95d commit ad9fa0b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
20 changes: 12 additions & 8 deletions addons/sourcemod/scripting/SurfTimer.sp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ public Plugin myinfo =
= Variables =
===================================*/

// It's a surprise tool that will help us later
// int g_CUID[MAXPLAYERS +1];

// Testing Variables
float g_fTick[MAXPLAYERS + 1][2];
float g_fServerLoading[2];
Expand Down Expand Up @@ -1993,6 +1996,7 @@ public void OnClientConnected(int client)
g_bWrcpTimeractivated[client] = false;
g_CurrentStage[client] = 1;
g_wrcpStage2Fix[client] = true;
// g_CUID = GetClientUserId(client);

This comment has been minimized.

Copy link
@DaLLuZZ

DaLLuZZ May 28, 2021

g_CUID[client] maybe???

This comment has been minimized.

Copy link
@qawery-just-sad

qawery-just-sad May 28, 2021

Author Owner

image

}

public void OnClientPutInServer(int client)
Expand Down Expand Up @@ -2047,15 +2051,15 @@ public void OnClientPutInServer(int client)
// char fix
FixPlayerName(client);

// Position Restoring
if (GetConVarBool(g_hcvarRestore))
db_selectLastRun(client);

if (g_bLateLoaded && IsPlayerAlive(client))
PlayerSpawn(client);
{
PlayerSpawn(client);
}

if (g_bTierFound)
{
AnnounceTimer[client] = CreateTimer(20.0, AnnounceMap, client, TIMER_FLAG_NO_MAPCHANGE);
}

if (g_bServerDataLoaded && !g_bSettingsLoaded[client] && !g_bLoadingSettings[client])
{
Expand All @@ -2065,10 +2069,10 @@ public void OnClientPutInServer(int client)
LoadClientSetting(client, g_iSettingToLoad[client]);
}

//display center speed so doesnt have to be re-enabled in options
if (g_bCenterSpeedDisplay[client])
// Position Restoring
if (GetConVarBool(g_hcvarRestore))
{
CreateTimer(0.1, CenterSpeedDisplayTimer, client, TIMER_FLAG_NO_MAPCHANGE|TIMER_REPEAT);
db_selectLastRun(client);
}
}

Expand Down
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/surftimer/misc.sp
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ public bool checkSpam(int client)

stock bool IsValidClient(int client)
{
if (client >= 1 && client <= MaxClients && IsValidEntity(client) && IsClientConnected(client) && IsClientInGame(client))
if (client >= 1 && client <= MaxClients && IsValidEntity(client) && IsClientConnected(client) && IsClientInGame(client) /*&& (g_CUID == GetClientUserID(client))*/)

This comment has been minimized.

Copy link
@DaLLuZZ

DaLLuZZ May 28, 2021

=/

return true;
return false;
}
Expand Down
15 changes: 13 additions & 2 deletions addons/sourcemod/scripting/surftimer/sql.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3213,7 +3213,9 @@ public void db_deleteTmp(int client)
{
char szQuery[256];
if (!IsValidClient(client))
{
return;
}
Format(szQuery, 256, sql_deletePlayerTmp, g_szSteamID[client]);
SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery, client, DBPrio_Low);
}
Expand All @@ -3222,7 +3224,9 @@ public void db_selectLastRun(int client)
{
char szQuery[512];
if (!IsValidClient(client))
return;
{
return;
}
Format(szQuery, 512, sql_selectPlayerTmp, g_szSteamID[client], g_szMapName);
SQL_TQuery(g_hDb, SQL_LastRunCallback, szQuery, client, DBPrio_Low);
}
Expand Down Expand Up @@ -5608,12 +5612,19 @@ public void db_viewPlayerOptionsCallback(Handle owner, Handle hndl, const char[]
g_bSpecListOnly[client] = false;

g_bLoadedModules[client] = true;

//display center speed so doesnt have to be re-enabled in options
if (g_bCenterSpeedDisplay[client])
{
CreateTimer(0.1, CenterSpeedDisplayTimer, client, TIMER_FLAG_NO_MAPCHANGE|TIMER_REPEAT);
}

}
else
{
char szQuery[512];
if (!IsValidClient(client))
return;
return;

// "INSERT INTO ck_playeroptions2 (steamid, timer, hide, sounds, chat, viewmodel, autobhop, checkpoints, centrehud, module1c, module2c, module3c, module4c, module5c, module6c, sidehud, module1s, module2s, module3s, module4s, module5s) VALUES('%s', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i');";

Expand Down

0 comments on commit ad9fa0b

Please sign in to comment.