AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Some questions (https://forums.alliedmods.net/showthread.php?t=22279)

Unidentified 12-22-2005 21:48

Some questions
 
How would I make a kRenderFxGlowShell flashing? I know how to do It normally.

How would you use a hud_msg to display a new color every second or so. Such as from red to blue, green to red, orange to pink, etc. Also, how to detect the time that a function lasts?

Which leads to my next question, how would you set a time of how long a function will work.

Xanimos 12-22-2005 22:33

set_task() answers just about all of those.

Unidentified 12-22-2005 23:34

I know that much Suicid3, but I'm unsure of which way to use It. Could you post a small sample?

aLpiNe^cLuBz 12-23-2005 02:30

Code:
set_task(5.0,"function",0)
That will repeat your function every 5 seconds.

VEN 12-23-2005 02:38

It depend on where you would put it (inside or outside your function).

MaximusBrood 12-23-2005 08:53

Quote:

Originally Posted by aLpiNe^cLuBz
Code:
set_task(5.0,"function",0)
That will repeat your function every 5 seconds.

No, it won't, it will run only 1 time :wink:

This is the correct 1:

Code:
set_task(5.0, "myFunction",_, _, _,"b")

Unidentified 12-24-2005 15:34

Okay. I know there Is a set task. But I'm confused on the way you'd use It. Such as If I wanted to give godmode to a player for thirty seconds, how would I do that?

v3x 12-24-2005 15:38

Code:
public give_god( id ) {   set_user_godmode(id, 1);   set_task(30.0, "remove_god", id); } public remove_god( id ) {   set_user_godmode(id, 0); }

Unidentified 12-25-2005 17:23

Thank you. Now one last question. How would you set a multi-glow(flashing), such as Red Blue, Red Blue -- looping... What I did was

Code:
public glowthing(id) { set_user_rendering(id,kRenderFxGlowShell,255,255,255,kRenderNormal,16) set_task(1.0, "glowthing2", id); } public glowthing2(id) { set_user_rendering(id,kRenderFxGlowShell,255,0,255,kRenderNormal,16) set_task(1.0, "glowthing", id); }

Thanks.

Unidentified 12-26-2005 22:32

Anyone?....


All times are GMT -4. The time now is 15:55.

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