Raised This Month: $ Target: $400
 0% 

Strip user


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-03-2009 , 17:09   Strip user
Reply With Quote #1

how to strip users primary weapon?
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 04-03-2009 , 17:13   Re: Strip user
Reply With Quote #2

PHP Code:
stock fm_strip_user_weapons(index) {
    new 
ent fm_create_entity("player_weaponstrip");
    if (!
pev_valid(ent))
        return 
0;

    
dllfunc(DLLFunc_Spawnent);
    
dllfunc(DLLFunc_Useentindex);
    
engfunc(EngFunc_RemoveEntityent);

    return 
1;

__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 04-03-2009 , 17:14   Re: Strip user
Reply With Quote #3

Quote:
Originally Posted by ot_207 View Post
PHP Code:
stock fm_strip_user_weapons(index) {
    new 
ent fm_create_entity("player_weaponstrip");
    if (!
pev_valid(ent))
        return 
0;
 
    
dllfunc(DLLFunc_Spawnent);
    
dllfunc(DLLFunc_Useentindex);
    
engfunc(EngFunc_RemoveEntityent);
 
    return 
1;

That would strip player's all weapons.
Quote:
Originally Posted by TitANious View Post
how to strip users primary weapon?
SnoW is offline
Send a message via MSN to SnoW
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 04-03-2009 , 17:17   Re: Strip user
Reply With Quote #4

Quote:
Originally Posted by SnoW View Post
That would strip player's all weapons. I believe he wants only primary weapons.
http://forums.alliedmods.net/showthread.php?p=472306
This plugin stripes the weapon a player wants to sell so this should be it. Try to analyse this code.


Or another method would be to see before he strips the weapons what weapons the client has, and after that to regive the weapons that the client had...
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.

Last edited by ot_207; 04-03-2009 at 17:25.
ot_207 is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-03-2009 , 17:24   Re: Strip user
Reply With Quote #5

PHP Code:
stock bool:fm_strip_user_gun(indexwid 0, const wname[] = "") { 
    new 
ent_class[32]
    if (!
wid && wname[0])
        
copy(ent_class31wname)
    else {
        new 
weapon widclipammo
        
if (!weapon && !(weapon get_user_weapon(indexclipammo)))
            return 
false
        
        get_weaponname
(weaponent_class31)
    }

    new 
ent_weap fm_find_ent_by_owner(-1ent_classindex)
    if (!
ent_weap)
        return 
false

    engclient_cmd
(index"drop"ent_class)

    new 
ent_box pev(ent_weappev_owner)
    if (!
ent_box || ent_box == index)
        return 
false

    dllfunc
(DLLFunc_Thinkent_box)

    return 
true

fm_strip_user_gun(id, "id of weapon")

the id's is here
__________________
alan_el_more is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 04-03-2009 , 17:31   Re: Strip user
Reply With Quote #6

Quote:
Originally Posted by ot_207 View Post
Or another method would be to see before he strips the weapons what weapons the client has, and after that to regive the weapons that the client had...
No, better to remove only primary weapons.
@alan el more, now we got the real function. Now we just need a method to get player's all primary weapons' ids.
SnoW is offline
Send a message via MSN to SnoW
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 02:22.


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