Skip to content

Commit

Permalink
whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Katsute committed Jul 30, 2023
1 parent 4fcff97 commit b847e24
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 74 deletions.
26 changes: 13 additions & 13 deletions rrm_friendly.sp
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,43 @@ int gEnabled = 0;

public Plugin myinfo =
{
name = "[RRM] Friendly Fire Modifier",
name = "[RRM] Friendly Fire Modifier",
author = "Katsute",
description = "Modifier that sets game to friendly fire",
version = "1.0"
};

public void OnPluginStart()
{
if(RRM_IsRegOpen())
RegisterModifiers();
if(RRM_IsRegOpen())
RegisterModifiers();

AutoExecConfig(true, "rrm_friendly", "rrm");
AutoExecConfig(true, "rrm_friendly", "rrm");
}

public void OnPluginEnd()
{
DisableFriendly();
DisableFriendly();
}

public int RRM_OnRegOpen()
{
RegisterModifiers();
RegisterModifiers();
}

void RegisterModifiers()
{
RRM_Register("Friendly Fire", 0.0, 0.0, false, RRM_Callback_Friendly);
RRM_Register("Friendly Fire", 0.0, 0.0, false, RRM_Callback_Friendly);
}

public int RRM_Callback_Friendly(bool enable, float value)
{
gEnabled = enable;
if(gEnabled)
EnableFriendly();
else
DisableFriendly();
return enable;
gEnabled = enable;
if(gEnabled)
EnableFriendly();
else
DisableFriendly();
return enable;
}

void EnableFriendly()
Expand Down
30 changes: 15 additions & 15 deletions rrm_medieval.sp
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,48 @@ int gEnabled = 0;

public Plugin myinfo =
{
name = "[RRM] Medieval Modifier",
name = "[RRM] Medieval Modifier",
author = "Katsute",
description = "Modifier that sets game to medieval",
version = "1.0"
};

public void OnPluginStart()
{
if(RRM_IsRegOpen())
RegisterModifiers();
if(RRM_IsRegOpen())
RegisterModifiers();

AutoExecConfig(true, "rrm_medieval", "rrm");
AutoExecConfig(true, "rrm_medieval", "rrm");
}

public void OnPluginEnd()
{
DisableMedieval();
DisableMedieval();
}

public int RRM_OnRegOpen()
{
RegisterModifiers();
RegisterModifiers();
}

void RegisterModifiers()
{
RRM_Register("Medieval", 0.0, 0.0, false, RRM_Callback_Medieval);
RRM_Register("Medieval", 0.0, 0.0, false, RRM_Callback_Medieval);
}

public int RRM_Callback_Medieval(bool enable, float value)
{
gEnabled = enable;
if(gEnabled)
EnableMedieval();
else
DisableMedieval();
return enable;
gEnabled = enable;
if(gEnabled)
EnableMedieval();
else
DisableMedieval();
return enable;
}

void EnableMedieval()
{
GameRules_SetProp("m_bPlayingMedieval", 1);
GameRules_SetProp("m_bPlayingMedieval", 1);
for (int i = 1; i < MaxClients; i++)
{
if(!IsClientInGame(i))
Expand All @@ -69,7 +69,7 @@ void EnableMedieval()

void DisableMedieval()
{
GameRules_SetProp("m_bPlayingMedieval", 0);
GameRules_SetProp("m_bPlayingMedieval", 0);
for (int i = 1; i < MaxClients; i++)
{
if(!IsClientInGame(i))
Expand Down
92 changes: 46 additions & 46 deletions rrm_resize.sp
Original file line number Diff line number Diff line change
Expand Up @@ -20,104 +20,104 @@ float gMin = 0.0, gMax = 0.0;

public Plugin myinfo =
{
name = "[RRM] Size Modifier",
name = "[RRM] Size Modifier",
author = "Katsute",
description = "Modifier that resizes players.",
version = "1.0"
};

public void OnPluginStart()
{
cMin = CreateConVar("rrm_size_min", "0.25", "Minimum value for the random number generator.");
cMax = CreateConVar("rrm_size_max", "1.35", "Maximum value for the random number generator.");
cMin = CreateConVar("rrm_size_min", "0.25", "Minimum value for the random number generator.");
cMax = CreateConVar("rrm_size_max", "1.35", "Maximum value for the random number generator.");

cMin.AddChangeHook(OnConvarChanged);
cMax.AddChangeHook(OnConvarChanged);
cMin.AddChangeHook(OnConvarChanged);
cMax.AddChangeHook(OnConvarChanged);

gMin = cMin.FloatValue;
gMax = cMax.FloatValue;
gMin = cMin.FloatValue;
gMax = cMax.FloatValue;

HookEvent("player_spawn", OnPlayerSpawn, EventHookMode_Post);

if(RRM_IsRegOpen())
RegisterModifiers();
if(RRM_IsRegOpen())
RegisterModifiers();

AutoExecConfig(true, "rrm_size", "rrm");
AutoExecConfig(true, "rrm_size", "rrm");
}

public void OnPluginEnd()
{
RemoveSize();
RemoveSize();
}

public int RRM_OnRegOpen()
{
RegisterModifiers();
RegisterModifiers();
}

void RegisterModifiers()
{
RRM_Register("Resize", gMin, gMax, false, RRM_Callback_Size);
RRM_Register("Resize", gMin, gMax, false, RRM_Callback_Size);
}

public void OnConvarChanged(Handle convar, char[] oldValue, char[] newValue)
{
if (StrEqual(oldValue, newValue, true))
return;
if (StrEqual(oldValue, newValue, true))
return;

float fNewValue = StringToFloat(newValue);
float fNewValue = StringToFloat(newValue);

if(convar == cMin)
gMin = fNewValue;
else if(convar == cMax)
gMax = fNewValue;
if(convar == cMin)
gMin = fNewValue;
else if(convar == cMax)
gMax = fNewValue;
}

public Action OnPlayerSpawn(Handle event, const char[] name, bool dontBroadcast)
{
if(!gEnabled)
return Plugin_Continue;
int i = GetClientOfUserId(GetEventInt(event, "userid"));
SetEntPropFloat(i, Prop_Send, "m_flModelScale", gSize);
return Plugin_Continue;
if(!gEnabled)
return Plugin_Continue;
int i = GetClientOfUserId(GetEventInt(event, "userid"));
SetEntPropFloat(i, Prop_Send, "m_flModelScale", gSize);
return Plugin_Continue;
}

public void OnClientPostAdminCheck(int i)
{
if(!gEnabled)
return;
if(!gEnabled)
return;
SetEntPropFloat(i, Prop_Send, "m_flModelScale", gSize);
}

public int RRM_Callback_Size(bool enable, float value)
{
gEnabled = enable;
if(gEnabled)
{
gSize = value;
SetSize();
}
else
RemoveSize();
return gEnabled;
gEnabled = enable;
if(gEnabled)
{
gSize = value;
SetSize();
}
else
RemoveSize();
return gEnabled;
}

void SetSize()
{
for (int i = 1; i <= MaxClients; i++)
{
if(!IsClientInGame(i))
continue;
for (int i = 1; i <= MaxClients; i++)
{
if(!IsClientInGame(i))
continue;
SetEntPropFloat(i, Prop_Send, "m_flModelScale", gSize);
}
}
}

void RemoveSize()
{
for (int i = 1; i <= MaxClients; i++)
{
if(!IsClientInGame(i))
continue;
for (int i = 1; i <= MaxClients; i++)
{
if(!IsClientInGame(i))
continue;
SetEntPropFloat(i, Prop_Send, "m_flModelScale", 1.0);
}
}
}

0 comments on commit b847e24

Please sign in to comment.