Raised This Month: $ Target: $400
 0% 

How to strip the weapons of all and give a knife?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-10-2009 , 09:23   How to strip the weapons of all and give a knife?
Reply With Quote #1

Title
Thanks in advance
__________________
alan_el_more is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 04-10-2009 , 09:29   Re: How to strip the weapons of all and give a knife?
Reply With Quote #2

PHP Code:
#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))
//On the top ^       ^

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;

Use : fm_strip_user_weapons(index) with set_task.
xbatista is offline
Send a message via Skype™ to xbatista
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-10-2009 , 09:37   Re: How to strip the weapons of all and give a knife?
Reply With Quote #3

Already know that stock but if the id is 0, it removes the weapons at all?
__________________
alan_el_more is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 04-10-2009 , 09:39   Re: How to strip the weapons of all and give a knife?
Reply With Quote #4

Don't know really Never tryied
xbatista is offline
Send a message via Skype™ to xbatista
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-10-2009 , 09:40   Re: How to strip the weapons of all and give a knife?
Reply With Quote #5

I don't think it would. 0 is world. Use a loop to execute on all.
__________________
fysiks is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-10-2009 , 09:44   Re: How to strip the weapons of all and give a knife?
Reply With Quote #6

PHP Code:
for(new id 1id <= g_maxplayersid++)
        
fm_strip_user_weapons(id
is well?
__________________
alan_el_more is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 04-10-2009 , 09:46   Re: How to strip the weapons of all and give a knife?
Reply With Quote #7

YAP
xbatista is offline
Send a message via Skype™ to xbatista
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-10-2009 , 11:32   Re: How to strip the weapons of all and give a knife?
Reply With Quote #8

you wanna stip guns even if user is not connected? no way

PHP Code:
for(new id 1id <= g_maxplayersid++)
        if( 
is_user_aliveid ) )
                
fm_strip_user_weaponsid ); 
-- Edit:
If you dont want loop, you could try this (not sure what it will work)
PHP Code:
stock fm_strip_weapons( ) {
    new 
iEntity engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"player_weaponstrip"));
    
    if( !
pev_validiEntity ) )
        return 
0;
    
    
dllfuncDLLFunc_SpawniEntity );
    
dllfuncDLLFunc_UseiEntity);
    
engfuncEngFunc_RemoveEntityiEntity );
    
    return 
1;

__________________

Last edited by xPaw; 04-10-2009 at 11:36.
xPaw 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 02:26.


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