Raised This Month: $ Target: $400
 0% 

Electric Ball with Consecutive damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
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 #1

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
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