AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ham_TakeDamage plays only Sound in PreThink (https://forums.alliedmods.net/showthread.php?t=216761)

Kia 05-25-2013 07:50

Ham_TakeDamage plays only Sound in PreThink
 
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?

jimaway 05-25-2013 09:13

Re: Ham_TakeDamage plays only Sound in PreThink
 
try a small delay (0.1 sec task or something like that)

bibu 05-25-2013 09:15

Re: Ham_TakeDamage plays only Sound in PreThink
 
PHP Code:

get_pcvar_num(cvar_damage

->

PHP Code:

get_pcvar_float(cvar_damage


Kia 05-25-2013 10:07

Re: Ham_TakeDamage plays only Sound in PreThink
 
Quote:

Originally Posted by jimaway (Post 1958151)
try a small delay (0.1 sec task or something like that)

Delay is 0.32 sec.

Quote:

Originally Posted by bibu (Post 1958152)
PHP Code:

get_pcvar_num(cvar_damage

->

PHP Code:

get_pcvar_float(cvar_damage


Doesn't work anyway.

ConnorMcLeod 05-25-2013 10:13

Re: Ham_TakeDamage plays only Sound in PreThink
 
May be damage is not high enough, try 10 or 20 and see.

Kia 05-25-2013 10:27

Re: Ham_TakeDamage plays only Sound in PreThink
 
Damage is 15.

bibu 05-25-2013 11:45

Re: Ham_TakeDamage plays only Sound in PreThink
 
Quote:

Originally Posted by Kia (Post 1958179)
Doesn't work anyway.

Did you try it? Your answer is somehow arrogant.

Kia 05-25-2013 11:51

Re: Ham_TakeDamage plays only Sound in PreThink
 
I tried it.

11922911 05-25-2013 12:09

Re: Ham_TakeDamage plays only Sound in PreThink
 
Just try to put 15.0 in the damage

ExecuteHam(Ham_TakeDamage, id, 0, g_iSlenderId, 15.0, DMG_PARALYZE)

jimaway 05-25-2013 17:43

Re: Ham_TakeDamage plays only Sound in PreThink
 
Quote:

Originally Posted by Kia (Post 1958179)
Delay is 0.32 sec.

no i meant delay the ExecuteHam, so it doesent get executed in prethink


All times are GMT -4. The time now is 16:26.

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