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

Dollar Weapon menu


Post New Thread Reply   
 
Thread Tools Display Modes
Yanez98
Junior Member
Join Date: Mar 2024
Old 03-15-2024 , 13:30   Re: Dollar Weapon menu
Reply With Quote #11

So I want to create a weapon menu like csgo2 or valorantba!

On the night of purchase, your current weapon and pistol will disappear, whoever survives the round will keep everything!

That's all I want to solve!
Yanez98 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 03-15-2024 , 14:36   Re: Dollar Weapon menu
Reply With Quote #12

Quote:
Originally Posted by Jhob94 View Post
He doesn't want the weapon to be dropped, as instead you can do this:

Code:
const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90);
const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);

stock kill_weapons(id, dropwhat)
{
	static Weapons[32], Num, i, WeaponID;
	Num = 0;
	get_user_weapons(id, Weapons, Num);
	for(i = 0; i < Num; i ++)
	{
		WeaponID = Weapons[i];
		if((dropwhat == 1 && ((1 << WeaponID) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == 2 && ((1 << WeaponID) & SECONDARY_WEAPONS_BIT_SUM )))
		{
			static DropName[32], WeaponEntity;
			get_weaponname(WeaponID, DropName, charsmax(DropName));
			WeaponEntity = fm_find_ent_by_owner(-1, DropName, id);
			if(pev_valid(WeaponEntity))
			{
				ExecuteHamB(Ham_Weapon_RetireWeapon, WeaponEntity)
				if(ExecuteHamB(Ham_RemovePlayerItem, id, WeaponEntity))
					ExecuteHamB(Ham_Item_Kill, WeaponEntity)
			
				set_pev(id, pev_weapons, pev(id,pev_weapons) & ~(1 << WeaponID))
			}
		}
	}
}
Code:
kill_weapons(id, 1) // Primary weapons
kill_weapons(id, 2) // Secondary weapons
Use this before giving the new weapon, that stock will remove any primary/secondary a person has.
__________________
Jhob94 is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 03-15-2024 , 15:31   Re: Dollar Weapon menu
Reply With Quote #13

@Yanez98

Please specify better what you want.

The plugin gives glock18, hegrenade and flashbang to the player.
-> Keep this or not?
-> And what about the removal of the current pistol for CTs?

The plugin removes the player weapons in the moment the player opens the market menu.
-> Are you sure you do not want to remove the player weapons only after purchase is confirmed?
Attached Files
File Type: sma Get Plugin or Get Source (fegyvermenu.sma - 8 views - 13.8 KB)
File Type: inc colorchat.inc (2.5 KB, 8 views)
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED is offline
Yanez98
Junior Member
Join Date: Mar 2024
Old 03-16-2024 , 16:35   Re: Dollar Weapon menu
Reply With Quote #14

At the beginning, everyone should get a Glock, Heg, and Flash grant, + defuseki, and C4!

I know that it drops when opening the menu, but I want something else instead!

Every Case should have some command, when the person buys, then delete the current weapon and pistol!

That way you don't have to drop when opening the menu!
Yanez98 is offline
Yanez98
Junior Member
Join Date: Mar 2024
Old 03-16-2024 , 16:36   Re: Dollar Weapon menu
Reply With Quote #15

@WATCH_D0GS UNITED

To begin with, everyone gets what is shown in the sma, but in the next round, when someone buys, delete the pistol and weapon they have!!!

So if this can be solved, then the dropping part is not needed!
Yanez98 is offline
Yanez98
Junior Member
Join Date: Mar 2024
Old 03-16-2024 , 16:39   Re: Dollar Weapon menu
Reply With Quote #16

I mean something like that

rg_remove_items_by_slot(const index, const InventorySlotType:slot)
rg_give_item(id, "weapon_m3");
refill_weapons(id);
}
Yanez98 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 03-16-2024 , 16:48   Re: Dollar Weapon menu
Reply With Quote #17

Quote:
Originally Posted by Yanez98 View Post
I mean something like that

rg_remove_items_by_slot(const index, const InventorySlotType:slot)
rg_give_item(id, "weapon_m3");
refill_weapons(id);
}
Again, use my stock. It will remove item by slot.
Kill_weapons(id, slot)
Slot 1 for primary and 2 for secondary
__________________
Jhob94 is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 03-16-2024 , 16:56   Re: Dollar Weapon menu
Reply With Quote #18

Quote:
Originally Posted by Yanez98 View Post
I mean something like that

rg_remove_items_by_slot(const index, const InventorySlotType:slot)
rg_give_item(id, "weapon_m3");
refill_weapons(id);
}
And are you sure you want to remove the player primary weapon if he purchased the primary in the market and then buy the secondary in the market?
Attached Files
File Type: sma Get Plugin or Get Source (fegyvermenu.sma - 8 views - 14.1 KB)
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com

Last edited by WATCH_D0GS UNITED; 03-16-2024 at 16:56.
WATCH_D0GS UNITED is offline
Yanez98
Junior Member
Join Date: Mar 2024
Old 03-17-2024 , 10:33   Re: Dollar Weapon menu
Reply With Quote #19

@WATCH_D0GS UNITED
Yes, primary and secondary weapons should be deleted, but only when the person makes a purchase!
Yanez98 is offline
Tote
Senior Member
Join Date: Jul 2023
Old 03-17-2024 , 10:37   Re: Dollar Weapon menu
Reply With Quote #20

Quote:
Originally Posted by Yanez98 View Post
At the beginning, everyone should get a Glock, Heg, and Flash grant, + defuseki, and C4!

I know that it drops when opening the menu, but I want something else instead!

Every Case should have some command, when the person buys, then delete the current weapon and pistol!

That way you don't have to drop when opening the menu!
Add at the first line of each case strip_user_weapons(id) that is ur solution man, i told u before.
Also, if u want to remove "SPECIFIC" weapon use this

https://forums.alliedmods.net/showthread.php?t=56377
Tote 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 10:57.


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