AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   amount fade! (https://forums.alliedmods.net/showthread.php?t=19884)

busemann 10-27-2005 13:21

amount fade!
 
just for an example: set_user_rendering 250... how do i make it to "fade" into 1 in 5 sec

Freecode 10-27-2005 14:31

use set_task.
You need to define the fading values or write some kind of an equation which shouldnt be hard.

Charr 10-27-2005 15:47

You'd want a task a some sort of loop.
A for-loop would be smooth, but it would take less than 1 second to fade into invisibility, so you would want to use a task.

[ --<-@ ] Black Rose 10-27-2005 18:22

something like...
Code:
public IsInvis(id) {     new tempvis     new tempvis2     tempvis = tempvis2     if ( tempvis > 0 ) {         tempvis2 = tempvis - 1         set_user_rendering( id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, tempvis2 )         set_task( 0.05, "IsInvis", id )     }     if ( tempvis == 0 ) {         set_user_rendering( id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0 )         set_task( 0.2, "IsInvis", id )     } }
?

Freecode 10-27-2005 19:40

Code:
    new tempvis     new tempvis2     tempvis = tempvis2     if ( tempvis > 0 ) {         tempvis2 = tempvis - 1

your not setting values for these so there auto 0

[ --<-@ ] Black Rose 10-28-2005 11:16

lol i forgot that... well i dunno how to... i can do it in my script... but then i just add tempvis = 255 when command is used... btr soloution?

Zenith77 10-28-2005 15:06

Code:
#include <amxmodx> #include <fun> #define PLUGIN "Invis Fade" #define VERSION "1.0" #define AUTHOR "Zenith77" new iFade[33] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)           register_clcmd("amx_invis", "Invis",  "makes you fade to inivsible") } public client_connect(id) {       iFade[id] = 0 } public Invis(id) {       if ( iFade[id] <= 255 ) {                 iFade[id] ++         set_user_rendering( id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, iFade[id] )         set_task( 0.2, "Invis", id )     }    if( iFade[id] >= 255) {         iFade[id] = 0    }      return PLUGIN_HANDLED }

I would make this script better and also check it to see if works, but i am at a friends house right now, so i cant :/.


If you do compile this then you may get some loose indention errors

--Zenith77

[ --<-@ ] Black Rose 10-28-2005 15:15

i don't really get ur script... i don't think it'll work...
( does ++ means +1? )

Zenith77 10-28-2005 15:18

Yes, and -- means -1 :)

[ --<-@ ] Black Rose 10-28-2005 15:22

okey Zenith... thx :D

but i still think your script wont work :P


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

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