Raised This Month: $ Target: $400
 0% 

Don't give usp and glock


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gravi123
Member
Join Date: Feb 2016
Old 01-24-2017 , 08:18   Don't give usp and glock
Reply With Quote #1

As title says, is there a way not to give team weapons when round stats not using strip_user_weapon
gravi123 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-24-2017 , 08:21   Re: Don't give usp and glock
Reply With Quote #2

It only gives in de_ maps and some others , in surf_ maps it doesn't.
__________________
edon1337 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-24-2017 , 11:57   Re: Don't give usp and glock
Reply With Quote #3

Quote:
Originally Posted by edon1337 View Post
It only gives in de_ maps and some others , in surf_ maps it doesn't.
That makes absolutely no sense.

You can use this

PHP Code:
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) == wIdExecuteHamB(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));

    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;

Use

PHP Code:
ham_strip_weapon(id,"weapon_glock18"
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-24-2017 at 11:58.
EFFx is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-24-2017 , 13:54   Re: Don't give usp and glock
Reply With Quote #4

https://forums.alliedmods.net/showthread.php?t=217673
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-24-2017 , 14:14   Re: Don't give usp and glock
Reply With Quote #5

Simply remove the "game_player_equip" entity.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
gravi123
Member
Join Date: Feb 2016
Old 01-24-2017 , 15:17   Re: Don't give usp and glock
Reply With Quote #6

How do i remove the entity?
gravi123 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-24-2017 , 17:07   Re: Don't give usp and glock
Reply With Quote #7

Quote:
Originally Posted by EFFx View Post
That makes absolutely no sense.

You can use this

PHP Code:
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) == wIdExecuteHamB(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));

    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;

Use

PHP Code:
ham_strip_weapon(id,"weapon_glock18"
It doesn't give me Glock/ USP on surf maps. Actually the stock you pasted doesn't make any sense.

Try this
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>

#define PLUGIN "Remove game_player_equip entity"
#define VERSION "1.0"
#define AUTHOR "DoNii"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    static 
ent  
    ent 
= -1  
    
    
while ((ent find_ent_by_class(ent"game_player_equip")))  
    {          
        if(
pev_valid(ent)) remove_entity(ent)  
    }  

__________________

Last edited by edon1337; 01-24-2017 at 17:13.
edon1337 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-24-2017 , 17:08   Re: Don't give usp and glock
Reply With Quote #8

I was talking about your solution dude. He doesn't cares what map gives the default team's pistol. He just want not give they. He want a method for don't give these weapons, not what map this don't.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-24-2017 , 17:12   Re: Don't give usp and glock
Reply With Quote #9

Quote:
Originally Posted by OciXCrom View Post
Simply remove the "game_player_equip" entity.
you can remove it in plugin_precache() >> forward, by using fakemeta or engine dosent really matter..

PHP Code:


public plugin_precache()
{
            
// this engine way...
            
new iEnt = -1;
            while( (
iEnt find_ent_by_class(iEnt"game_player_equip") > 0)
            {
                    if(
pev_valid(iEnt)) remove_entity(iEnt);
            }

ops didnt see @edon post ^_^

Last edited by Natsheh; 01-24-2017 at 17:19.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
gravi123
Member
Join Date: Feb 2016
Old 01-25-2017 , 06:44   Re: Don't give usp and glock
Reply With Quote #10

PHP Code:
public plugin_precache()
{
            
// this engine way...
            
new iEnt = -1;
            while( (
iEnt find_ent_by_class(iEnt"game_player_equip") > 0) )
            {
                    if(
pev_valid(iEnt)) remove_entity(iEnt);
            }

Is this the only thing I need or is there something else with this, it isn't working for me Tried edons way also.

Btw you are missing ")" in while loop
gravi123 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 20:45.


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