AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Don't give usp and glock (https://forums.alliedmods.net/showthread.php?t=293148)

gravi123 01-24-2017 08:18

Don't give usp and glock
 
As title says, is there a way not to give team weapons when round stats not using strip_user_weapon

edon1337 01-24-2017 08:21

Re: Don't give usp and glock
 
It only gives in de_ maps and some others , in surf_ maps it doesn't.

EFFx 01-24-2017 11:57

Re: Don't give usp and glock
 
Quote:

Originally Posted by edon1337 (Post 2489434)
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"


Craxor 01-24-2017 13:54

Re: Don't give usp and glock
 
https://forums.alliedmods.net/showthread.php?t=217673

OciXCrom 01-24-2017 14:14

Re: Don't give usp and glock
 
Simply remove the "game_player_equip" entity.

gravi123 01-24-2017 15:17

Re: Don't give usp and glock
 
How do i remove the entity?

edon1337 01-24-2017 17:07

Re: Don't give usp and glock
 
Quote:

Originally Posted by EFFx (Post 2489515)
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)  
    }  



EFFx 01-24-2017 17:08

Re: Don't give usp and glock
 
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.

Natsheh 01-24-2017 17:12

Re: Don't give usp and glock
 
Quote:

Originally Posted by OciXCrom (Post 2489549)
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 ^_^ :)

gravi123 01-25-2017 06:44

Re: Don't give usp and glock
 
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 :D


All times are GMT -4. The time now is 20:45.

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