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

Simulate HS kill


Post New Thread Reply   
 
Thread Tools Display Modes
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 01-02-2015 , 07:45   Re: Simulate HS kill
Reply With Quote #11

But I don't know if Ham_Killed passes the trace as a parameter, i'd want the players to die like headshoted. I think the method with TraceAttack would be better, because it imitates fully and directly the shot of the kill. I'll just need to fix that with the last alive player. So any help is still highly appreciated.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 01-02-2015 , 08:49   Re: Simulate HS kill
Reply With Quote #12

He told you to set dieing player's m_LastHitGroup (with set_pdata_int()) to HIT_HEAD, that should work with Ham_Killed.
klippy is online now
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 01-02-2015 , 09:33   Re: Simulate HS kill
Reply With Quote #13

Lol, that was good. Actually, it worked like a charm! Thanks, dudes, for the help. That's some usefull knowing for now on! And the code, if anyone is interested:
PHP Code:
#include <amxmodx> 
#include <fakemeta> 
#include <hamsandwich> 

const m_LastHitGroup 75
new bool:g_bMagicKillActivated


new const WEAPON[] = "weapon_deagle"    
new const ACCESS ADMIN_LEVEL_H        


public plugin_init() 

    
register_plugin("Insta Deagle HS""1.0""Flicker"
    
RegisterHam(Ham_Weapon_PrimaryAttackWEAPON"onPrimaryAttack"true
    
register_message(get_user_msgid("DeathMsg"), "msgDeathMsg")


public 
msgDeathMsg(iddestent)
{
    if(
g_bMagicKillActivated)
    {
        new 
szWeapon[15]
        
formatex(szWeaponcharsmax(szWeapon), WEAPON)
        
replace(szWeaponcharsmax(szWeapon), "weapon_""")
        
set_msg_arg_string(4szWeapon)
    }
    return 
PLUGIN_CONTINUE
}

public 
onPrimaryAttack(ent

    new 
id pev(entpev_owner)
    new 
clip get_pdata_int(ent514// cs_get_weapon_ammo(get_pdata_cbase(id, 373)) 
    
    
if(!clip || !(get_user_flags(id) & ACCESS))    return 
    
    new 
szTeam[15
    
copy(szTeamcharsmax(szTeam), get_user_team(id)  == "CT" "TERRORIST")
    
    new 
players[32], num 
    get_players
(playersnum"aeh"szTeam
    new 
iNum num num 
    
    g_bMagicKillActivated 
true
    
for(new iiNumi++) 
    {
        
set_pdata_int(players[i], m_LastHitGroupHIT_HEAD)
        
ExecuteHam(Ham_Killedplayers[i], id0)
    } 
    
g_bMagicKillActivated false

__________________

Last edited by Flick3rR; 01-02-2015 at 09:33.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Reply


Thread Tools
Display Modes

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 13:25.


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