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 , 19:33   Re: change this stock
Reply With Quote #1

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
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 17:55.


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