mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-06 11:53:21 +00:00
CrescendoControl: Properly use floats for flowRate
This commit is contained in:
parent
e0ae644c80
commit
d7c36f7fa7
2 changed files with 5 additions and 3 deletions
Binary file not shown.
|
@ -15,7 +15,7 @@
|
||||||
static ConVar hPercent, hRange;
|
static ConVar hPercent, hRange;
|
||||||
static bool panicStarted;
|
static bool panicStarted;
|
||||||
static float lastButtonPressTime;
|
static float lastButtonPressTime;
|
||||||
static int flowRate[MAXPLAYERS+1];
|
static float flowRate[MAXPLAYERS+1];
|
||||||
|
|
||||||
public Plugin myinfo =
|
public Plugin myinfo =
|
||||||
{
|
{
|
||||||
|
@ -49,12 +49,12 @@ public void OnMapStart() {
|
||||||
public void OnMapEnd() {
|
public void OnMapEnd() {
|
||||||
panicStarted = false;
|
panicStarted = false;
|
||||||
for(int i = 1; i <= MaxClients; i++) {
|
for(int i = 1; i <= MaxClients; i++) {
|
||||||
flowRate[i] = 0;
|
flowRate[i] = 0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnClientDisconnect(int client) {
|
public void OnClientDisconnect(int client) {
|
||||||
flowRate[client] = 0;
|
flowRate[client] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Action Timer_GetFlows(Handle h) {
|
public Action Timer_GetFlows(Handle h) {
|
||||||
|
@ -80,6 +80,8 @@ public Action Event_ButtonPress(const char[] output, int entity, int client, flo
|
||||||
static float pos[3];
|
static float pos[3];
|
||||||
GetEntPropVector(entity, Prop_Send, "m_vecOrigin", pos);
|
GetEntPropVector(entity, Prop_Send, "m_vecOrigin", pos);
|
||||||
float activatorFlow = L4D2Direct_GetFlowDistance(client);
|
float activatorFlow = L4D2Direct_GetFlowDistance(client);
|
||||||
|
|
||||||
|
PrintToConsoleAll("[CC] Button Press by %N", client);
|
||||||
|
|
||||||
if(!IsActivationAllowed(activatorFlow, 1500.0)) {
|
if(!IsActivationAllowed(activatorFlow, 1500.0)) {
|
||||||
ClientCommand(client, "play ui/menu_invalid.wav");
|
ClientCommand(client, "play ui/menu_invalid.wav");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue