Raised This Month: $ Target: $400
 0% 

something like strip_user_weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Salamon
Senior Member
Join Date: Dec 2007
Location: P(r)oland
Old 01-04-2008 , 17:35   something like strip_user_weapons
Reply With Quote #1

i need some code if it exist to remove not all weapons, but only grenades

they cant be dropped ;/ so i cant make client_cmd(id, "drop" "weapon_...") ;/
i cant use strip_user_weapons then dont paste this solution here ;/ (or i propably remember that here exist plugin that grenades can be dropped or something, if it help please paste link here too)

if someone have it please paste +karma of course
Salamon is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-04-2008 , 17:49   Re: something like strip_user_weapons
Reply With Quote #2

You can use fm_strip_user_gun from fakemeta_util.inc, don't know if it works with nades.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-04-2008 at 17:54.
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-04-2008 , 18:06   Re: something like strip_user_weapons
Reply With Quote #3

Try this:

Code:
    #include <amxmodx>     #include <fakemeta>         #define MAX_WEAPONS 29     new const g_iWeapon_priority[ MAX_WEAPONS ] =     {         3, 5, 7, 8, 12, 13, 14, 15, 18, 19, 20, 21, 22, 23, 24, 27, 28, 30, 1, 10, 11, 16, 17, 26, 6, 4, 9, 25, 29     };     new const g_lastinv[] = "lastinv";         #define OFFSET_FLASH_AMMO  387     #define OFFSET_HE_AMMO     388     #define OFFSET_SMOKE_AMMO  389     #define EXTRAOFFSET_LINUX  5     #define RemoveGrenade(%1,%2)  set_pdata_int( %1, %2, 0, EXTRAOFFSET_LINUX )         public plugin_init()     {          //     }         MyFunction( id )     {         // e.g         StripGrenade( id, CSW_FLASHBANG );     }         stock StripGrenade( id, iWeap_id )     {         static sWeapon_name[24], iOffset;         get_weaponname( iWeap_id, sWeapon_name, charsmax( sWeapon_name ) );         switch( iWeap_id )         {             case CSW_FLASHBANG    : iOffset = OFFSET_FLASH_AMMO;             case CSW_HEGRENADE    : iOffset = OFFSET_HE_AMMO;             case CSW_SMOKEGRENADE : iOffset = OFFSET_SMOKE_AMMO;         }         RemoveGrenade( id, iOffset );         // -- Switch on another weapon according its priority ( credit @VEN )         if( get_user_weapon( id ) == iWeap_id )         {             static sWp_name[20];             new iLen = charsmax( sWp_name );             for( new j = 0; j < MAX_WEAPONS; j++ )             {                 if( user_has_weapon( id, g_iWeapon_priority[j] ) && iWeap_id != g_iWeapon_priority[j] )                 {                     get_weaponname( g_iWeapon_priority[j], sWp_name, iLen );                     engclient_cmd( id, sWp_name );                     break;                 }             }         }         else         {             engclient_cmd( id, sWeapon_name );             engclient_cmd( id, g_lastinv );         }     }
__________________

Last edited by Arkshine; 01-04-2008 at 18:09.
Arkshine is offline
Salamon
Senior Member
Join Date: Dec 2007
Location: P(r)oland
Old 01-04-2008 , 18:48   Re: something like strip_user_weapons
Reply With Quote #4

karma +
Salamon 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 11:13.


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