redid how speed works and enforcing knives more aggresively on zombies
This commit is contained in:
		
							parent
							
								
									962d6ce67f
								
							
						
					
					
						commit
						625e455cd4
					
				@ -858,16 +858,35 @@ public Action LoadClasses()
 | 
				
			|||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
public void OnMapStart()
 | 
					public void OnMapStart()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	g_iToolsVelocity = FindDataMapInfo(0, "m_vecAbsVelocity");
 | 
					    g_iToolsVelocity = FindDataMapInfo(0, "m_vecAbsVelocity");
 | 
				
			||||||
	g_iWave = 1;
 | 
					    g_iWave = 1;
 | 
				
			||||||
	//load content
 | 
					    //load content
 | 
				
			||||||
	AddDownloadContent();
 | 
					    AddDownloadContent();
 | 
				
			||||||
	LoadClasses();
 | 
					    LoadClasses();
 | 
				
			||||||
	LoadExtraSettings();
 | 
					    LoadExtraSettings();
 | 
				
			||||||
	loadWeapons();
 | 
					    loadWeapons();
 | 
				
			||||||
	CreateTimer(2.0, Timer_CheckIfBotsStuck, INVALID_HANDLE, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
 | 
					    CreateTimer(2.0, Timer_CheckIfBotsStuck, INVALID_HANDLE, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
 | 
				
			||||||
	CreateTimer(g_fZMSounds, Timer_zombieSounds, INVALID_HANDLE, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
 | 
					    CreateTimer(g_fZMSounds, Timer_zombieSounds, INVALID_HANDLE, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
 | 
				
			||||||
 | 
					    CreateTimer(2.0, Timer_FixKNife, INVALID_HANDLE, TIMER_REPEAT);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//just checking the knife when they spawn is appereantly not good enough. this is just repeating what Timer_StopProtection does.
 | 
				
			||||||
 | 
					public Action Timer_FixKNife(Handle timer, any userid)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    for (int client = 0; client < MaxClients; client++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        if (IsValidClient(client) && IsPlayerAlive(client))
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (GetPlayerWeaponSlot(client, CS_SLOT_KNIFE) == -1) //just making sure everybody has a knife. otherwise giving them one 
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                GivePlayerItem(client, "weapon_knife");
 | 
				
			||||||
 | 
					                CreateTimer(1.0, Timer_SwitchKnife, GetClientOfUserId(client));
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return Plugin_Handled;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
// Purpose: 
 | 
					// Purpose: 
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
@ -940,17 +959,6 @@ public void OnClientDisconnect(int client)
 | 
				
			|||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
// Purpose: 
 | 
					// Purpose: 
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
public MRESReturn DHook_GetPlayerMaxSpeed(int client, Handle hReturn) 
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	if (client < 1 || client > MaxClients || !IsClientInGame(client) || !IsPlayerAlive(client))
 | 
					 | 
				
			||||||
		return MRES_Ignored;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	DHookSetReturn(hReturn, StringToFloat(g_cSpeed[g_iSpeedIndex[client]][g_iLength]));
 | 
					 | 
				
			||||||
	return MRES_Override;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					 | 
				
			||||||
// Purpose: 
 | 
					 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					 | 
				
			||||||
public void Event_roundStart(Handle event, const char[] name, bool dontBroadcast)
 | 
					public void Event_roundStart(Handle event, const char[] name, bool dontBroadcast)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    g_bRoundInProgress = false;
 | 
					    g_bRoundInProgress = false;
 | 
				
			||||||
@ -1584,6 +1592,8 @@ public Action ModelSelection(int client, int state, int modelIndex)
 | 
				
			|||||||
                g_bFallDamage[client] = true;
 | 
					                g_bFallDamage[client] = true;
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
                g_bFallDamage[client] = false;
 | 
					                g_bFallDamage[client] = false;
 | 
				
			||||||
 | 
					            //setting the class speed simply.
 | 
				
			||||||
 | 
					            SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", StringToFloat(g_cSpeed[g_iSpeedIndex[client]][g_iLength]));
 | 
				
			||||||
            if (state < 2)
 | 
					            if (state < 2)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                CreateTimer(g_fZMSpawnProtection, Timer_StopProtection, GetClientUserId(client));
 | 
					                CreateTimer(g_fZMSpawnProtection, Timer_StopProtection, GetClientUserId(client));
 | 
				
			||||||
@ -1715,9 +1725,10 @@ public Action Timer_StopProtection(Handle timer, any userid)
 | 
				
			|||||||
    int client = GetClientOfUserId(userid); 
 | 
					    int client = GetClientOfUserId(userid); 
 | 
				
			||||||
    if (client == 0) 
 | 
					    if (client == 0) 
 | 
				
			||||||
        return Plugin_Continue; 
 | 
					        return Plugin_Continue; 
 | 
				
			||||||
    if (IsValidClient(client))
 | 
					    if (IsValidClient(client) && IsPlayerAlive(client))
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        g_bClientProtection[client] = false;
 | 
					        g_bClientProtection[client] = false;
 | 
				
			||||||
 | 
					        Client_ChangeWeapon(client, "weapon_knife");
 | 
				
			||||||
        if (GetPlayerWeaponSlot(client, CS_SLOT_KNIFE) == -1) //just making sure everybody has a knife. otherwise giving them one 
 | 
					        if (GetPlayerWeaponSlot(client, CS_SLOT_KNIFE) == -1) //just making sure everybody has a knife. otherwise giving them one 
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            GivePlayerItem(client, "weapon_knife");
 | 
					            GivePlayerItem(client, "weapon_knife");
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user