Raised This Month: $ Target: $400
 0% 

Change secondary weapon to a new one


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
leonardo_
Member
Join Date: Nov 2012
Location: Moscow, right now in Vic
Old 02-06-2013 , 19:25   Re: Change secondary weapon to a new one
Reply With Quote #8

Quote:
Originally Posted by Doc-Holiday View Post
Whats the warning?

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

const OFFSET_PRIMARYWEAPON 116;
const 
OFFSET_C4_SLOT 372;

StripUserWeapons(id)
{
    new 
iC4Ent get_pdata_cbase(idOFFSET_C4_SLOT);
    
    if( 
iC4Ent )
    {
        
set_pdata_cbase(idOFFSET_C4_SLOTFM_NULLENT);
    }

    
strip_user_weapons(id);
    
give_item(id"weapon_knife");
    
set_pdata_int(idOFFSET_PRIMARYWEAPON0);

    if( 
iC4Ent )
    {
        
entity_set_int(idEV_INT_weaponsentity_get_int(idEV_INT_weapons) | (1<<CSW_C4));
        
set_pdata_cbase(idOFFSET_C4_SLOTiC4Ent);
        
cs_set_user_bpammo(idCSW_C41);
        
cs_set_user_plant(id1);
    }
    return 
PLUGIN_HANDLED;

This stock is from Conor If the player has the C4 it will give him the c4 back so that you dont strip that.. and of course the knife also
that warning:


and line 144 is that one:

PHP Code:
strip_user_weapons(player



And tried that code:
PHP Code:
 for(new 0pnumi++)
    {
        
player players[i];
        if(
is_user_alive(player) && get_user_flags(player) & ADMIN_LEVEL_G)
        {
            
strip_user_weaponsplayer)
            
give_item(player"weapon_deagle")
            
give_item(player"ammo_50ae")
            
give_item(player"ammo_50ae")
            
give_item(player"ammo_50ae")
            
give_item(player"weapon_knife")
            
            if (!
get_pcvar_num(g_menu_active))
                return 
PLUGIN_CONTINUE
            
            
if(CurrentRound >= 3)
            {
                
Showrod(player);
            }
        }
    } 
and I didn't have anything, just deagle... even knife was deleted, like the menu that usually shows on the top-left of the screen was deleted too... Like when you choosing between knife and primary weapon it shows you a yellow menu on the top, and with that code it didn't show me anything...

Can anyone help me to fix that...

Last edited by leonardo_; 02-06-2013 at 20:00.
leonardo_ is offline
Send a message via ICQ to leonardo_ Send a message via Skype™ to leonardo_
 



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 20:31.


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