forked from UNLOZE/sm-plugins
Spring break cleanup.
Cleaning up all useless tabs, spaces, indents, you name it.
This commit is contained in:
@@ -9,11 +9,11 @@
|
||||
|
||||
public Plugin myinfo =
|
||||
{
|
||||
name = "MakoVoteSystem",
|
||||
author = "Neon",
|
||||
name = "MakoVoteSystem",
|
||||
author = "Neon",
|
||||
description = "MakoVoteSystem",
|
||||
version = "1.0",
|
||||
url = "https://steamcommunity.com/id/n3ontm"
|
||||
version = "1.0",
|
||||
url = "https://steamcommunity.com/id/n3ontm"
|
||||
}
|
||||
|
||||
#define NUMBEROFSTAGES 6
|
||||
@@ -39,14 +39,14 @@ public void OnPluginStart()
|
||||
public void OnMapStart()
|
||||
{
|
||||
VerifyMap();
|
||||
|
||||
|
||||
PrecacheSound("#unloze/Pendulum - Witchcraft.mp3", true);
|
||||
AddFileToDownloadsTable("sound/unloze/Pendulum - Witchcraft.mp3");
|
||||
|
||||
|
||||
bStartVoteNextRound = false;
|
||||
|
||||
|
||||
for (int i = 0; i <= (NUMBEROFSTAGES - 1); i++)
|
||||
g_bOnCooldown[i] = false;
|
||||
g_bOnCooldown[i] = false;
|
||||
}
|
||||
|
||||
public Action VerifyMap()
|
||||
@@ -73,16 +73,16 @@ public void OnEntitySpawned(int iEntity)
|
||||
{
|
||||
if (g_bVoteFinished)
|
||||
return;
|
||||
|
||||
|
||||
char sTargetname[128];
|
||||
GetEntPropString(iEntity, Prop_Data, "m_iName", sTargetname, sizeof(sTargetname));
|
||||
char sClassname[128];
|
||||
GetEdictClassname(iEntity, sClassname, sizeof(sClassname));
|
||||
|
||||
|
||||
if ((strcmp(sTargetname, "espad") != 0) && (strcmp(sTargetname, "ss_slow") != 0) && (strcmp(sClassname, "ambient_generic") == 0))
|
||||
{
|
||||
AcceptEntityInput(iEntity, "Kill");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
|
||||
@@ -92,87 +92,87 @@ public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
|
||||
g_CountdownTimer = CreateTimer(1.0, StartVote, INVALID_HANDLE, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
|
||||
bStartVoteNextRound = false;
|
||||
}
|
||||
|
||||
|
||||
if (!(g_bVoteFinished))
|
||||
{
|
||||
int iStrip = FindEntityByTargetname(INVALID_ENT_REFERENCE, "race_game_zone", "game_zone_player");
|
||||
{
|
||||
int iStrip = FindEntityByTargetname(INVALID_ENT_REFERENCE, "race_game_zone", "game_zone_player");
|
||||
if (iStrip != INVALID_ENT_REFERENCE)
|
||||
AcceptEntityInput(iStrip, "FireUser1");
|
||||
|
||||
int iCounter = FindEntityByTargetname(INVALID_ENT_REFERENCE, "Level_Counter", "math_counter");
|
||||
|
||||
int iCounter = FindEntityByTargetname(INVALID_ENT_REFERENCE, "Level_Counter", "math_counter");
|
||||
if (iCounter != INVALID_ENT_REFERENCE)
|
||||
AcceptEntityInput(iCounter, "Kill");
|
||||
|
||||
|
||||
int iDestination = FindEntityByTargetname(INVALID_ENT_REFERENCE, "arriba2ex", "info_teleport_destination");
|
||||
if (iDestination != INVALID_ENT_REFERENCE)
|
||||
{
|
||||
|
||||
|
||||
SetVariantString("origin -9350 4550 100");
|
||||
AcceptEntityInput(iDestination, "AddOutput");
|
||||
|
||||
|
||||
SetVariantString("angles 0 -90 0");
|
||||
AcceptEntityInput(iDestination, "AddOutput");
|
||||
AcceptEntityInput(iDestination, "AddOutput");
|
||||
}
|
||||
|
||||
|
||||
int iTeleport = FindEntityByTargetname(INVALID_ENT_REFERENCE, "teleporte_extreme", "trigger_teleport");
|
||||
if (iTeleport != INVALID_ENT_REFERENCE)
|
||||
AcceptEntityInput(iTeleport, "Enable");
|
||||
|
||||
|
||||
int iBarrerasfinal2 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "barrerasfinal2", "func_breakable");
|
||||
if (iBarrerasfinal2 != INVALID_ENT_REFERENCE)
|
||||
AcceptEntityInput(iBarrerasfinal2, "Break");
|
||||
|
||||
|
||||
int iBarrerasfinal = FindEntityByTargetname(INVALID_ENT_REFERENCE, "barrerasfinal", "prop_dynamic");
|
||||
if (iBarrerasfinal != INVALID_ENT_REFERENCE)
|
||||
AcceptEntityInput(iBarrerasfinal, "Kill");
|
||||
|
||||
|
||||
int iPush = FindEntityByTargetname(INVALID_ENT_REFERENCE, "race_push", "trigger_push");
|
||||
if (iPush != INVALID_ENT_REFERENCE)
|
||||
AcceptEntityInput(iPush, "Kill");
|
||||
|
||||
|
||||
int iFilter = FindEntityByTargetname(INVALID_ENT_REFERENCE, "humanos", "filter_activator_team");
|
||||
if (iFilter != INVALID_ENT_REFERENCE)
|
||||
AcceptEntityInput(iFilter, "Kill");
|
||||
|
||||
|
||||
int iTemp1 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "ex2_laser_1_temp", "point_template");
|
||||
if (iTemp1 != INVALID_ENT_REFERENCE)
|
||||
{
|
||||
DispatchKeyValue(iTemp1, "OnEntitySpawned", "ex2_laser_1_hurt,SetDamage,0,0,-1");
|
||||
DispatchKeyValue(iTemp1, "OnEntitySpawned", "ex2_laser_1_hurt,AddOutput,OnStartTouch !activator:AddOutput:origin -7000 -1000 100:0:-1,0,-1");
|
||||
}
|
||||
|
||||
|
||||
int iTemp2 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "ex2_laser_2_temp", "point_template");
|
||||
if (iTemp2 != INVALID_ENT_REFERENCE)
|
||||
{
|
||||
DispatchKeyValue(iTemp2, "OnEntitySpawned", "ex2_laser_2_hurt,SetDamage,0,0,-1");
|
||||
DispatchKeyValue(iTemp2, "OnEntitySpawned", "ex2_laser_2_hurt,AddOutput,OnStartTouch !activator:AddOutput:origin -7000 -1000 100:0:-1,0,-1");
|
||||
}
|
||||
|
||||
|
||||
int iTemp3 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "ex2_laser_3_temp", "point_template");
|
||||
if (iTemp3 != INVALID_ENT_REFERENCE)
|
||||
{
|
||||
DispatchKeyValue(iTemp3, "OnEntitySpawned", "ex2_laser_3_hurt,SetDamage,0,0,-1");
|
||||
DispatchKeyValue(iTemp3, "OnEntitySpawned", "ex2_laser_3_hurt,AddOutput,OnStartTouch !activator:AddOutput:origin -7000 -1000 100:0:-1,0,-1");
|
||||
}
|
||||
|
||||
|
||||
int iTemp4 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "ex2_laser_4_temp", "point_template");
|
||||
if (iTemp4 != INVALID_ENT_REFERENCE)
|
||||
{
|
||||
DispatchKeyValue(iTemp4, "OnEntitySpawned", "ex2_laser_4_hurt,SetDamage,0,0,-1");
|
||||
DispatchKeyValue(iTemp4, "OnEntitySpawned", "ex2_laser_4_hurt,AddOutput,OnStartTouch !activator:AddOutput:origin -7000 -1000 100:0:-1,0,-1");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int iLaserTimer = FindEntityByTargetname(INVALID_ENT_REFERENCE, "cortes2", "logic_timer");
|
||||
if (iLaserTimer != INVALID_ENT_REFERENCE)
|
||||
AcceptEntityInput(iLaserTimer, "Enable");
|
||||
|
||||
|
||||
int iGameText = FindEntityByTargetname(INVALID_ENT_REFERENCE, "Level_Text", "game_text");
|
||||
if (iGameText != INVALID_ENT_REFERENCE)
|
||||
AcceptEntityInput(iGameText, "Kill");
|
||||
|
||||
|
||||
int iNewGameText;
|
||||
iNewGameText = CreateEntityByName("game_text");
|
||||
iNewGameText = CreateEntityByName("game_text");
|
||||
DispatchKeyValue(iNewGameText, "targetname", "intermission_game_text");
|
||||
DispatchKeyValue(iNewGameText, "channel", "4");
|
||||
DispatchKeyValue(iNewGameText, "spawnflags", "1");
|
||||
@@ -189,7 +189,7 @@ public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
|
||||
DispatchSpawn(iNewGameText);
|
||||
SetVariantString("!activator");
|
||||
AcceptEntityInput(iNewGameText, "FireUser1");
|
||||
|
||||
|
||||
int iMusic = FindEntityByTargetname(INVALID_ENT_REFERENCE, "ss_slow", "ambient_generic");
|
||||
if (iMusic != INVALID_ENT_REFERENCE)
|
||||
{
|
||||
@@ -204,7 +204,7 @@ public void GenerateArray()
|
||||
{
|
||||
int iBlockSize = ByteCountToCells(PLATFORM_MAX_PATH);
|
||||
g_StageList = CreateArray(iBlockSize);
|
||||
|
||||
|
||||
for (int i = 0; i <= (NUMBEROFSTAGES - 1); i++)
|
||||
PushArrayString(g_StageList, g_sStageName[i]);
|
||||
|
||||
@@ -225,27 +225,27 @@ public void GenerateArray()
|
||||
public Action Command_StartVote(int args)
|
||||
{
|
||||
int iCurrentStage = GetCurrentStage();
|
||||
|
||||
|
||||
if (iCurrentStage > -1)
|
||||
g_bOnCooldown[iCurrentStage] = true;
|
||||
|
||||
|
||||
int iOnCD = 0;
|
||||
for (int i = 0; i <= (NUMBEROFSTAGES - 1); i++)
|
||||
{
|
||||
if (g_bOnCooldown[i])
|
||||
iOnCD += 1;
|
||||
}
|
||||
|
||||
|
||||
if (iOnCD >= 3)
|
||||
{
|
||||
for (int i = 0; i <= (NUMBEROFSTAGES - 1); i++)
|
||||
g_bOnCooldown[i] = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
g_bVoteFinished = false;
|
||||
GenerateArray();
|
||||
bStartVoteNextRound = true;
|
||||
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ public void InitiateVote()
|
||||
{
|
||||
char sBuffer[128];
|
||||
GetArrayString(g_StageList, i, sBuffer, sizeof(sBuffer));
|
||||
|
||||
|
||||
for (int i = 0; i <= (NUMBEROFSTAGES - 1); i++)
|
||||
{
|
||||
if (strcmp(sBuffer, g_sStageName[i]) == 0)
|
||||
@@ -289,8 +289,8 @@ public void InitiateVote()
|
||||
AddMenuItem(g_VoteMenu, sBuffer, sBuffer, ITEMDRAW_DISABLED);
|
||||
else
|
||||
AddMenuItem(g_VoteMenu, sBuffer, sBuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SetMenuOptionFlags(g_VoteMenu, MENUFLAG_BUTTON_NOVOTE);
|
||||
@@ -306,12 +306,12 @@ public int Handler_MakoVoteMenu(Handle menu, MenuAction action, int param1, int
|
||||
case MenuAction_End:
|
||||
{
|
||||
CloseHandle(menu);
|
||||
|
||||
|
||||
if (param1 != -1)
|
||||
{
|
||||
g_bVoteFinished = true;
|
||||
float fDelay = 3.0;
|
||||
CS_TerminateRound(fDelay, CSRoundEnd_GameStart, false);
|
||||
CS_TerminateRound(fDelay, CSRoundEnd_GameStart, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -328,7 +328,7 @@ public int MenuHandler_NotifyPanel(Menu hMenu, MenuAction iAction, int iParam1,
|
||||
}
|
||||
|
||||
public void Handler_SettingsVoteFinished(Handle menu, int num_votes, int num_clients, const int[][] client_info, int num_items, const int[][] item_info)
|
||||
{
|
||||
{
|
||||
int highest_votes = item_info[0][VOTEINFO_ITEM_VOTES];
|
||||
int required_percent = 60;
|
||||
int required_votes = RoundToCeil(float(num_votes) * float(required_percent) / 100);
|
||||
@@ -362,15 +362,15 @@ public void Handler_VoteFinishedGeneric(Handle menu, int num_votes, int num_clie
|
||||
float fPercentage = float(item_info[0][VOTEINFO_ITEM_VOTES] * 100) / float(num_votes);
|
||||
|
||||
CPrintToChatAll("{green}[MakoVote] {white}Vote Finished! Winner: {red}%s{white} with %d%% of %d votes!", sWinner, RoundToFloor(fPercentage), num_votes);
|
||||
|
||||
|
||||
for (int i = 0; i <= (NUMBEROFSTAGES - 1); i++)
|
||||
{
|
||||
if (strcmp(sWinner, g_sStageName[i]) == 0)
|
||||
g_Winnerstage = i;
|
||||
}
|
||||
|
||||
|
||||
ServerCommand("sm_stage %d", (g_Winnerstage + 4));
|
||||
|
||||
|
||||
float fDelay = 3.0;
|
||||
CS_TerminateRound(fDelay, CSRoundEnd_GameStart, false);
|
||||
}
|
||||
@@ -378,10 +378,10 @@ public void Handler_VoteFinishedGeneric(Handle menu, int num_votes, int num_clie
|
||||
public int GetCurrentStage()
|
||||
{
|
||||
int iLevelCounterEnt = FindEntityByTargetname(INVALID_ENT_REFERENCE, "Level_Counter", "math_counter");
|
||||
|
||||
|
||||
int offset = FindDataMapInfo(iLevelCounterEnt, "m_OutValue");
|
||||
int iCounterVal = RoundFloat(GetEntDataFloat(iLevelCounterEnt, offset));
|
||||
|
||||
|
||||
int iCurrentStage;
|
||||
if (iCounterVal == 5)
|
||||
iCurrentStage = 0;
|
||||
@@ -395,9 +395,9 @@ public int GetCurrentStage()
|
||||
iCurrentStage = 2;
|
||||
else if (iCounterVal == 11)
|
||||
iCurrentStage = 4;
|
||||
else
|
||||
else
|
||||
iCurrentStage = 0;
|
||||
|
||||
|
||||
return iCurrentStage;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user