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-17-2024 , 10:39   Re: Dollar Weapon menu
Reply With Quote #21

Quote:
Originally Posted by Tote View Post
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
Then understand what I'm writing, that Strip solutions are not good in this case!

It has been tested several times in several ways!!!
Yanez98 is offline
Tote
Senior Member
Join Date: Jul 2023
Old 03-17-2024 , 10:39   Re: Dollar Weapon menu
Reply With Quote #22

Quote:
Originally Posted by Yanez98 View Post
@WATCH_D0GS UNITED
Yes, primary and secondary weapons should be deleted, but only when the person makes a purchase!
Thats what i said in the above post.
for ex:

case 1: {
strip_user_weapons(id) // first strip all the weapons
give_item(id, "weapon_ak47") // then give items
give_item(id, "weapon_deagle")
}
etc

EDIT: TO REMOVE SPECIFIC WEAPONS "SPECIAL" use this

https://forums.alliedmods.net/showthread.php?t=56377

Last edited by Tote; 03-17-2024 at 10:43.
Tote is offline
Tote
Senior Member
Join Date: Jul 2023
Old 03-17-2024 , 10:40   Re: Dollar Weapon menu
Reply With Quote #23

Quote:
Originally Posted by Yanez98 View Post
Then understand what I'm writing, that Strip solutions are not good in this case!

It has been tested several times in several ways!!!
WHy not? you want to remove the items player has on each case
Tote is offline
Yanez98
Junior Member
Join Date: Mar 2024
Old 03-17-2024 , 10:44   Re: Dollar Weapon menu
Reply With Quote #24

Quote:
Originally Posted by Tote View Post
WHy not? you want to remove the items player has on each case
I also tried this solution that you just described, but it wasn't perfect!


I think that you deleted all the weapons in this case, + I could also list the things you have, grenade, defuseki, c4 and more, so I want to find another solution, the drop solution that is currently included in the sma is also not good, it can be bugged , right, you open the menu, your weapon is thrown, after that, if you pick it up and buy, you already have two!
And at the strip, he removed everything.

So I only need something for shopping that erases the gun and the pistol as well!
Yanez98 is offline
Tote
Senior Member
Join Date: Jul 2023
Old 03-17-2024 , 10:50   Re: Dollar Weapon menu
Reply With Quote #25

Quote:
Originally Posted by Yanez98 View Post
I also tried this solution that you just described, but it wasn't perfect!


I think that you deleted all the weapons in this case, + I could also list the things you have, grenade, defuseki, c4 and more, so I want to find another solution, the drop solution that is currently included in the sma is also not good, it can be bugged , right, you open the menu, your weapon is thrown, after that, if you pick it up and buy, you already have two!
And at the strip, he removed everything.

So I only need something for shopping that erases the gun and the pistol as well!
Code:
// gives a player a weapon efficiently
stock ham_give_weapon(id,weapon[])
{
    if(!equal(weapon,"weapon_",7)) return 0;

    new wEnt = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,weapon));
    if(!pev_valid(wEnt)) return 0;

    set_pev(wEnt,pev_spawnflags,SF_NORESPAWN);
    dllfunc(DLLFunc_Spawn,wEnt);
    
    if(!ExecuteHamB(Ham_AddPlayerItem,id,wEnt))
    {
        if(pev_valid(wEnt)) set_pev(wEnt,pev_flags,pev(wEnt,pev_flags) | FL_KILLME);
        return 0;
    }

    ExecuteHamB(Ham_Item_AttachToPlayer,wEnt,id)
    return 1;
}
 
// takes a weapon from a player efficiently
stock ham_strip_weapon(id,weapon[])
{
    if(!equal(weapon,"weapon_",7)) return 0;

    new wId = get_weaponid(weapon);
    if(!wId) return 0;

    new wEnt;
    while((wEnt = engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapon)) && pev(wEnt,pev_owner) != id) {}
    if(!wEnt) return 0;

    if(get_user_weapon(id) == wId) ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt);

    if(!ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) return 0;
    ExecuteHamB(Ham_Item_Kill,wEnt);

    set_pev(id,pev_weapons,pev(id,pev_weapons) & ~(1<<wId));

    // this block should be used for Counter-Strike:
    /*if(wId == CSW_C4)
    {
        cs_set_user_plant(id,0,0);
        cs_set_user_bpammo(id,CSW_C4,0);
    }
    else if(wId == CSW_SMOKEGRENADE || wId == CSW_FLASHBANG || wId == CSW_HEGRENADE)
        cs_set_user_bpammo(id,wId,0);*/

    return 1;
}
u can use this
Tote is offline
Tote
Senior Member
Join Date: Jul 2023
Old 03-17-2024 , 10:53   Re: Dollar Weapon menu
Reply With Quote #26

or use this simple for secondary and primary except that c4,def etc

https://forums.alliedmods.net/showthread.php?t=170478
Tote is offline
Yanez98
Junior Member
Join Date: Mar 2024
Old 03-17-2024 , 10:59   Re: Dollar Weapon menu
Reply With Quote #27

Quote:
Originally Posted by Tote View Post
or use this simple for secondary and primary except that c4,def etc

https://forums.alliedmods.net/showthread.php?t=170478
I have not tried this solution yet!
Yanez98 is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 03-17-2024 , 15:51   Re: Dollar Weapon menu
Reply With Quote #28

@Yanez98

Have you downloaded the last script in our last post?

It is already what you want.

DOWNLOAD IT BELOW:
Attached Files
File Type: sma Get Plugin or Get Source (fegyvermenu.sma - 9 views - 14.1 KB)
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED is offline
Yanez98
Junior Member
Join Date: Mar 2024
Old 03-17-2024 , 18:05   Re: Dollar Weapon menu
Reply With Quote #29

Quote:
Originally Posted by WATCH_D0GS UNITED View Post
@Yanez98

Have you downloaded the last script in our last post?

It is already what you want.

DOWNLOAD IT BELOW:
I'll test it right away!
Also, I have 1 more question, when someone swaps, what command can I use to set it so that it is not late at the start?
Yanez98 is offline
Yanez98
Junior Member
Join Date: Mar 2024
Old 03-17-2024 , 18:09   Re: Dollar Weapon menu
Reply With Quote #30

Quote:
Originally Posted by WATCH_D0GS UNITED View Post
@Yanez98

Have you downloaded the last script in our last post?

It is already what you want.

DOWNLOAD IT BELOW:
Unfortunately, it won't do any good this way, it doesn't drop all the weapons, so you still have 2 in your hand!
Yanez98 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 11:29.


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