Raised This Month: $ Target: $400
 0% 

How to detect exactly special Attacker


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
newcomer
Member
Join Date: Aug 2011
Old 04-24-2013 , 05:43   How to detect exactly special Attacker
Reply With Quote #1

I have try detect special attacker, but it's not excatly, sometimes it's not show anything.
And I thing the code isn't well, my server have little laggy if run this detect
Please help me
Note: STEAM_0:0:1111111111 is just example
Quote:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define IsPlayer(%1) (1<=%1<=g_MaxPlayers)

new g_MaxPlayers;
new bool:detected[33]
new g_szAuthid[33]

public plugin_init()
{
RegisterHam(Ham_TraceAttack, "player", "HamTraceAttack")
g_MaxPlayers = get_maxplayers()
}

public client_putinserver(id)
{
detected[id] = false
set_task(2.0,"detect_player",id)
}

public detect_player(id)
{
get_user_authid(id, g_szAuthid[id], 32)
if (equal(g_szAuthid, "STEAM_0:0:1111111111"))
{
detected[id] = true
}
else
{
detected[id] = false
}
}

public HamTraceAttack(Vic, Att, Float:dmg, Float:dir[3], traceresult, dmgbits)
{
if (!detected[Att] || Vic == Att || !IsPlayer(Att))
{
return HAM_IGNORED;
}


if (detected[Att])
{
if (get_tr2(traceresult,TR_iHitgroup) == HIT_HEAD)
{
client_print(detected[Att], print_chat,"You're pro")
}
return HAM_IGNORED;
}

return HAM_IGNORED;
}

Last edited by newcomer; 04-24-2013 at 09:12.
newcomer is offline
 



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 10:51.


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