Raised This Month: $ Target: $400
 0% 

Noob coder (Check inside) [Solved!... sorta]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Davidos
Senior Member
Join Date: Feb 2005
Old 02-16-2007 , 15:06   Noob coder (Check inside) [Solved!... sorta]
Reply With Quote #1

Ok guys, I reposted it in scripting, now help me out with 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>=200)             {             set_user_rendering(id, kRenderFxGlowShell,255,255,255,kRenderTransAlpha,255)         }         else         {             if (health>=100)                 {                 set_user_rendering(id, kRenderFxGlowShell,0,0,255,kRenderTransAlpha,255)             }             else             {                 if (health>=75)                     {                     set_user_rendering(id, kRenderFxGlowShell,0,255,0,kRenderTransAlpha,255)                 }                 else                 {                     if (health>=50)                         {                         set_user_rendering(id, kRenderFxGlowShell,255,255,0,kRenderTransAlpha,255)                     }                     else                     {                         if (health>=25)                             {                             set_user_rendering(id, kRenderFxGlowShell,255,100,0,kRenderTransAlpha,255)                         }                         else                         {                             if (health>=10)                                 {                                 set_user_rendering(id, kRenderFxGlowShell,255,0,0,kRenderTransAlpha,255)                             }                             else                             {                                 if (health>=0)                                     {                                     set_user_rendering(id, kRenderFxGlowShell,3,3,3,kRenderTransAlpha,255)                                                                     }                             }                         }                     }                 }             }         }     } }

problems:

200+ hp doesn't give white
5- hp doesn't give black > Glow


The glow shell is bloody large O_O

So, any ideas why this isn't working as I had hoped it would?


Edit freely!

NOTICE 2

When I use commands like slap or heal the colors don't change either

Secondly when I pick up a medkit/etc. it still doesn't change to green untill I get hit.

Last edited by Davidos; 02-16-2007 at 18:26.
Davidos is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-16-2007 , 16:00   Re: Noob coder (Check inside)
Reply With Quote #2

This will work with slap/heal because you only called the last one on damage and this new one is called on health hud change.

You can't do black.

Shell size is probably smaller.
Code:
#include <amxmodx> #include <fun> public plugin_init() {     register_plugin("Glow by Health", "1.0", "Davidos")     register_event("Health", "event_Health", "be") } public event_Health(id) {     switch ( read_data(1) ) {         case 0 .. 9 :         set_user_rendering(id, kRenderFxGlowShell, 3, 3, 3, kRenderTransAlpha, 10) // You can't do black, You'll have to change that.         case 10 .. 24 :         set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 10)         case 25 .. 49 :         set_user_rendering(id, kRenderFxGlowShell, 255, 100, 0, kRenderNormal, 10)         case 50 .. 74 :         set_user_rendering(id, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 10)         case 75 .. 99 :         set_user_rendering(id, kRenderFxGlowShell, 0, 255, 0, kRenderNormal, 10)         case 100 .. 199 :         set_user_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 10)         default :         set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 10)     } }

Last edited by [ --<-@ ] Black Rose; 02-16-2007 at 16:05.
[ --<-@ ] Black Rose is offline
Davidos
Senior Member
Join Date: Feb 2005
Old 02-16-2007 , 16:08   Re: Noob coder (Check inside)
Reply With Quote #3

Quote:
Originally Posted by [ --<-@ ] Black Rose View Post
This will work with slap/heal because you only called the last one on damage and this new one is called on health hud change.

You can't do black.

Shell size is probably smaller.
Code:
#include <amxmodx> #include <fun> public plugin_init() {     register_plugin("Glow by Health", "1.0", "Davidos")     register_event("Health", "event_Health", "be") } public event_Health(id) {     switch ( read_data(1) ) {         case 0 .. 9 :         set_user_rendering(id, kRenderFxGlowShell, 3, 3, 3, kRenderTransAlpha, 10) // You can't do black, You'll have to change that.         case 10 .. 24 :         set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 10)         case 25 .. 49 :         set_user_rendering(id, kRenderFxGlowShell, 255, 100, 0, kRenderNormal, 10)         case 50 .. 74 :         set_user_rendering(id, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 10)         case 75 .. 99 :         set_user_rendering(id, kRenderFxGlowShell, 0, 255, 0, kRenderNormal, 10)         case 100 .. 199 :         set_user_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 10)         default :         set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 10)     } }

I fixed all those, I mean black and white not showing. That's because I did something bad. Well if it renders normal the shell wont show, it's just the model with nothing on it.

And I didn't mean black, I knew that, I meant gray ish... fixed that as well.

Anyway, THANKS ALOT! You fixed it!

I will take notes of this, + karma too you, and I will release this when I have added some other stuff.
Davidos is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-16-2007 , 16:10   Re: Noob coder (Check inside)
Reply With Quote #4

on case 0..9 change kRenderTransAlpha to kRenderNormal
It should be kRenderNormal. Try changing the last value to something larger.

Last edited by [ --<-@ ] Black Rose; 02-16-2007 at 16:13.
[ --<-@ ] Black Rose is offline
Davidos
Senior Member
Join Date: Feb 2005
Old 02-16-2007 , 16:16   Re: Noob coder (Check inside)
Reply With Quote #5

Quote:
Originally Posted by [ --<-@ ] Black Rose View Post
on case 0..9 change kRenderTransAlpha to kRenderNormal
It should be kRenderNormal. Try changing the last value to something larger.
I kept it on trans, as it doesnt really matter, as I want myself to be visible there <255 trans> and have a big shell <255 shell>

Worked out fine.

As for adding parts?

BOOM FRONTAL HIT!

I can't manage to get the hud hidden in sven coop, and even if I do, will this mess up with the script?

+ I have NO idea how to make a hud message on certains healths <which STAY there> like 25 = CAUTION!
+ I have the odd feeling that it will overlap with the hud messages from other mods...

Last edited by Davidos; 02-16-2007 at 16:21.
Davidos is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-16-2007 , 16:21   Re: Noob coder (Check inside)
Reply With Quote #6

"kRenderNormal, 10" is to set the size of the shell.
0 (small) - 255 (large)
[ --<-@ ] Black Rose 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 00:41.


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