ZSkills: cleaning

This commit is contained in:
neon 2019-07-29 15:29:17 +02:00
parent 470d01a67b
commit 33399428aa

View File

@ -38,10 +38,10 @@ public Plugin myinfo =
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
public void OnPluginStart() public void OnPluginStart()
{ {
g_hCVar_ZAmmo_Enabled = CreateConVar("zr_zammo_enabled", "1", "", FCVAR_NONE, true, 0.0, true, 1.0); g_hCVar_ZAmmo_Enabled = CreateConVar("zr_zammo_enabled", "1", "", FCVAR_NONE, true, 0.0, true, 1.0);
g_hCVar_ZAmmo_Duration = CreateConVar("zr_zammo_duration", "6", "", FCVAR_NONE, true, 1.0); g_hCVar_ZAmmo_Duration = CreateConVar("zr_zammo_duration", "6", "", FCVAR_NONE, true, 1.0);
g_hCVar_ZAmmo_Cost = CreateConVar("zr_zammo_cost", "4500", "", FCVAR_NONE, true, 1.0); g_hCVar_ZAmmo_Cost = CreateConVar("zr_zammo_cost", "4500", "", FCVAR_NONE, true, 1.0);
g_bZAmmo_Enabled = g_hCVar_ZAmmo_Enabled.BoolValue; g_bZAmmo_Enabled = g_hCVar_ZAmmo_Enabled.BoolValue;
if (g_bZAmmo_Enabled) if (g_bZAmmo_Enabled)
HookEvent("weapon_fire", Event_WeaponFire); HookEvent("weapon_fire", Event_WeaponFire);
g_hCVar_ZAmmo_Enabled.AddChangeHook(ConVarChanged); g_hCVar_ZAmmo_Enabled.AddChangeHook(ConVarChanged);
@ -57,8 +57,6 @@ public void OnPluginStart()
RegConsoleCmd("sm_zcleanse", Command_ZCleanse); RegConsoleCmd("sm_zcleanse", Command_ZCleanse);
HookEvent("round_start", Event_RoundStart); HookEvent("round_start", Event_RoundStart);
AutoExecConfig(); AutoExecConfig();
} }
@ -68,6 +66,7 @@ public void OnPluginStart()
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
public void OnMapStart() public void OnMapStart()
{ {
PrecacheSound("items/ammopickup.wav");
PrecacheSound("unloze/extinguish.wav"); PrecacheSound("unloze/extinguish.wav");
AddFileToDownloadsTable("sound/unloze/extinguish.wav"); AddFileToDownloadsTable("sound/unloze/extinguish.wav");
} }
@ -133,6 +132,7 @@ public Action Command_ZAmmo(int client, int args)
g_bZAmmo_Active[client] = true; g_bZAmmo_Active[client] = true;
PrintToChat(client, "[ZAmmo] Enabling Infinite Ammo for %d seconds in exchange for %d$.", iDuration, iCost); PrintToChat(client, "[ZAmmo] Enabling Infinite Ammo for %d seconds in exchange for %d$.", iDuration, iCost);
EmitSoundToAll("items/ammopickup.wav", .entity=client, .volume=0.4);
return Plugin_Handled; return Plugin_Handled;
} }
@ -182,7 +182,6 @@ public Action Command_ZCleanse(int client, int args)
g_bZCleanse_Active[client] = true; g_bZCleanse_Active[client] = true;
g_bZCleanse_Uses[client]++; g_bZCleanse_Uses[client]++;
PrintToChat(client, "[ZCleanse] You are immune against napalm for the next %d seconds. (%d/%d) uses.", iDuration, g_bZCleanse_Uses[client], iMaxUses); PrintToChat(client, "[ZCleanse] You are immune against napalm for the next %d seconds. (%d/%d) uses.", iDuration, g_bZCleanse_Uses[client], iMaxUses);
//EmitSoundToClient(client, "unloze/extinguish.wav", .volume=1.0);
EmitSoundToAll("unloze/extinguish.wav", .entity=client, .volume=0.4); EmitSoundToAll("unloze/extinguish.wav", .entity=client, .volume=0.4);
return Plugin_Handled; return Plugin_Handled;
} }
@ -280,11 +279,11 @@ public void NapalmExtinguishEntity(int client)
{ {
int iFire = GetEntPropEnt(client, Prop_Data, "m_hEffectEntity"); int iFire = GetEntPropEnt(client, Prop_Data, "m_hEffectEntity");
if (IsValidEntity(iFire)) if (IsValidEntity(iFire))
{ {
char sClassName[64]; char sClassName[64];
GetEdictClassname(iFire, sClassName, sizeof(sClassName)); GetEdictClassname(iFire, sClassName, sizeof(sClassName));
if (StrEqual(sClassName, "entityflame", false)) if (StrEqual(sClassName, "entityflame", false))
SetEntPropFloat(iFire, Prop_Data, "m_flLifetime", 0.0); SetEntPropFloat(iFire, Prop_Data, "m_flLifetime", 0.0);
} }
} }