AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Noob coder (Check inside) [Solved!... sorta] (https://forums.alliedmods.net/showthread.php?t=51365)

Davidos 02-16-2007 15:06

Noob coder (Check inside) [Solved!... sorta]
 
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.

[ --<-@ ] Black Rose 02-16-2007 16:00

Re: Noob coder (Check inside)
 
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)     } }

Davidos 02-16-2007 16:08

Re: Noob coder (Check inside)
 
Quote:

Originally Posted by [ --<-@ ] Black Rose (Post 441246)
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.

[ --<-@ ] Black Rose 02-16-2007 16:10

Re: Noob coder (Check inside)
 
on case 0..9 change kRenderTransAlpha to kRenderNormal
It should be kRenderNormal. Try changing the last value to something larger.

Davidos 02-16-2007 16:16

Re: Noob coder (Check inside)
 
Quote:

Originally Posted by [ --<-@ ] Black Rose (Post 441251)
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...

[ --<-@ ] Black Rose 02-16-2007 16:21

Re: Noob coder (Check inside)
 
"kRenderNormal, 10" is to set the size of the shell.
0 (small) - 255 (large)

Davidos 02-16-2007 16:23

Re: Noob coder (Check inside)
 
Quote:

Originally Posted by [ --<-@ ] Black Rose (Post 441256)
"kRenderNormal, 10" is to set the size of the shell.
0 (small) - 255 (large)

I know + edited post. gonna check around about that send_hudmessage or whatever I found out...


All times are GMT -4. The time now is 00:41.

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