Raised This Month: $12 Target: $400
 3% 

Weapons War v7.5 (26 Weapons)


Post New Thread Reply   
 
Thread Tools Display Modes
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 02-07-2018 , 10:42   Re: Weapons War v7.5 (26 Weapons)
Reply With Quote #301

Show this part of code, Instinctpt1:
Code:
enum _:WEAPONSWAR
White Fang, I will review again the code to find the problem.

Last edited by zmd94; 02-07-2018 at 10:43.
zmd94 is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 02-07-2018 , 23:20   Re: Weapons War v7.5 (26 Weapons)
Reply With Quote #302

I already Sent you whole source

I removed Weapontype as i dont need it at all
Here :
HTML Code:
enum _:	WEAPONSWAR
{
	WeaponName[64],
	WeaponID[64],
	WeaponIndex
}
??
instinctpt1 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 02-09-2018 , 21:48   Re: Weapons War v7.5 (26 Weapons)
Reply With Quote #303

White Fang do you enable this cvar?
Code:
g_iKillerView = register_cvar("ww_allow_killer_view", "1") // Allow players see themselves dying from killer's view
Sorry, Instinctpt1. I'm not sure what is the problem. The code should work fine.

Or, maybe you can explain better, what is the problem actually.

Last edited by zmd94; 02-09-2018 at 22:41.
zmd94 is offline
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 02-10-2018 , 03:43   Re: Weapons War v7.5 (26 Weapons)
Reply With Quote #304

Quote:
Originally Posted by zmd94 View Post
White Fang do you enable this cvar?
Code:
g_iKillerView = register_cvar("ww_allow_killer_view", "1") // Allow players see themselves dying from killer's view
Yup
WhiteFang1319 is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 02-10-2018 , 04:29   Re: Weapons War v7.5 (26 Weapons)
Reply With Quote #305

@zmd Can u test the code Yourself or may be just look for the Error ...
Coz the only error which i face is the WeaponDeploy getting Bugged and allowed Other weapon the fire

Here is WeaponWar almost same but lil bit modified , i removed LANG file usage and removed point system coz i dont use that

Please Test yourself or just Verify code, Its the only thing i want brother
Attached Files
File Type: sma Get Plugin or Get Source (cs_war.sma - 87 views - 22.1 KB)
instinctpt1 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 02-10-2018 , 22:04   Re: Weapons War v7.5 (26 Weapons)
Reply With Quote #306

White Fang, now try to disable that cvar. Then, see different.

Instinctpt1, I will test it in my local server and give you the result.

Edit: After test it. There is only small errors in your code. You just need to enable below cvar:
Code:
g_iWeaponDrop = register_cvar("spr_weapon_drop", "1") // 0; Prevent players to drop any weapons || 1; Allow players to drop current war weapon
Set it to "1" instead "0".

This is because the code to malfunction other weapon is being checked using this cvar. See below:
Code:
// Credit to ConnorMcLeod: https://forums.alliedmods.net/showpost.php?p=1238819&postcount=47
public cs_war_WeaponsDeploy(iWeapon)
{
	if(pev_valid(iWeapon) == 2)
	{
		if(g_bInWar)
		{
			if(get_pcvar_num(g_iWeaponDrop))
			{
				new iId = get_pdata_int(iWeapon, m_iId, XO_WEAPONS)
				if(iId != g_WeaponIndex)
				{
					set_pdata_float(iWeapon, m_flNextPrimaryAttack, 99999.0, XO_WEAPONS)
					set_pdata_float(iWeapon, m_flNextSecondaryAttack, 99999.0, XO_WEAPONS)
				}
			}
		}
		else if(g_bLastRoundIsWar)
		{
			set_pdata_float(iWeapon, m_flNextPrimaryAttack, 0.0, XO_WEAPONS)
			set_pdata_float(iWeapon, m_flNextSecondaryAttack, 0.0, XO_WEAPONS)
		}
	}
}
If you want to prevent weapon drop, yet want to have malfunction feature, you can remove the weapon drop cvar check in above code. Then, it will be as below:
Code:
// Credit to ConnorMcLeod: https://forums.alliedmods.net/showpost.php?p=1238819&postcount=47
public cs_war_WeaponsDeploy(iWeapon)
{
	if(pev_valid(iWeapon) == 2)
	{
		if(g_bInWar)
		{
			new iId = get_pdata_int(iWeapon, m_iId, XO_WEAPONS)
			if(iId != g_WeaponIndex)
			{
				set_pdata_float(iWeapon, m_flNextPrimaryAttack, 99999.0, XO_WEAPONS)
				set_pdata_float(iWeapon, m_flNextSecondaryAttack, 99999.0, XO_WEAPONS)
			}
		}
		else if(g_bLastRoundIsWar)
		{
			set_pdata_float(iWeapon, m_flNextPrimaryAttack, 0.0, XO_WEAPONS)
			set_pdata_float(iWeapon, m_flNextSecondaryAttack, 0.0, XO_WEAPONS)
		}
	}
}

Last edited by zmd94; 02-10-2018 at 23:13.
zmd94 is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 02-11-2018 , 00:23   Re: Weapons War v7.5 (26 Weapons)
Reply With Quote #307

Really appreciate your help zmd thanks for your support , i will test my self today and would let you know but as you said above, seeing this explanation, i am pretty sure it would work!!
instinctpt1 is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 02-11-2018 , 06:41   Re: Weapons War v7.5 (26 Weapons)
Reply With Quote #308

Update Zmd !!
The Method you told doesnt actually worked fully so,
Then i started thinking why its happening and Finally i got it and Fixed the Problem

Now the Problem was , When u change the WeaponData - You are changing data for Menu and Weapondeploy both and also for FirstWEPON equip and WeaponDrop which creates a Big Mess as it is hardcoded everywhere, thats why weaponDeploy cant block those weapons which are not listed in your WEAPONSDATA

So i simply Created another constant like Weaponsdata and took menu settings from it and weapondeploy settings from original WEAPONSDATA , Yeah it really fixed everything now anyone can play with the menu and can Add or Remove weapons they dont like in it
So now the Hardcoding mess is also solved !!

I suggest you to take a Look and implement this, so everyone can Use plugin properly and can simply play with Settings
Thanks ZMD94 for all your Support
instinctpt1 is offline
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 02-11-2018 , 07:30   Re: Weapons War v7.5 (26 Weapons)
Reply With Quote #309

Quote:
Originally Posted by zmd94 View Post
White Fang, now try to disable that cvar. Then, see different.
Thanks. It works now
WhiteFang1319 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 02-12-2018 , 08:40   Re: Weapons War v7.5 (26 Weapons)
Reply With Quote #310

Instinctpt1, I'm glad you fix the problem by yourself.

White Fang, if you want to use the Killer View feature, just change below as we need to add more delay to the Auto-Respawn task:
Code:
	if(get_pcvar_num(g_iAutoRespawn))
	{
		set_task(3.0, "AutoRespawn", iVictim+TASK_RESPAWN)
	}
-->
Code:
	if(get_pcvar_num(g_iAutoRespawn))
	{
		set_task(5.0, "AutoRespawn", iVictim+TASK_RESPAWN)
	}

Last edited by zmd94; 02-12-2018 at 08:40.
zmd94 is offline
Reply


Thread Tools
Display Modes

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 04:24.


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