Raised This Month: $ Target: $400
 0% 

HideNSeek Knife Round plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
r14170
Veteran Member
Join Date: Dec 2009
Old 03-08-2023 , 03:04   HideNSeek Knife Round plugin
Reply With Quote #1

Hi there.

This is actually the last plugin I need for my server in order for it to be 'finished'!

Im looking for a plugin that would create a knife round after 15 seconds of warmup (so everyone can connect) before the game actually starts. It would give all players only knifes and whichever team wins the knife round - starts automatically as Terrorists (Hiders)

The problem here is that the typical HnS plugin, mine as well, strips the knife from the Terrorists and they can see it but cannot use it. Im not sure If its possible everyone to have a knife (including Ts) for the Knife Round only and then, when it finishes, only the CTs will be left with knives and the Ts will continue to see their knifes but wont be able to use it.

My HnS plugin has the following codes for Ts knifes and one of them makes the knifes unusable:

Code:
 
public Action:OnPlayerRunCmd(iClient, &iButtons, &iImpulse, Float:fVelocity[3], Float:fAngles[3], &icWeapon){
	if(GetClientTeam(iClient)==3 && IsPlayerAlive(iClient)){
		if(g_fHnsCountDown>0.0)
			fVelocity = Float:{0.0, 0.0, 0.0};
		if(iButtons & IN_ATTACK){
			new iWeapon = GetEntPropEnt(iClient, Prop_Send, "m_hActiveWeapon");
			if(IsValidEntity(iWeapon)){
				new String:sWeapon[64];
				GetEntityClassname(iWeapon, sWeapon, sizeof sWeapon);
				if(StrContains(sWeapon, "knife") != -1){
					iButtons ^= IN_ATTACK;
					iButtons |= IN_ATTACK2;
				}
			}
		}
		return Plugin_Changed;
	}
	return Plugin_Continue;
}
Code:
_hnsFixTTNextAttack(iWeapon){
	if(IsValidEntity(iWeapon) && iWeapon>MaxClients){
		new Float:fTime = GetGameTime();
		decl String:sWeapon[64];
		GetEntityClassname(iWeapon, sWeapon, sizeof sWeapon);
		
		if(g_fHnsCountDown>0.0){
			new Float:fNextAttack = (StrContains(sWeapon, "knife") != -1) ? (fTime + 9001.0) : (fTime+g_fHnsCountDown);

			SetEntPropFloat(iWeapon, Prop_Send, "m_flNextPrimaryAttack", fNextAttack);
			SetEntPropFloat(iWeapon, Prop_Send, "m_flNextSecondaryAttack", fNextAttack);
		}
		else{
			if(StrContains(sWeapon, "knife") != -1){
				SetEntPropFloat(iWeapon, Prop_Send, "m_flNextPrimaryAttack", fTime + 9001.0);
				SetEntPropFloat(iWeapon, Prop_Send, "m_flNextSecondaryAttack", fTime + 9001.0);
			}
		}
	}
}
How can I implement what I want and is it even possible?

Thanks!
r14170 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode