Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating ck_players for... #557

Draft
wants to merge 17 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions addons/sourcemod/scripting/SurfTimer.sp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void OnLibraryAdded(const char[] name)
return;
int iOffset = GameConfGetOffset(hGameData, "Teleport");
delete hGameData;

if (iOffset == -1)
return;

Expand Down Expand Up @@ -143,7 +143,7 @@ public void OnLibraryRemoved(const char[] name)
}

public void OnEntityCreated(int entity, const char[] classname) {
if( (classname[0] == 't' || classname[0] == 'l') ? (StrEqual(classname, "trigger_teleport", false) ) : false)
if ( (classname[0] == 't' || classname[0] == 'l') ? (StrEqual(classname, "trigger_teleport", false) ) : false)
{
SDKHook(entity, SDKHook_Use, IgnoreTriggers);
SDKHook(entity, SDKHook_StartTouch, IgnoreTriggers);
Expand Down Expand Up @@ -189,7 +189,7 @@ public void OnMapStart()
/// Start Loading Server Settings
ConVar cvHibernateWhenEmpty = FindConVar("sv_hibernate_when_empty");

if(g_tables_converted)
if (g_tables_converted)
{
if (!g_bRenaming && !g_bInTransactionChain && (IsServerProcessing() || !cvHibernateWhenEmpty.BoolValue))
{
Expand Down Expand Up @@ -488,6 +488,7 @@ public void OnClientPutInServer(int client)
g_bLoadingSettings[client] = true;
g_iSettingToLoad[client] = 0;
LoadClientSetting(client, g_iSettingToLoad[client]);
db_InsertUpdatePlayersTable(client);
}
}

Expand Down Expand Up @@ -602,9 +603,9 @@ public void OnClientDisconnect(int client)
sv_noclipspeed.FloatValue = g_iDefaultNoclipSpeed;

//PRINFO
if(IsValidClient(client) && !IsFakeClient(client)){
for(int zonegroup = 0; zonegroup < MAXZONEGROUPS; zonegroup++){
if(g_fTimeIncrement[client][zonegroup] != 0.0)
if (IsValidClient(client) && !IsFakeClient(client)) {
for(int zonegroup = 0; zonegroup < MAXZONEGROUPS; zonegroup++) {
if (g_fTimeIncrement[client][zonegroup] != 0.0)
g_fTimeinZone[client][zonegroup] += g_fTimeIncrement[client][zonegroup];
db_UpdatePRinfo(client, g_szSteamID[client], zonegroup);
}
Expand Down Expand Up @@ -1235,4 +1236,4 @@ public void OnPluginStart()
public Action ItemFoundMsg(UserMsg msg_id, Protobuf msg, const int[] players, int playersNum, bool reliable, bool init)
{
return Plugin_Handled;
}
}
14 changes: 7 additions & 7 deletions addons/sourcemod/scripting/surftimer/api.sp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public int Native_GetMapData(Handle plugin, int numParams)
SetNativeString(1, szname, sizeof(szname), true);
SetNativeString(2, sztime, sizeof(sztime), true);

if(g_fRecordMapTime >= 0)
if (g_fRecordMapTime >= 0)
time = g_fRecordMapTime;
else
time = -1.0;
Expand All @@ -152,13 +152,13 @@ public int Native_GetBonusData(Handle plugin, int numParams)
Format(szname, sizeof(szname), g_szBonusFastest[zonegroup]);
SetNativeString(2, szname, sizeof(szname), true);

if(g_fBonusFastest[zonegroup] > 0)
if (g_fBonusFastest[zonegroup] > 0)
WRtime = g_fBonusFastest[zonegroup];
else
WRtime = -1.0;
SetNativeCellRef(3, WRtime);

if(g_fPersonalRecordBonus[zonegroup][client] > 0)
if (g_fPersonalRecordBonus[zonegroup][client] > 0)
PBtime = g_fPersonalRecordBonus[zonegroup][client];
else
PBtime = -1.0;
Expand All @@ -181,13 +181,13 @@ public int Native_GetStageData(Handle plugin, int numParams)
Format(szname, sizeof(szname), g_szStageRecordPlayer[stage]);
SetNativeString(2, szname, sizeof(szname), true);

if(g_fStageRecord[stage] != 0.0)
if (g_fStageRecord[stage] != 0.0)
WRtime = g_fStageRecord[stage];
else
WRtime = -1.0;
SetNativeCellRef(3, WRtime);

if(g_fWrcpRecord[client][stage][g_iCurrentStyle[client]] != -1.0)
if (g_fWrcpRecord[client][stage][g_iCurrentStyle[client]] != -1.0)
PBtime = g_fWrcpRecord[client][stage][g_iCurrentStyle[client]];
else
PBtime = -1.0;
Expand Down Expand Up @@ -254,10 +254,10 @@ public int Native_GetClientStyle(Handle plugin, int numParams)
int style;
if (IsValidClient(client))
{
if(!IsFakeClient(client)) {
if (!IsFakeClient(client)) {
style = g_iCurrentStyle[client];
}
else{
else {
if (client == g_RecordBot)
style = g_iSelectedReplayStyle;
else if (client == g_BonusBot)
Expand Down
8 changes: 4 additions & 4 deletions addons/sourcemod/scripting/surftimer/buttonpress.sp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public void CL_OnEndTimerPress(int client)
if (style == 0)
{
//ADD LAST TIME TO CP DATA
if(g_bhasStages)
if (g_bhasStages)
g_fCheckpointTimesNew[zGroup][client][g_TotalStages-1] = g_fFinalTime[client];
else
g_fCheckpointTimesNew[zGroup][client][g_iTotalCheckpoints] = g_fFinalTime[client];
Expand Down Expand Up @@ -825,7 +825,7 @@ public void CL_OnStartWrcpTimerPress(int client)
if (!g_bSpectate[client] && !g_bNoClip[client] && ((GetGameTime() - g_fLastTimeNoClipUsed[client]) > 2.0))
{
int zGroup = g_iClientInZone[client][2];
if(zGroup != 0)
if (zGroup != 0)
{
return;
}
Expand Down Expand Up @@ -905,7 +905,7 @@ public void CL_OnStartWrcpTimerPress(int client)
continue;

int ObserverMode = GetEntProp(i, Prop_Send, "m_iObserverMode");
if(ObserverMode != 4 && ObserverMode != 5)
if (ObserverMode != 4 && ObserverMode != 5)
continue;

int ObserverTarget = GetEntPropEnt(i, Prop_Send, "m_hObserverTarget");
Expand Down Expand Up @@ -1048,7 +1048,7 @@ public void CL_OnStartPracSrcpTimerPress(int client)
int zGroup = g_iClientInZone[client][2];


if(zGroup != 0)
if (zGroup != 0)
{
return;
}
Expand Down
Loading