Update MakoVote.sp

This commit is contained in:
zaCade 2019-05-13 15:05:43 +02:00
parent 2aefde7ef1
commit 1937e2f413

View File

@ -50,16 +50,19 @@ public Action VerifyMap()
{
char currentMap[64];
GetCurrentMap(currentMap, sizeof(currentMap));
if (!StrEqual(currentMap, "ze_FFVII_Mako_Reactor_v5_3", false))
if (!StrEqual(currentMap, "ze_ffvii_mako_reactor_v5_3", false))
{
char sFilename[256];
GetPluginFilename(INVALID_HANDLE, sFilename, sizeof(sFilename));
ServerCommand("sm plugins unload %s", sFilename);
}
else
{
AddFileToDownloadsTable("sound/unloze/Pendulum - Witchcraft.mp3");
PrecacheSound("#unloze/Pendulum - Witchcraft.mp3", true);
AddFileToDownloadsTable("sound/unloze/Pendulum - Witchcraft.mp3");
}
}
@ -95,18 +98,56 @@ public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
if (!(g_bVoteFinished))
{
int iStrip = FindEntityByTargetname(INVALID_ENT_REFERENCE, "race_game_zone", "game_zone_player");
int iStrip = FindEntityByTargetname(INVALID_ENT_REFERENCE, "RaceZone", "game_zone_player");
if (iStrip != INVALID_ENT_REFERENCE)
AcceptEntityInput(iStrip, "FireUser1");
int iCounter = FindEntityByTargetname(INVALID_ENT_REFERENCE, "Level_Counter", "math_counter");
int iButton1 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "boton", "func_button");
if (iButton1 != INVALID_ENT_REFERENCE)
AcceptEntityInput(iButton1, "Lock");
int iButton2 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "RaceMapButton1", "func_button");
if (iButton2 != INVALID_ENT_REFERENCE)
AcceptEntityInput(iButton2, "Lock");
int iButton3 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "RaceMapButton2", "func_button");
if (iButton3 != INVALID_ENT_REFERENCE)
AcceptEntityInput(iButton3, "Lock");
int iButton4 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "RaceMapButton3", "func_button");
if (iButton4 != INVALID_ENT_REFERENCE)
AcceptEntityInput(iButton4, "Lock");
int iButton5 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "RaceMapButton4", "func_button");
if (iButton5 != INVALID_ENT_REFERENCE)
AcceptEntityInput(iButton5, "Lock");
int iCounter = FindEntityByTargetname(INVALID_ENT_REFERENCE, "LevelCounter", "math_counter");
if (iCounter != INVALID_ENT_REFERENCE)
AcceptEntityInput(iCounter, "Kill");
int iFilter = FindEntityByTargetname(INVALID_ENT_REFERENCE, "humanos", "filter_activator_team");
if (iFilter != INVALID_ENT_REFERENCE)
AcceptEntityInput(iFilter, "Kill");
int iBarrerasfinal = FindEntityByTargetname(INVALID_ENT_REFERENCE, "barrerasfinal", "prop_dynamic");
if (iBarrerasfinal != INVALID_ENT_REFERENCE)
AcceptEntityInput(iBarrerasfinal, "Kill");
int iBarrerasfinal2 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "barrerasfinal2", "func_breakable");
if (iBarrerasfinal2 != INVALID_ENT_REFERENCE)
AcceptEntityInput(iBarrerasfinal2, "Break");
int iLevelText = FindEntityByTargetname(INVALID_ENT_REFERENCE, "LevelText", "game_text");
if (iLevelText != INVALID_ENT_REFERENCE)
{
SetVariantString("message > INTERMISSION ROUND <");
AcceptEntityInput(iLevelText, "AddOutput");
}
int iDestination = FindEntityByTargetname(INVALID_ENT_REFERENCE, "arriba2ex", "info_teleport_destination");
if (iDestination != INVALID_ENT_REFERENCE)
{
SetVariantString("origin -9350 4550 100");
AcceptEntityInput(iDestination, "AddOutput");
@ -114,89 +155,50 @@ public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
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)
int iTemplate1 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "EX2Laser1Temp", "point_template");
if (iTemplate1 != 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");
DispatchKeyValue(iTemplate1, "OnEntitySpawned", "EX2Laser1Hurt,SetDamage,0,0,-1");
DispatchKeyValue(iTemplate1, "OnEntitySpawned", "EX2Laser1Hurt,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)
int iTemplate2 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "EX2Laser2Temp", "point_template");
if (iTemplate2 != 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");
DispatchKeyValue(iTemplate2, "OnEntitySpawned", "EX2Laser2Hurt,SetDamage,0,0,-1");
DispatchKeyValue(iTemplate2, "OnEntitySpawned", "EX2Laser2Hurt,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)
int iTemplate3 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "EX2Laser3Temp", "point_template");
if (iTemplate3 != 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");
DispatchKeyValue(iTemplate3, "OnEntitySpawned", "EX2Laser3Hurt,SetDamage,0,0,-1");
DispatchKeyValue(iTemplate3, "OnEntitySpawned", "EX2Laser3Hurt,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)
int iTemplate4 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "EX2Laser4Temp", "point_template");
if (iTemplate4 != 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");
DispatchKeyValue(iTemplate4, "OnEntitySpawned", "EX2Laser4Hurt,SetDamage,0,0,-1");
DispatchKeyValue(iTemplate4, "OnEntitySpawned", "EX2Laser4Hurt,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");
DispatchKeyValue(iNewGameText, "targetname", "intermission_game_text");
DispatchKeyValue(iNewGameText, "channel", "4");
DispatchKeyValue(iNewGameText, "spawnflags", "1");
DispatchKeyValue(iNewGameText, "color", "255 128 0");
DispatchKeyValue(iNewGameText, "color2", "255 255 0");
DispatchKeyValue(iNewGameText, "fadein", "1");
DispatchKeyValue(iNewGameText, "fadeout", "1");
DispatchKeyValue(iNewGameText, "holdtime", "10");
DispatchKeyValue(iNewGameText, "message", "Intermission Round");
DispatchKeyValue(iNewGameText, "x", "-1");
DispatchKeyValue(iNewGameText, "y", ".01");
DispatchKeyValue(iNewGameText, "OnUser1", "!self,Display,,0,-1");
DispatchKeyValue(iNewGameText, "OnUser1", "!self,FireUser1,,5,-1");
DispatchSpawn(iNewGameText);
SetVariantString("!activator");
AcceptEntityInput(iNewGameText, "FireUser1");
int iMusic = FindEntityByTargetname(INVALID_ENT_REFERENCE, "ss_slow", "ambient_generic");
if (iMusic != INVALID_ENT_REFERENCE)
{
SetVariantString("message #unloze/Pendulum - Witchcraft.mp3");
AcceptEntityInput(iMusic, "AddOutput");
AcceptEntityInput(iMusic, "PlaySound");
}
int iTeleport = FindEntityByTargetname(INVALID_ENT_REFERENCE, "teleporte_extreme", "trigger_teleport");
if (iTeleport != INVALID_ENT_REFERENCE)
AcceptEntityInput(iTeleport, "Enable");
int iTimer = FindEntityByTargetname(INVALID_ENT_REFERENCE, "cortes2", "logic_timer");
if (iTimer != INVALID_ENT_REFERENCE)
AcceptEntityInput(iTimer, "Enable");
}
}
@ -236,7 +238,7 @@ public Action Command_StartVote(int args)
iOnCD += 1;
}
if (iOnCD >= 3)
if (iOnCD >= 4)
{
for (int i = 0; i <= (NUMBEROFSTAGES - 1); i++)
g_bOnCooldown[i] = false;
@ -377,7 +379,7 @@ 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 iLevelCounterEnt = FindEntityByTargetname(INVALID_ENT_REFERENCE, "LevelCounter", "math_counter");
int offset = FindDataMapInfo(iLevelCounterEnt, "m_OutValue");
int iCounterVal = RoundFloat(GetEntDataFloat(iLevelCounterEnt, offset));