Raised This Month: $ Target: $400
 0% 

Electric Ball with Consecutive damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AGoodGuy
Member
Join Date: Sep 2014
Old 12-19-2014 , 12:00   Electric Ball with Consecutive damage
Reply With Quote #1

Hi all, i have some idea and making something call: Electric Ball

Plz look this image, you can easy imagine:




And i stuck in step: Make Consecutive damage when any player touch this. Any one have some way to make Consecutive damage? Please help me to create this idea. Thank so much!
__________________
Without Passion Life Is Nothing

Quote:
“If you can't fly then run, if you can't run then walk, if you can't walk then crawl, but whatever you do, you have to keep moving forward.”― Martin Luther King Jr.

Last edited by AGoodGuy; 12-19-2014 at 12:28.
AGoodGuy is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-19-2014 , 12:04   Re: Electric Ball with Consecutive damage
Reply With Quote #2

More ExecuteHamB(Ham_TakeDamage,...) with different damages ?
__________________
HamletEagle is offline
AGoodGuy
Member
Join Date: Sep 2014
Old 12-19-2014 , 12:07   Re: Electric Ball with Consecutive damage
Reply With Quote #3

- Yes, Consecutive !

Take damage like this men in this video, LOL :

https://www.youtube.com/watch?featur...EfU47QY_k#t=14

- My idea is skill to throw electric ball to 1 place and any player touch this will take Consecutive damage
__________________
Without Passion Life Is Nothing

Quote:
“If you can't fly then run, if you can't run then walk, if you can't walk then crawl, but whatever you do, you have to keep moving forward.”― Martin Luther King Jr.

Last edited by AGoodGuy; 12-19-2014 at 12:28.
AGoodGuy is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 12-19-2014 , 12:27   Re: Electric Ball with Consecutive damage
Reply With Quote #4

You want the player takes damage after he touches it or while he's still touching it?
RateX is offline
AGoodGuy
Member
Join Date: Sep 2014
Old 12-19-2014 , 12:32   Re: Electric Ball with Consecutive damage
Reply With Quote #5

While he's still touching, thanks!
You can understand like this:

Player-->touching electric ball--> Damage His HP Consecutive until the ball remove or he moving out of this!
__________________
Without Passion Life Is Nothing

Quote:
“If you can't fly then run, if you can't run then walk, if you can't walk then crawl, but whatever you do, you have to keep moving forward.”― Martin Luther King Jr.

Last edited by AGoodGuy; 12-19-2014 at 12:35.
AGoodGuy is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 12-19-2014 , 12:52   Re: Electric Ball with Consecutive damage
Reply With Quote #6

Use register_touch/Ham_Touch, then in touch funtion use Ham_TakeDamage. Since touch can be call a lot of times per second, use get_gametime() to control the interval between each time you use Ham_TakeDamage.
RateX is offline
AGoodGuy
Member
Join Date: Sep 2014
Old 12-19-2014 , 13:02   Re: Electric Ball with Consecutive damage
Reply With Quote #7

@Ratex: Can i use set_task for this? Because, i knew, ham_touch is not a loop like cmd or pre_think so can't use get_gametime()?

Can you make for me 1 simple example with code?
__________________
Without Passion Life Is Nothing

Quote:
“If you can't fly then run, if you can't run then walk, if you can't walk then crawl, but whatever you do, you have to keep moving forward.”― Martin Luther King Jr.
AGoodGuy is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 12-20-2014 , 01:16   Re: Electric Ball with Consecutive damage
Reply With Quote #8

Here's an example:
PHP Code:
register_touch("Your_Entity_Classname""player""Your_Touch_Funtion")

public 
Your_Touch_Funtion(YourEntIDPlayerID)
{
    if(!
pev_valid(YourEntID))
        return
    if((
get_gametime() - last_damage_time) < interval_time)
        return
    
last_damage_time get_gametime()
    
//use Ham_TakeDamage here...

In the above code, I use get_gametime() because you can control interval time < 0.1, while set_task can only have minimum of 0.1. Also, get_gametime() is far more simple.

You can store last_damage_time in a global var like last_damage_time[33] for each player, or store it in ball entity's empty value holder from fuser1 to fuser4.
RateX is offline
AGoodGuy
Member
Join Date: Sep 2014
Old 12-20-2014 , 02:57   Re: Electric Ball with Consecutive damage
Reply With Quote #9

Thank so much for your help, i will try to make this.
__________________
Without Passion Life Is Nothing

Quote:
“If you can't fly then run, if you can't run then walk, if you can't walk then crawl, but whatever you do, you have to keep moving forward.”― Martin Luther King Jr.
AGoodGuy 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 15:26.


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