mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-06 18:08:26 +00:00
Added slide zones (#558)
This commit is contained in:
parent
225dd2fadf
commit
990bbb802d
@ -126,6 +126,18 @@
|
||||
"width" "2.5"
|
||||
}
|
||||
|
||||
"Slide"
|
||||
{
|
||||
"visible" "1"
|
||||
|
||||
"red" "244"
|
||||
"green" "66"
|
||||
"blue" "92"
|
||||
|
||||
"alpha" "255"
|
||||
"width" "1.5"
|
||||
}
|
||||
|
||||
"Bonus Start"
|
||||
{
|
||||
"visible" "1"
|
||||
@ -239,5 +251,17 @@
|
||||
"alpha" "175"
|
||||
"width" "1.75"
|
||||
}
|
||||
|
||||
"Bonus Slide"
|
||||
{
|
||||
"visible" "1"
|
||||
|
||||
"red" "244"
|
||||
"green" "66"
|
||||
"blue" "92"
|
||||
|
||||
"alpha" "255"
|
||||
"width" "1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -207,6 +207,7 @@ enum(+=1)
|
||||
Zone_Teleport,
|
||||
Zone_CustomSpawn,
|
||||
Zone_Easybhop,
|
||||
Zone_Slide,
|
||||
ZONETYPES_SIZE
|
||||
};
|
||||
|
||||
|
||||
@ -1070,7 +1070,6 @@ public int Native_ResumeTimer(Handle handler, int numParams)
|
||||
public int Native_StopChatSound(Handle handler, int numParams)
|
||||
{
|
||||
gB_StopChatSound = true;
|
||||
RequestFrame(RevertChatSound);
|
||||
}
|
||||
|
||||
public int Native_PrintToChat(Handle handler, int numParams)
|
||||
@ -1100,6 +1099,8 @@ public int Native_PrintToChat(Handle handler, int numParams)
|
||||
{
|
||||
PrintToChat(client, " %s", buffer);
|
||||
}
|
||||
|
||||
gB_StopChatSound = false;
|
||||
}
|
||||
|
||||
public int Native_RestartTimer(Handle handler, int numParams)
|
||||
@ -1236,11 +1237,6 @@ int GetTimerStatus(int client)
|
||||
return view_as<int>(Timer_Running);
|
||||
}
|
||||
|
||||
public void RevertChatSound(any data)
|
||||
{
|
||||
gB_StopChatSound = false;
|
||||
}
|
||||
|
||||
void StartTimer(int client, int track)
|
||||
{
|
||||
if(!IsValidClient(client, true) || GetClientTeam(client) < 2 || IsFakeClient(client))
|
||||
|
||||
@ -308,7 +308,7 @@ public int Native_ReloadReplay(Handle handler, int numParams)
|
||||
{
|
||||
if(gI_ReplayBotClient[style] == 0)
|
||||
{
|
||||
ServerCommand("bot_add");
|
||||
ServerCommand((gEV_Type != Engine_TF2)? "bot_add":"tf_bot_add");
|
||||
gI_ExpectedBots++;
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,8 @@ char gS_ZoneNames[][] =
|
||||
"No Speed Limit", // ignores velocity limit in that zone
|
||||
"Teleport Zone", // teleports to a defined point
|
||||
"SPAWN POINT", // << unused
|
||||
"Easybhop Zone" // forces easybhop whether if the player is in non-easy styles or if the server has different settings
|
||||
"Easybhop Zone", // forces easybhop whether if the player is in non-easy styles or if the server has different settings
|
||||
"Slide Zone" // allows players to slide, in order to fix parts like the 5th stage of bhop_arcane
|
||||
};
|
||||
|
||||
enum
|
||||
@ -1503,7 +1504,7 @@ public bool TraceFilter_World(int entity, int contentsMask)
|
||||
return (entity == 0);
|
||||
}
|
||||
|
||||
public Action Shavit_OnUserCmdPre(int client, int &buttons, int &impulse, float vel[3], float angles[3], TimerStatus status)
|
||||
public Action Shavit_OnUserCmdPre(int client, int &buttons, int &impulse, float vel[3], float angles[3], TimerStatus status, int track, int style, any stylesettings[STYLESETTINGS_SIZE])
|
||||
{
|
||||
if(gI_MapStep[client] > 0 && gI_MapStep[client] != 3)
|
||||
{
|
||||
@ -1564,9 +1565,33 @@ public Action Shavit_OnUserCmdPre(int client, int &buttons, int &impulse, float
|
||||
}
|
||||
}
|
||||
|
||||
if(InsideZone(client, Zone_Slide, (gB_EnforceTracks)? track:-1) && GetEntPropEnt(client, Prop_Send, "m_hGroundEntity") == -1)
|
||||
{
|
||||
// raytrace down, see if there's 5 distance or less to ground
|
||||
float fPosition[3];
|
||||
GetClientAbsOrigin(client, fPosition);
|
||||
TR_TraceRayFilter(fPosition, view_as<float>({90.0, 0.0, 0.0}), MASK_PLAYERSOLID, RayType_Infinite, TRFilter_NoPlayers, client);
|
||||
|
||||
float fGroundPosition[3];
|
||||
|
||||
if(TR_DidHit() && TR_GetEndPosition(fGroundPosition) && GetVectorDistance(fPosition, fGroundPosition) <= 5.0)
|
||||
{
|
||||
float fSpeed[3];
|
||||
GetEntPropVector(client, Prop_Data, "m_vecAbsVelocity", fSpeed);
|
||||
|
||||
fSpeed[2] = 5.0;
|
||||
TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public bool TRFilter_NoPlayers(int entity, int mask, any data)
|
||||
{
|
||||
return (entity != view_as<int>(data) || (entity < 1 || entity > MaxClients));
|
||||
}
|
||||
|
||||
public int CreateZoneConfirm_Handler(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if(action == MenuAction_Select)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user