AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Dollar Weapon menu (https://forums.alliedmods.net/showthread.php?t=346728)

Yanez98 03-13-2024 07:55

Dollar Weapon menu
 
1 Attachment(s)
Have a nice day!
We created a dollar weapon menu for Valorantm mode, the problem would be that when you buy a weapon, you don't discard the current one, so you have 2 weapons in your hand.
Then I found a solution on a Turkish forum, but it's not perfect either, it was written in the menu that when you open the menu, your weapon drops, but when you drop it and then pick it up, you'll still have 2 weapons in your hand!!!
Deleting would also be a good solution, if you delete what you have in your hand every time you buy!

Could someone help me with this or send me a similar plugin?

Tote 03-14-2024 10:22

Re: Dollar Weapon menu
 
Hi, you can use function: strip_user_weapons(id) before giving the items to player

For Ex:

strip_user_weapons(id) // it will remove/take off all player weapons
give_item(id, "weapon_knife") // then you will have only knife

Yanez98 03-14-2024 13:47

Re: Dollar Weapon menu
 
Unfortunately, this solution would not be good because whoever survives the round will also take away the weapon from them!

The weapon menu was made for Valorant mode, so I want something similar, it would be good to delete it, but only in case of purchase!

georgik57 03-14-2024 17:00

Re: Dollar Weapon menu
 
engclient_cmd("weapon_ak47; drop")

Tote 03-15-2024 08:08

Re: Dollar Weapon menu
 
Quote:

Originally Posted by Yanez98 (Post 2819480)
Unfortunately, this solution would not be good because whoever survives the round will also take away the weapon from them!

The weapon menu was made for Valorant mode, so I want something similar, it would be good to delete it, but only in case of purchase!

It will not depends Where you put it.
EDIT: will be good if you explain more clearly.
Also, there is a way to make player strip specific weapon.

Tote 03-15-2024 08:09

Re: Dollar Weapon menu
 
Quote:

Originally Posted by georgik57 (Post 2819487)
engclient_cmd("weapon_ak47; drop")

if im right it can be bypassed not good way to do it

georgik57 03-15-2024 08:16

Re: Dollar Weapon menu
 
it can't. this is not slowhacking. it is simulating players sending commands to the server.

EDIT:

PHP 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 drop_weapons(iddropwhat)
{
   static 
Weapons[32], NumiWeaponID;
   
Num 0;
   
get_user_weapons(idWeaponsNum);
   for(
0Num++)
   {
      
WeaponID Weapons[i];
      if((
dropwhat == && ((<< WeaponID) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == && ((<< WeaponID) & SECONDARY_WEAPONS_BIT_SUM )))
      {
         static 
DropName[32], WeaponEntity;
         
get_weaponname(WeaponIDDropNamecharsmax(DropName));
         
WeaponEntity fm_find_ent_by_owner(-1DropNameid);
         
set_pev(WeaponEntitypev_iuser1cs_get_user_bpammo (idWeaponID));
         
engclient_cmd(id"drop"DropName);
         
cs_set_user_bpammo(idWeaponID0);
      }
   }


PHP Code:

drop_weapons(id,1


Jhob94 03-15-2024 10:11

Re: Dollar Weapon menu
 
Quote:

Originally Posted by georgik57 (Post 2819513)
it can't. this is not slowhacking. it is simulating players sending commands to the server.

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


WATCH_D0GS UNITED 03-15-2024 10:13

Re: Dollar Weapon menu
 
2 Attachment(s)
iTs lIkE It WAS A foRmaT eRR0R.

F1X3D

Yanez98 03-15-2024 13:27

Re: Dollar Weapon menu
 
I want you to delete the weapon and pistol in your hand when shopping so that there are no duplicates!

That's all I want!!!
The strip solution will not be good for me, so either rg_remove_item(index1) or a similar solution should be used


All times are GMT -4. The time now is 04:59.

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