Raised This Month: $51 Target: $400
 12% 

Deathtype Effects


Post New Thread Reply   
 
Thread Tools Display Modes
Doctros
AlliedModders Donor
Join Date: Apr 2011
Location: Chicago ILL. USA
Old 05-14-2011 , 11:49   Re: Deathtype Effects
Reply With Quote #21

Ok, Thanks
Attached Files
File Type: sma Get Plugin or Get Source (dbmod.sma - 857 views - 142.0 KB)
Doctros is offline
Doctros
AlliedModders Donor
Join Date: Apr 2011
Location: Chicago ILL. USA
Old 05-20-2011 , 06:19   Re: Deathtype Effects
Reply With Quote #22

Hello, Is anybody going to look into this for me?

PLEASE!!!
Doctros is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 05-20-2011 , 12:49   Re: Deathtype Effects
Reply With Quote #23

Try this, untested.

PHP Code:
#include <amxmodx>

#define PLUGIN "Deathtype Effects"
#define VERSION "1.0"
#define AUTHOR "anakin_cstrike"

#define TEMP_MSG    16
#define TEMP_MSG2    1936

new toggle_plugin,toggle_hs,toggle_kn,toggle_he,g_Smoke,g_Lightning,g_Explode;
public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_event("DeathMsg","hook_death","a");
    
toggle_plugin register_cvar("death_effects","1");
    
toggle_hs register_cvar("hs_effect","1");
    
toggle_kn register_cvar("kn_effect","1");
    
toggle_he register_cvar("he_effect","1");
}
public 
plugin_precache()
{
    
precache_sound("ambience/thunder_clap.wav");
    
precache_sound("weapons/headshot2.wav");
    
precache_sound("weapons/explode3.wav");
    
g_Smoke precache_model("sprites/steam1.spr");
    
g_Lightning precache_model("sprites/lgtning.spr");
    
g_Explode precache_model("sprites/white.spr");
    return 
PLUGIN_CONTINUE
}
public 
hook_death()
{
    if(
get_pcvar_num(toggle_plugin) != 1) return PLUGIN_CONTINUE;
    if(!
read_data(1)) return PLUGIN_CONTINUE;
    new 
wpn[3],vOrigin[3],coord[3];
    new 
victim read_data(2);
    new 
hs read_data(3);
    
read_data(4,wpn,2);
    if(
is_user_connected(victim))
    {
        
get_user_origin(victim,vOrigin);
        
vOrigin[2] -= 26
        coord
[0] = vOrigin[0] + 150;
        
coord[1] = vOrigin[1] + 150;
        
coord[2] = vOrigin[2] + 800;
    }
    
    if(
hs && wpn[0] != 'k' && wpn[1] != 'r' && get_pcvar_num(toggle_hs) == 1)
    {
        
create_explode(vOrigin);
        
emit_sound(victim,CHAN_ITEM"weapons/explode3.wav"1.0ATTN_NORM0PITCH_NORM);
    }
    if(
wpn[0] == 'k' && !hs && get_pcvar_num(toggle_kn) == 1)
    {
        
create_thunder(coord,vOrigin);
        
emit_sound(victim,CHAN_ITEM"ambience/thunder_clap.wav"1.0ATTN_NORM0PITCH_NORM);
    }
    if(
wpn[1] == 'r' && !hs && get_pcvar_num(toggle_he) == 1)
    {
        
create_blood(vOrigin);
        
emit_sound(victim,CHAN_ITEM"weapons/headshot2.wav"1.0ATTN_NORM0PITCH_NORM);
    }
    return 
PLUGIN_CONTINUE;
}

create_explode(vec1[3])
{
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY,vec1);
    
write_byte(TE_BEAMCYLINDER);
    
write_coord(vec1[0]); 
    
write_coord(vec1[1]); 
    
write_coord(vec1[2] + TEMP_MSG); 
    
write_coord(vec1[0]); 
    
write_coord(vec1[1]); 
    
write_coord(vec1[2] + TEMP_MSG2); 
    
write_short(g_Explode); 
    
write_byte(0);
    
write_byte(0); 
    
write_byte(2); 
    
write_byte(16);
    
write_byte(0);
    
write_byte(188); 
    
write_byte(220);
    
write_byte(255); 
    
write_byte(255); 
    
write_byte(0); 
    
message_end();

    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY); 
    
write_byte(TE_EXPLOSION2); 
    
write_coord(vec1[0]); 
    
write_coord(vec1[1]); 
    
write_coord(vec1[2]); 
    
write_byte(185); 
    
write_byte(10); 
    
message_end();
    
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY,vec1); 
    
write_byte(TE_SMOKE); 
    
write_coord(vec1[0]); 
    
write_coord(vec1[1]); 
    
write_coord(vec1[2]); 
    
write_short(g_Smoke); 
    
write_byte(2);  
    
write_byte(10);  
    
message_end();
}
create_thunder(vec1[3],vec2[3])
{
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY); 
    
write_byte(0); 
    
write_coord(vec1[0]); 
    
write_coord(vec1[1]); 
    
write_coord(vec1[2]); 
    
write_coord(vec2[0]); 
    
write_coord(vec2[1]); 
    
write_coord(vec2[2]); 
    
write_short(g_Lightning); 
    
write_byte(1);
    
write_byte(5);
    
write_byte(2);
    
write_byte(20);
    
write_byte(30);
    
write_byte(200); 
    
write_byte(200);
    
write_byte(200);
    
write_byte(200);
    
write_byte(200);
    
message_end();

    
message_beginMSG_PVSSVC_TEMPENTITY,vec2); 
    
write_byte(TE_SPARKS); 
    
write_coord(vec2[0]); 
    
write_coord(vec2[1]); 
    
write_coord(vec2[2]); 
    
message_end();
    
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY,vec2); 
    
write_byte(TE_SMOKE); 
    
write_coord(vec2[0]); 
    
write_coord(vec2[1]); 
    
write_coord(vec2[2]); 
    
write_short(g_Smoke); 
    
write_byte(10);  
    
write_byte(10)  
    
message_end();
}
create_blood(vec1[3])
{
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY); 
    
write_byte(TE_LAVASPLASH); 
    
write_coord(vec1[0]); 
    
write_coord(vec1[1]); 
    
write_coord(vec1[2]); 
    
message_end(); 


Last edited by bibu; 05-22-2011 at 04:45.
bibu is offline
Doctros
AlliedModders Donor
Join Date: Apr 2011
Location: Chicago ILL. USA
Old 05-22-2011 , 01:40   Re: Deathtype Effects
Reply With Quote #24

Thanks, bibu

However what you posted does not compile. I get this error:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

deathtype_effects.sma(39) : error 001: expected token: ")", but found "{"

1 Error.
Could not locate output file deathtype_effects.amx (compile failed).


ERROR: Your plugin failed to compile, see above.

What do I need to change?

Thanks!
Doctros is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 05-22-2011 , 04:45   Re: Deathtype Effects
Reply With Quote #25

Had a typo, now you can compile it. But no idea if it fixes your problem.
bibu is offline
Doctros
AlliedModders Donor
Join Date: Apr 2011
Location: Chicago ILL. USA
Old 05-22-2011 , 18:42   Re: Deathtype Effects
Reply With Quote #26

Thanks bibu,

It worked Great! Thanks for the help!!!

So far no error messages!!!!

I give you 5 bacon!
Excellent!
Doctros is offline
Asim0
Member
Join Date: Aug 2010
Old 02-07-2014 , 14:56   Re: Deathtype Effects
Reply With Quote #27

http://www.youtube.com/watch?v=m2LcmPYYxD4
Asim0 is offline
FN_Productions
Member
Join Date: Mar 2014
Old 02-09-2015 , 22:54   Re: Deathtype Effects
Reply With Quote #28

Great Plugin!
FN_Productions is offline
Send a message via Skype™ to FN_Productions
Old 01-16-2022, 15:52
lautaro2021
This message has been deleted by lautaro2021.
Midnight Kid
Member
Join Date: Aug 2017
Location: Chornobay, Ukraine
Old 01-28-2022 , 15:28   Re: Deathtype Effects
Reply With Quote #29

lautaro2021, try that.
New cvar hs_clear (0 / 1) - switch simultaneous show of the headshot effect with the particular kills effects (by knife and grenade).
Attached Files
File Type: sma Get Plugin or Get Source (deathtype_effects.sma - 146 views - 3.8 KB)
Midnight Kid is offline
Old 02-06-2022, 16:15
lautaro2021
This message has been deleted by lautaro2021.
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 09:56.


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