Raised This Month: $ Target: $400
 0% 

change this stock


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 11-29-2015 , 02:10   change this stock
Reply With Quote #1

Hi everybody, well basically my question is with what native I can replace this? fm_get_user_weapon_entity, I do not like to use use fakemeta util so I would like to replace it ... thx in advance

this:

fm_get_user_weapon_entity(id, get_user_weapon(id))

is the same as this?

get_pdata_cbase(id, m_pActiveItem, 5)

Last edited by wicho; 11-29-2015 at 02:50.
wicho is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-29-2015 , 14:28   Re: change this stock
Reply With Quote #2

Yes, they will both return the active/current weapon entity.
__________________

Last edited by Bugsy; 11-29-2015 at 14:28.
Bugsy is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 11-29-2015 , 19:33   Re: change this stock
Reply With Quote #3

Thank you for telling me, just another question its possible to optimaze this code?

PHP Code:
public changecolor(id)   
{       
         
    
ColorOption[id]++
    
ColorOption[id] %= 4
    
    
switch(ColorOption[id]) 
    {         
        case 
0// white  
        
{  
            
g_Color[id]{0} = 255 // r  
            
g_Color[id]{1} = 255 // g  
            
g_Color[id]{2} = 255 // b 
        
        
new ent = -1
            
while((ent engfunc(EngFunc_FindEntityByStringent"classname""grenade")) != 0)
            {
                 if (!
is_valid_ent(ent) || pev(entPEV_NADE_TYPE) != NADE_TYPE_FLARE)
                 continue;

                 
fm_set_rendering(entkRenderFxGlowShellg_Color[id]{0}, g_Color[id]{1}, g_Color[id]{2}, kRenderNormal16);  
            } 
        
printf(idGRAY"^x04 ZP |^x01 You have changed your color light to^x03 white^x01!")
        }   
        case 
1// red  
        
{       
            
g_Color[id]{0} = random_num(50,255// r  
            
g_Color[id]{1} = // g  
            
g_Color[id]{2} = // b 
        
        
new ent = -1
            
while((ent engfunc(EngFunc_FindEntityByStringent"classname""grenade")) != 0)
            {
                 if (!
is_valid_ent(ent) || pev(entPEV_NADE_TYPE) != NADE_TYPE_FLARE)
                 continue;

                 
fm_set_rendering(entkRenderFxGlowShellg_Color[id]{0}, g_Color[id]{1}, g_Color[id]{2}, kRenderNormal16);  
            } 
        
printf(idRED"^x04 ZP |^x01 You have changed your color light to^x03 red^x01!")
        }  
        case 
2// green  
        
{  
            
g_Color[id]{0} = // r  
            
g_Color[id]{1} = random_num(50,255// g  
            
g_Color[id]{2} = // b 
        
        
new ent = -1
            
while((ent engfunc(EngFunc_FindEntityByStringent"classname""grenade")) != 0)
            {
                 if (!
is_valid_ent(ent) || pev(entPEV_NADE_TYPE) != NADE_TYPE_FLARE)
                 continue;

                 
fm_set_rendering(entkRenderFxGlowShellg_Color[id]{0}, g_Color[id]{1}, g_Color[id]{2}, kRenderNormal16);  
            } 
        
printf(idGREEN"^x04 ZP |^x01 You have changed your color light to^x04 green^x01!")
        }  
        case 
3// blue 
        
{  
            
g_Color[id]{0} = // r  
            
g_Color[id]{1} = // g  
            
g_Color[id]{2} = random_num(50,255// b 
        
        
new ent = -1
            
while((ent engfunc(EngFunc_FindEntityByStringent"classname""grenade")) != 0)
            {
                 if (!
is_valid_ent(ent) || pev(entPEV_NADE_TYPE) != NADE_TYPE_FLARE)
                 continue;

                 
fm_set_rendering(entkRenderFxGlowShellg_Color[id]{0}, g_Color[id]{1}, g_Color[id]{2}, kRenderNormal16);  
            } 
        
printf(idBLUE"^x04 ZP |^x01 You have changed your color light to^x03 blue^x01!")
        }          
    }  

wicho is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-29-2015 , 22:18   Re: change this stock
Reply With Quote #4

PHP Code:
public changecolor(id)   
{       
    
    
ColorOption[id]++
    
ColorOption[id] %= 4
    
    
switch(ColorOption[id]) 
    { 
        case 
0// white  
        
{  
            
g_Color[id]{0} = 255 // r  
            
g_Color[id]{1} = 255 // g  
            
g_Color[id]{2} = 255 // b 
            
            
printf(idGRAY"^x04 ZP |^x01 You have changed your color light to^x03 white^x01!")
        }   
        case 
1// red  
        
{       
            
g_Color[id]{0} = random_num(50,255// r  
            
g_Color[id]{1} = // g  
            
g_Color[id]{2} = // b 
            
            
printf(idRED"^x04 ZP |^x01 You have changed your color light to^x03 red^x01!")
        }  
        case 
2// green  
        
{  
            
g_Color[id]{0} = // r  
            
g_Color[id]{1} = random_num(50,255// g  
            
g_Color[id]{2} = // b 
            
            
printf(idGREEN"^x04 ZP |^x01 You have changed your color light to^x04 green^x01!")
        }  
        case 
3// blue 
        
{  
            
g_Color[id]{0} = // r  
            
g_Color[id]{1} = // g  
            
g_Color[id]{2} = random_num(50,255// b 
            
            
printf(idBLUE"^x04 ZP |^x01 You have changed your color light to^x03 blue^x01!")
        }
    }
        
    new 
ent = -1
    
while((ent engfunc(EngFunc_FindEntityByStringent"classname""grenade")) != 0)
    {
        if (!
is_valid_ent(ent) || pev(entPEV_NADE_TYPE) != NADE_TYPE_FLARE)
            continue;

        
fm_set_rendering(entkRenderFxGlowShellg_Color[id]{0}, g_Color[id]{1}, g_Color[id]{2}, kRenderNormal16);  
    }


Last edited by zmd94; 11-29-2015 at 22:19.
zmd94 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-30-2015 , 00:48   Re: change this stock
Reply With Quote #5

Quote:
Originally Posted by zmd94 View Post
PHP Code:
// code 
Don't just post code. Use your words and explain what you did.
__________________
fysiks 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 17:55.


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