Raised This Month: $ Target: $400
 0% 

[ SOLVED ] Strip especified user weapon?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 10-06-2015 , 09:39   [ SOLVED ] Strip especified user weapon?
Reply With Quote #1

Hi , is there any way strip weapons specified , for example , if the User spawn with Glock , then it is automatically removed , only that the other arms continue with it. Here is a code that might help you.

PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < fakemeta_util >

public plugin_init() 
{
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
}

public 
fwHamPlayerSpawnPost(id
{
    
fm_strip_user_weapons(id);
    
set_pdata_int(id1160);
    
fm_give_item(id"weapon_knife");

__________________









Last edited by CrazY.; 11-18-2015 at 09:14.
CrazY. is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-06-2015 , 12:26   Re: [HELP] Strip especified user weapon?
Reply With Quote #2

Is this tutorial or problem?
zmd94 is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 10-06-2015 , 13:52   Re: [HELP] Strip especified user weapon?
Reply With Quote #3

Try this:

PHP Code:
RegisterHam(Ham_Item_Deploy"weapon_glock""Ham_Deploy"1
PHP Code:
public Ham_Deploy(ent)
{
    static 
idid fm_cs_get_weapon_ent_owner(ent)

    if (!
pev_valid(id))
    return

    
    
fm_strip_user_weapons(id)
            
    
fm_give_item(id"weapon_knife")


Last edited by Krtola; 10-06-2015 at 13:54.
Krtola is offline
Send a message via Skype™ to Krtola
Hartmann
Senior Member
Join Date: Nov 2014
Old 10-06-2015 , 15:07   Re: [HELP] Strip especified user weapon?
Reply With Quote #4

Use fun model instead fakemeta_util, and spawn check the player is alive.

PHP Code:
if (is_user_alive(id)) 
__________________

RETAKES v1.0
github.com/alghtryer/retakes

Contact : [email protected]

BTC Donate: 1QAh1NLmeHy81LF9r8PaeGjYqHL2BBcJTx

Hartmann is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 10-06-2015 , 16:27   Re: [HELP] Strip especified user weapon?
Reply With Quote #5

Quote:
Originally Posted by zmd94 View Post
Is this tutorial or problem?
Problem.

Quote:
Originally Posted by Krtola View Post
Try this:

PHP Code:
RegisterHam(Ham_Item_Deploy"weapon_glock""Ham_Deploy"1
PHP Code:
public Ham_Deploy(ent)
{
    static 
idid fm_cs_get_weapon_ent_owner(ent)

    if (!
pev_valid(id))
    return

    
    
fm_strip_user_weapons(id)
            
    
fm_give_item(id"weapon_knife")

Compilation error:
PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < fakemeta_util >

public plugin_init() 
{
    
RegisterHam(Ham_Item_Deploy"weapon_glock""Ham_Deploy"1);
}

public 
Ham_Deploy(ent)
{
    if (
is_user_alive(id))
    {
        static 
idid fm_cs_get_weapon_ent_owner(ent);

        if (!
pev_valid(id));
        return;

        
        
fm_strip_user_weapons(id);
                
        
fm_give_item(id"weapon_knife");
    }

__________________









Last edited by CrazY.; 10-06-2015 at 16:29.
CrazY. is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 10-06-2015 , 17:17   Re: [HELP] Strip especified user weapon?
Reply With Quote #6

You dont need is user alive check...

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta_util>

#define PLUGIN "Glock is Block"
#define VERSION "1.0"
#define AUTHOR "Krtola"

const OFFSET_LINUX_WEAPONS 4
const OFFSET_WEAPONOWNER 41

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
RegisterHam(Ham_Item_Deploy"weapon_glock""Ham_Deploy"1);
}

stock fm_cs_get_weapon_ent_owner(ent)
{
    return 
get_pdata_cbase(entOFFSET_WEAPONOWNEROFFSET_LINUX_WEAPONS)
}

public 
Ham_Deploy(ent)
{
        static 
idid fm_cs_get_weapon_ent_owner(ent)

        if (!
pev_valid(id))
        return;

        
fm_strip_user_weapons(id)
                
        
fm_give_item(id"weapon_knife")

Krtola is offline
Send a message via Skype™ to Krtola
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 10-06-2015 , 17:31   Re: [HELP] Strip especified user weapon?
Reply With Quote #7

Did not work.
__________________








CrazY. is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 10-06-2015 , 17:34   Re: [HELP] Strip especified user weapon?
Reply With Quote #8

PHP Code:
weapon_glock 


PHP Code:
weapon_glock18 
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 10-06-2015 , 17:38   Re: [HELP] Strip especified user weapon?
Reply With Quote #9

I had no idea that the proper write weapon_glock18

Krtola is offline
Send a message via Skype™ to Krtola
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 10-06-2015 , 17:39   Re: [HELP] Strip especified user weapon?
Reply With Quote #10

Thanks , it worked , but to strip USP/GLOCK18 this is valid?

PHP Code:
#include <amxmodx> 
#include <hamsandwich> 
#include <fakemeta_util> 

#define PLUGIN "Glock is Block" 
#define VERSION "1.0" 
#define AUTHOR "Krtola" 

const OFFSET_LINUX_WEAPONS 
const OFFSET_WEAPONOWNER 41 

public plugin_init()  

    
register_plugin(PLUGINVERSIONAUTHOR

    
RegisterHam(Ham_Item_Deploy"weapon_glock18""Ham_Deploy"1);
    
RegisterHam(Ham_Item_Deploy"weapon_usp""Ham_Deploy"1); 


stock fm_cs_get_weapon_ent_owner(ent

    return 
get_pdata_cbase(entOFFSET_WEAPONOWNEROFFSET_LINUX_WEAPONS


public 
Ham_Deploy(ent

        static 
idid fm_cs_get_weapon_ent_owner(ent

        if (!
pev_valid(id)) 
        return; 

        
fm_strip_user_weapons(id
                 
        
fm_give_item(id"weapon_knife"

__________________








CrazY. 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 22:13.


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