Raised This Month: $ Target: $400
 0% 

Ham_TakeDamage plays only Sound in PreThink


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-25-2013 , 07:50   Ham_TakeDamage plays only Sound in PreThink
Reply With Quote #1

Hello everybody,

I've got this code
PHP Code:
public fw_PlayerPreThink(id)
{
    if(!
IsAlive(id) || cs_get_user_team(id) != CS_TEAM_CT
        return; 
    
    new 
Float:origin[3];
    
entity_get_vector(idEV_VEC_originorigin);
        
    if(
ExecuteHam(Ham_FVisibleg_iSlenderIdid
    && 
entity_range(g_iSlenderIdid) <= SLENDER_RADIUS 
    
&& is_in_viewcone(g_iSlenderId,origin
    && 
get_gametime() > g_flSlayDelay[id
    && 
is_user_connected(id
    && 
is_user_alive(id)) 
    {
        
client_print(idprint_chat"I get damage.")
        
ExecuteHam(Ham_TakeDamageid0g_iSlenderIdget_pcvar_num(cvar_damage), DMG_PARALYZE)
        
g_flSlayDelay[id] = get_gametime() + SLENDER_DELAY
    
}

But it only plays the sound of the damage, the player doesn't loose health. Any ideas why?
__________________
Kia is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 05-25-2013 , 09:13   Re: Ham_TakeDamage plays only Sound in PreThink
Reply With Quote #2

try a small delay (0.1 sec task or something like that)
jimaway is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 05-25-2013 , 09:15   Re: Ham_TakeDamage plays only Sound in PreThink
Reply With Quote #3

PHP Code:
get_pcvar_num(cvar_damage
->

PHP Code:
get_pcvar_float(cvar_damage
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-25-2013 , 10:07   Re: Ham_TakeDamage plays only Sound in PreThink
Reply With Quote #4

Quote:
Originally Posted by jimaway View Post
try a small delay (0.1 sec task or something like that)
Delay is 0.32 sec.

Quote:
Originally Posted by bibu View Post
PHP Code:
get_pcvar_num(cvar_damage
->

PHP Code:
get_pcvar_float(cvar_damage
Doesn't work anyway.
__________________
Kia is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-25-2013 , 10:13   Re: Ham_TakeDamage plays only Sound in PreThink
Reply With Quote #5

May be damage is not high enough, try 10 or 20 and see.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 05-25-2013 , 11:45   Re: Ham_TakeDamage plays only Sound in PreThink
Reply With Quote #6

Quote:
Originally Posted by Kia View Post
Doesn't work anyway.
Did you try it? Your answer is somehow arrogant.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 05-25-2013 , 17:43   Re: Ham_TakeDamage plays only Sound in PreThink
Reply With Quote #7

Quote:
Originally Posted by Kia View Post
Delay is 0.32 sec.
no i meant delay the ExecuteHam, so it doesent get executed in prethink
jimaway is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-25-2013 , 18:44   Re: Ham_TakeDamage plays only Sound in PreThink
Reply With Quote #8

Try to set g_iSlenderId as invlictor and attacker.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-25-2013 , 10:27   Re: Ham_TakeDamage plays only Sound in PreThink
Reply With Quote #9

Damage is 15.
__________________
Kia is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-25-2013 , 11:51   Re: Ham_TakeDamage plays only Sound in PreThink
Reply With Quote #10

I tried it.
__________________
Kia 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 16:26.


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