Raised This Month: $32 Target: $400
 8% 

Blood Kill Effect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 10-05-2018 , 08:53   Blood Kill Effect
Reply With Quote #1

It's posibble to make a player "to bleed" more when he's shooting?
Like This

But how about that high impact roll when the playre die?
__________________
kratoss1812 is offline
cra88y
AlliedModders Donor
Join Date: Dec 2016
Old 10-05-2018 , 17:09   Re: Blood Kill Effect
Reply With Quote #2

You can trigger particle effects (like blood) in a take damage hook probably.
"blood_impact_goop_heavy"

Related
Spoiler

Last edited by cra88y; 10-05-2018 at 17:16.
cra88y is offline
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 10-06-2018 , 04:01   Re: Blood Kill Effect
Reply With Quote #3

What do you think about this?

PHP Code:
int g_iParticleSystem[MAXPLAYERS 1];

public 
void OnPluginStart() 
{
    
    
int iId INVALID_ENT_REFERENCE;
    for (
iId 1iId <= MaxClientsiId++)
    {
        
SDKHookEx(iIdSDKHook_OnTakeDamageOnTakeDamage);
    }
}

/*
function Action (int victim, int &attacker, int &inflictor, float &damage, int &damagetype);
*/

public Action OnTakeDamage(int iVintiAintiIfloatfDintiDT)
{    
    if(
VIP_IsClientFeatureUse(iAg_sFeature))
    {
        if (
fD 0.0 && \
                
iA != iV && \
                    
iA >= && \
                        
iA <= MaxClients && \
                            
iV >= && \
                                
iV <= MaxClients)
        {
            
CreateBlood(iV"blood_impact_goop_heavy"); 
        }
    }

    return 
Plugin_Continue;
}

public 
void OnClientPostAdminCheck(int client)
{
    
g_iParticleSystem[client] = INVALID_ENT_REFERENCE;
}

bool CreateBlood(int clientchar[] particle)
{
    
RemoveBlood(client);
    
int ent EntRefToEntIndex(g_iParticleSystem[client]);
    
    if (
ent && ent != INVALID_ENT_REFERENCE)
    {
        
AcceptEntityInput(ent"Stop");
        
AcceptEntityInput(ent"Kill");
        
    }
    
    
ent CreateEntityByName("info_particle_system");
    
    
float particleOrigin[3];
    
    
GetClientAbsOrigin(clientparticleOrigin);
    
    
DispatchKeyValue(ent"start_active""0");
    
DispatchKeyValue(ent"effect_name"particle);
    
DispatchSpawn(ent);
    
    
TeleportEntity(entparticleOriginNULL_VECTORNULL_VECTOR);
    
    
    
SetVariantString("!activator");
    
AcceptEntityInput(ent"SetParent"clientent0);
    
    
ActivateEntity(ent);
    
AcceptEntityInput(ent"Start");
    
    
g_iParticleSystem[client] = EntIndexToEntRef(ent);
    
    return 
true;
}

void RemoveBlood(int client)  

    if(
IsValidEntity(g_iParticleSystem[client]))  
    { 
        
AcceptEntityInput(g_iParticleSystem[client], "Kill"); 
    }
    
    
SetEntityRenderMode(clientRENDER_NORMAL); 
    
g_iParticleSystem[client] = INVALID_ENT_REFERENCE

__________________

Last edited by kratoss1812; 10-06-2018 at 04:02.
kratoss1812 is offline
cra88y
AlliedModders Donor
Join Date: Dec 2016
Old 10-06-2018 , 05:24   Re: Blood Kill Effect
Reply With Quote #4

Quote:
Originally Posted by kratoss1812 View Post
What do you think about this?

PHP Code:
int g_iParticleSystem[MAXPLAYERS 1];

public 
void OnPluginStart() 
{
    
    
int iId INVALID_ENT_REFERENCE;
    for (
iId 1iId <= MaxClientsiId++)
    {
        
SDKHookEx(iIdSDKHook_OnTakeDamageOnTakeDamage);
    }
}

/*
function Action (int victim, int &attacker, int &inflictor, float &damage, int &damagetype);
*/

public Action OnTakeDamage(int iVintiAintiIfloatfDintiDT)
{    
    if(
VIP_IsClientFeatureUse(iAg_sFeature))
    {
        if (
fD 0.0 && \
                
iA != iV && \
                    
iA >= && \
                        
iA <= MaxClients && \
                            
iV >= && \
                                
iV <= MaxClients)
        {
            
CreateBlood(iV"blood_impact_goop_heavy"); 
        }
    }

    return 
Plugin_Continue;
}

public 
void OnClientPostAdminCheck(int client)
{
    
g_iParticleSystem[client] = INVALID_ENT_REFERENCE;
}

bool CreateBlood(int clientchar[] particle)
{
    
RemoveBlood(client);
    
int ent EntRefToEntIndex(g_iParticleSystem[client]);
    
    if (
ent && ent != INVALID_ENT_REFERENCE)
    {
        
AcceptEntityInput(ent"Stop");
        
AcceptEntityInput(ent"Kill");
        
    }
    
    
ent CreateEntityByName("info_particle_system");
    
    
float particleOrigin[3];
    
    
GetClientAbsOrigin(clientparticleOrigin);
    
    
DispatchKeyValue(ent"start_active""0");
    
DispatchKeyValue(ent"effect_name"particle);
    
DispatchSpawn(ent);
    
    
TeleportEntity(entparticleOriginNULL_VECTORNULL_VECTOR);
    
    
    
SetVariantString("!activator");
    
AcceptEntityInput(ent"SetParent"clientent0);
    
    
ActivateEntity(ent);
    
AcceptEntityInput(ent"Start");
    
    
g_iParticleSystem[client] = EntIndexToEntRef(ent);
    
    return 
true;
}

void RemoveBlood(int client)  

    if(
IsValidEntity(g_iParticleSystem[client]))  
    { 
        
AcceptEntityInput(g_iParticleSystem[client], "Kill"); 
    }
    
    
SetEntityRenderMode(clientRENDER_NORMAL); 
    
g_iParticleSystem[client] = INVALID_ENT_REFERENCE

Looks promising, you'd have to test it, but I'd suggest:

PHP Code:
public void DelParticle(int client)
{
    
int ent EntRefToEntIndex(g_iParticleSystem[client]);
    
    if (
ent && ent != INVALID_ENT_REFERENCE)
    {
        
AcceptEntityInput(ent"Stop");
        
AcceptEntityInput(ent"Kill");
    }
    
g_iParticleSystem[client] = INVALID_ENT_REFERENCE;

Also good practice to add the connection stuff in the onpluginstart in case reload:
PHP Code:
for (int i 0<= MAXPLAYERSi++)
{
        
g_iParticleSystem[i] = INVALID_ENT_REFERENCE;


Last edited by cra88y; 10-06-2018 at 05:29.
cra88y is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 10-07-2018 , 17:01   Re: Blood Kill Effect
Reply With Quote #5

Quote:
Originally Posted by kratoss1812 View Post
What do you think about this?

PHP Code:
int g_iParticleSystem[MAXPLAYERS 1];

public 
void OnPluginStart() 
{
    
    
int iId INVALID_ENT_REFERENCE;
    for (
iId 1iId <= MaxClientsiId++)
    {
        
SDKHookEx(iIdSDKHook_OnTakeDamageOnTakeDamage);
    }
}

/*
function Action (int victim, int &attacker, int &inflictor, float &damage, int &damagetype);
*/

public Action OnTakeDamage(int iVintiAintiIfloatfDintiDT)
{    
    if(
VIP_IsClientFeatureUse(iAg_sFeature))
    {
        if (
fD 0.0 && \
                
iA != iV && \
                    
iA >= && \
                        
iA <= MaxClients && \
                            
iV >= && \
                                
iV <= MaxClients)
        {
            
CreateBlood(iV"blood_impact_goop_heavy"); 
        }
    }

    return 
Plugin_Continue;
}

public 
void OnClientPostAdminCheck(int client)
{
    
g_iParticleSystem[client] = INVALID_ENT_REFERENCE;
}

bool CreateBlood(int clientchar[] particle)
{
    
RemoveBlood(client);
    
int ent EntRefToEntIndex(g_iParticleSystem[client]);
    
    if (
ent && ent != INVALID_ENT_REFERENCE)
    {
        
AcceptEntityInput(ent"Stop");
        
AcceptEntityInput(ent"Kill");
        
    }
    
    
ent CreateEntityByName("info_particle_system");
    
    
float particleOrigin[3];
    
    
GetClientAbsOrigin(clientparticleOrigin);
    
    
DispatchKeyValue(ent"start_active""0");
    
DispatchKeyValue(ent"effect_name"particle);
    
DispatchSpawn(ent);
    
    
TeleportEntity(entparticleOriginNULL_VECTORNULL_VECTOR);
    
    
    
SetVariantString("!activator");
    
AcceptEntityInput(ent"SetParent"clientent0);
    
    
ActivateEntity(ent);
    
AcceptEntityInput(ent"Start");
    
    
g_iParticleSystem[client] = EntIndexToEntRef(ent);
    
    return 
true;
}

void RemoveBlood(int client)  

    if(
IsValidEntity(g_iParticleSystem[client]))  
    { 
        
AcceptEntityInput(g_iParticleSystem[client], "Kill"); 
    }
    
    
SetEntityRenderMode(clientRENDER_NORMAL); 
    
g_iParticleSystem[client] = INVALID_ENT_REFERENCE

Wow. Your parameter names and nesting is all wrong.
__________________
Neuro Toxin is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 10-08-2018 , 01:57   Re: Blood Kill Effect
Reply With Quote #6

Quote:
Originally Posted by Neuro Toxin View Post
Wow. Your parameter names and nesting is all wrong.
The param names are very vague and it doesn't make the nesting any easier to understand. Yikes...
__________________
Psyk0tik is offline
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 10-08-2018 , 09:38   Re: Blood Kill Effect
Reply With Quote #7

any other ideas?
__________________
kratoss1812 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 07:32.


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