Skip to content

Commit

Permalink
Fixed the beacon
Browse files Browse the repository at this point in the history
Fixed the beacon radius. Player freedays now gets removed automatically
at the end of the round.
  • Loading branch information
jonteohr committed Aug 18, 2017
1 parent b378ef8 commit 9330953
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
14 changes: 12 additions & 2 deletions scripting/cmenu.sp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ public OnPluginStart() {
cvRestFreeday = CreateConVar("sm_cmenu_restricted_freeday", "1", "Add an option for a restricted freeday in the menu?\nThis event uses the same configuration as a normal freeday.\n0 = Disable.\n1 = Enable.", FCVAR_NOTIFY, true, 0.0, true, 1.0);
cvEnablePlayerFreeday = CreateConVar("sm_cmenu_player_freeday", "1", "Add an option for giving a specific player a freeday in the menu?\n0 = Disable.\n1 = Enable.", FCVAR_NOTIFY, true, 0.0, true, 1.0);
cvEnableDoors = CreateConVar("sm_cmenu_doors", "1", "sm_warden_cellscmd needs to be set to 1 for this to work!\nAdd an option for opening doors via the menu.\n0 = Disable.\n1 = Enable", FCVAR_NOTIFY, true, 0.0, true, 1.0);
cvBeaconRadius = FindConVar("sm_beacon_radius");

RegConsoleCmd("sm_abortgames", sm_abortgames);
RegConsoleCmd("sm_cmenu", sm_cmenu);
Expand All @@ -152,6 +151,10 @@ public OnPluginStart() {

}

public void OnAllPluginsLoaded() {
cvBeaconRadius = FindConVar("sm_beacon_radius");
}

public void OnClientPutInServer(int client) {
SDKHook(client, SDKHook_OnTakeDamageAlive, OnTakeDamageAlive);
}
Expand Down Expand Up @@ -201,6 +204,13 @@ public void OnRoundStart(Event event, const char[] name, bool dontBroadcast) {

aliveTs = 0;
aliveTs = GetTeamAliveClientCount(CS_TEAM_T);
for(int client = 1; client <= MaxClients; client++) {
if(IsValidClient(client)) {
if(ClientHasFreeday(client)) {
RemoveClientFreeday(client);
}
}
}
}

public void OnMapStart() {
Expand Down Expand Up @@ -1222,7 +1232,7 @@ public Action BeaconTimer(Handle timer, any client) {

if(g_BeamSprite > -1 && g_HaloSprite > -1) {

TE_SetupBeamRingPoint(vec, 10.0, 375.0, g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, beamColor, 10, 0);
TE_SetupBeamRingPoint(vec, 10.0, cvBeaconRadius.FloatValue, g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, beamColor, 10, 0);
TE_SendToAll();

}
Expand Down
2 changes: 1 addition & 1 deletion scripting/include/betterwarden.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#endinput
#endif
#define bwardenincluded
#define VERSION "0.3.5b"
#define VERSION "0.3.5c"

#define a ADMFLAG_RESERVATION
#define b ADMFLAG_GENERIC
Expand Down
1 change: 0 additions & 1 deletion scripting/include/cmenu.inc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ native bool GiveClientFreeday(int client);
* Remove a client's freeday
*
* @param client index
* @param set a beacon
* @return true if successful
*/
native bool RemoveClientFreeday(int client);
Expand Down

0 comments on commit 9330953

Please sign in to comment.