Raised This Month: $ Target: $400
 0% 

Action Progress like when planting/defusing bomb


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cronck
Member
Join Date: Apr 2005
Old 04-30-2005 , 17:58   Action Progress like when planting/defusing bomb
Reply With Quote #1

How do i add such a progressbar for my functions?

For ex. i wanna use it for my healing skill, and when people heal eachother the bar should be shown, for about 3 secs...
Cronck is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-30-2005 , 18:28  
Reply With Quote #2

Code:
message_begin( MSG_ONE_UNRELIABLE, 108, {0,0,0}, id ) write_byte( iSecs ) write_byte( 0 ) message_end()


where id = player id
and iSecs = the # of seconds in progress..

So make iSecs = 3

xeroblood is offline
Send a message via MSN to xeroblood
Cronck
Member
Join Date: Apr 2005
Old 04-30-2005 , 18:47  
Reply With Quote #3

Thanks

Is there a way i can make it 0.1 sec?
Cronck is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-30-2005 , 18:55  
Reply With Quote #4

no, only 1 second intervals I believe...
xeroblood is offline
Send a message via MSN to xeroblood
Cronck
Member
Join Date: Apr 2005
Old 04-30-2005 , 18:58  
Reply With Quote #5

Oh... I was thinking of making my skill heal 1hp every 0.1 second, instead of 10 per second
But i guess it wont be possible, cant be set to 2.3 if the user has 23 hp to be healed..
Cronck is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-30-2005 , 19:00  
Reply With Quote #6

How about in +command?

(I know, I could just look in your mines plugin, but I'm too lazy )
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Cronck
Member
Join Date: Apr 2005
Old 04-30-2005 , 19:01  
Reply With Quote #7

i dont have any mines plugin?
__________________
No public plugins yet...
Cronck is offline
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-30-2005 , 19:05  
Reply With Quote #8

... xeroblood's plugin , which is slightly confusing to say the least
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-30-2005 , 19:52  
Reply With Quote #9

Quote:
Originally Posted by v3x
How about in +command?

(I know, I could just look in your mines plugin, but I'm too lazy )
Basically, in my Mines plugin I used that idea.. what I did, is on the + call I set the progress bar to 3 seconds (for example) and then I also set a task for 3 seconds to call a function when the progress bar completes..
But, on the - call, I check if the progress bar is complete or not (many ways to do this, like task_exists() for example), and if it is Not complete, I simple remove the task I set previously, and then call the Exact same preogress bar code but with a time of Zero which kills the progress bar immediately..

Then, if the task does get called (meaning they didn't call the - command), then I simply do whatever I wanted to do after the progress bar completes, which in my plugin meant Plant a Mine!

Did you follow that?
xeroblood is offline
Send a message via MSN to xeroblood
Cronck
Member
Join Date: Apr 2005
Old 04-30-2005 , 20:09  
Reply With Quote #10

I dont get what you mean... Anyway, i've decided not to use the progress bar, i'll just use hud messages with numbers counting...

http://forums.alliedmods.net/showthread.php?t=12993
__________________
No public plugins yet...
Cronck 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 05:23.


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