Raised This Month: $ Target: $400
 0% 

Noob coder (need help)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Davidos
Senior Member
Join Date: Feb 2005
Old 02-16-2007 , 14:51   Noob coder (need help)
Reply With Quote #1

Well, probs the most noobiest coder on here, <and the bitchiest>

can anyone tell me what I did wrong in this

Code:
#include <amxmodx> #include <fun> public plugin_init()       {     register_plugin("Glow by Health", "1.0", "Davidos")     register_event("Damage","damage","be") } public damage(id)     {     if(id && is_user_alive(id))         {         new health = get_user_health(id)         if (health>=100)             {             set_user_rendering(id, kRenderFxGlowShell,0,0,255,kRenderTransAlpha,5)         }         else         {             if (health>=75)                 {                 set_user_rendering(id, kRenderFxGlowShell,0,255,0,KRenderTransAlpha,5)             }             else             {                 if (health>=50)                     {                     set_user_rendering(id, kRenderFxGlowShell,255,255,0,KRenderTransAlpha,5)                 }                 else                 {                     if (health>=25)                         {                         set_user_rendering(id, kRenderFxGlowShell,255,100,0,KRenderTransAlpha,5)                     }                     else                     {                         if (health>=1)                             {                             set_user_rendering(id, kRenderFxGlowShell,255,0,0,KRenderTransAlpha,5)                         }                         else                         {                             if (health<1)                                 {                                 set_user_rendering(id, kRenderFxGlowShell,0,0,0,KRenderTransAlpha,5                                                             }                         }

I know it's lame. I'm trying to make it so a player glows and the color changes when one gets under a certain % of health...

<BTW I rebuilt this from Kensai's glow by health mod! Don't flame me for the name O_o>


EDIT:

BAAP BAAAP BRAAP LAME CODING BRAAP!

I didn't realise k and K were SO much diffrent... try this

Code:
#include <amxmodx> #include <fun> public plugin_init()       {     register_plugin("Glow by Health", "1.0", "Davidos")     register_event("Damage","damage","be") } public damage(id)     {     if(id && is_user_alive(id))         {         new health = get_user_health(id)         if (health>=100)             {             set_user_rendering(id, kRenderFxGlowShell,0,0,255,kRenderTransAlpha,5)         }         else         {             if (health>=75)                 {                 set_user_rendering(id, kRenderFxGlowShell,0,255,0,kRenderTransAlpha,5)             }             else             {                 if (health>=50)                     {                     set_user_rendering(id, kRenderFxGlowShell,255,255,0,kRenderTransAlpha,5)                 }                 else                 {                     if (health>=25)                         {                         set_user_rendering(id, kRenderFxGlowShell,255,100,0,kRenderTransAlpha,5)                     }                     else                     {                         if (health>=1)                             {                             set_user_rendering(id, kRenderFxGlowShell,255,0,0,kRenderTransAlpha,5)                         }                         else                         {                             if (health<1)                                 {                                 set_user_rendering(id, kRenderFxGlowShell,0,0,0,kRenderTransAlpha,5)                                                             }                         }                     }                 }             }         }     } }

something is wrong with this...

Last edited by Davidos; 02-16-2007 at 14:57.
Davidos is offline
Fadeproof18
Senior Member
Join Date: Feb 2007
Location: Pittsburgh, PA
Old 02-16-2007 , 15:00   Re: Noob coder (need help)
Reply With Quote #2

Wrong forum man...you should post this underscripting, as this forum is for plugin requests/suggestions.
I'd help but i know as much about coding as the Back button on my explorer browser.
Fadeproof18 is offline
Send a message via AIM to Fadeproof18 Send a message via MSN to Fadeproof18
Davidos
Senior Member
Join Date: Feb 2005
Old 02-16-2007 , 15:05   Re: Noob coder (need help)
Reply With Quote #3

Quote:
Originally Posted by Fadeproof18 View Post
Wrong forum man...you should post this underscripting, as this forum is for plugin requests/suggestions.
I'd help but i know as much about coding as the Back button on my explorer browser.
O_O omg... I can't find the scripting button anywhere...
Davidos is offline
Da_sk8rboy
Veteran Member
Join Date: Jul 2006
Old 02-16-2007 , 15:06   Re: Noob coder (need help)
Reply With Quote #4

Scripting Help
Find help for scripting problems.
__________________
i stop around here and there.
Da_sk8rboy is offline
GraffityMaster
Member
Join Date: Jan 2007
Old 02-16-2007 , 15:06   Re: Noob coder (need help)
Reply With Quote #5

Code:
 
#include <amxmodx> 
#include <fun> 
public plugin_init()  
{ 
 register_plugin("Glow by Health", "1.0", "Davidos")
 register_event("Damage","damage","be")
}
public damage(id)
{
 if(is_user_alive(id))
 {
  new health = get_user_health(id)
  
  if (health>=100)
   set_user_rendering(id, kRenderFxGlowShell,0,0,255,kRenderTransAlpha,5)
  
  if (health>=75)
   set_user_rendering(id, kRenderFxGlowShell,0,255,0,kRenderTransAlpha,5)
  
  if (health>=50)
   set_user_rendering(id, kRenderFxGlowShell,255,255,0,kRenderTransAlpha,5)
  
  if (health>=25)
   set_user_rendering(id, kRenderFxGlowShell,255,100,0,kRenderTransAlpha,5)
  
  if (health>=1)
   set_user_rendering(id, kRenderFxGlowShell,255,0,0,kRenderTransAlpha,5)
  
  if (health<1)
   set_user_rendering(id, kRenderFxGlowShell,0,0,0,kRenderTransAlpha,5)
  
  
 }
 
}
__________________

Last edited by GraffityMaster; 02-16-2007 at 15:09.
GraffityMaster is offline
Da_sk8rboy
Veteran Member
Join Date: Jul 2006
Old 02-16-2007 , 15:08   Re: Noob coder (need help)
Reply With Quote #6

Why post in phpcode?
__________________
i stop around here and there.
Da_sk8rboy is offline
GraffityMaster
Member
Join Date: Jan 2007
Old 02-16-2007 , 15:09   Re: Noob coder (need help)
Reply With Quote #7

Quote:
Originally Posted by Da_sk8rboy View Post
Why post in phpcode?
fixed lol
__________________
GraffityMaster is offline
Davidos
Senior Member
Join Date: Feb 2005
Old 02-16-2007 , 15:12   Re: Noob coder (need help)
Reply With Quote #8

Quote:
Originally Posted by GraffityMaster View Post
Code:
 
#include <amxmodx> 
#include <fun> 
public plugin_init()  
{ 
 register_plugin("Glow by Health", "1.0", "Davidos")
 register_event("Damage","damage","be")
}
public damage(id)
{
 if(is_user_alive(id))
 {
  new health = get_user_health(id)
  
  if (health>=100)
   set_user_rendering(id, kRenderFxGlowShell,0,0,255,kRenderTransAlpha,5)
  
  if (health>=75)
   set_user_rendering(id, kRenderFxGlowShell,0,255,0,kRenderTransAlpha,5)
  
  if (health>=50)
   set_user_rendering(id, kRenderFxGlowShell,255,255,0,kRenderTransAlpha,5)
  
  if (health>=25)
   set_user_rendering(id, kRenderFxGlowShell,255,100,0,kRenderTransAlpha,5)
  
  if (health>=1)
   set_user_rendering(id, kRenderFxGlowShell,255,0,0,kRenderTransAlpha,5)
  
  if (health<1)
   set_user_rendering(id, kRenderFxGlowShell,0,0,0,kRenderTransAlpha,5)
  
  
 }
 
}

Posted in scripting help, for some reason I had to log out and in...

Anyway, doesnt that make it glow all colours? I mean now it would practically be white, then when you are 75 it would be all that but blue and stuff...

Right?

Anywho delete this...
Davidos is offline
commonbullet
Veteran Member
Join Date: Oct 2005
Old 02-16-2007 , 15:13   Re: Noob coder (need help)
Reply With Quote #9

GraffityMaster, you should have used "else if" instead.

Davidos: With your script a player should receive a damage to glow, try hooking Health messages instead. Also if a player has health less than 1 he's not alive, so that part of your code is useless.

Last edited by commonbullet; 02-16-2007 at 15:16.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
Davidos
Senior Member
Join Date: Feb 2005
Old 02-16-2007 , 15:20   Re: Noob coder (need help)
Reply With Quote #10

Quote:
Originally Posted by commonbullet View Post
GraffityMaster, you should have used "else if" instead.

Davidos: With your script a player should receive a damage to glow, try hooking Health messages instead. Also if a player has health less than 1 he's not alive, so that part of your code is useless.

Yeah im updating those parts as Im going.

For some reason i HAVE to make the player transparrent, else the glowshell wont work... annoying...
Davidos 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 03:57.


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