Thread: TFC Sniper Glow
View Single Post
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 06-19-2006 , 08:30  
Reply With Quote #6

Quote:
Originally Posted by GoGo_xD
Does the function get_weaponname() will run if i don't make a loop?
I don't see where is my "error". :?
Let me break it down for you then

Lets see here. Your first mistake is that you make a loop and never use it.
Code:
    for(new a=0; a<get_playersnum(); ++a) //your loop has the variable 'a' and its not used anywhere.         {               get_weaponname(get_user_weapon(id,ammo,clip),wpn,31)                 if(containi(wpn, "sniperrifle") > -1)             {                 switch(get_user_team(id))                 {                     case 1:     set_user_rendering(id, kRenderFxGlowShell, color_BLU[0], color_BLU[1], color_BLU[2],  kRenderNormal, 255)                     case 2:     set_user_rendering(id, kRenderFxGlowShell, color_RED[0], color_RED[1], color_RED[2],  kRenderNormal, 255)                     case 3:     set_user_rendering(id, kRenderFxGlowShell, color_YEL[0], color_YEL[1], color_YEL[2],  kRenderNormal, 255)                     case 4:        set_user_rendering(id, kRenderFxGlowShell, color_GRE[0], color_GRE[1], color_GRE[2],  kRenderNormal, 255)                 }             }         }
So what you are doing is looping through however many players there are and setting a persons glow that many times.

There are a few other things wrong with your loop. But IT IS NOT NEEDED in this plugin and should just be removed.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos