Raised This Month: $ Target: $400
 0% 

Name of the attacker of an entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Speed!
BANNED
Join Date: Jan 2009
Old 02-03-2009 , 19:15   Name of the attacker of an entity
Reply With Quote #1

i wish to know how to get the id of the player who attacks an entity, and the one who break it. im using fakemeta.
i have not much knoweldage with fakemeta, with other modules yes, but fakemeta isnt my strong point at all LOL
Speed! is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 02-03-2009 , 19:46   Re: Name of the attacker of an entity
Reply With Quote #2

You'll probably want to use the ham sandwich module for this.

Look into Ham_TakeDamage and Ham_Killed
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Speed!
BANNED
Join Date: Jan 2009
Old 02-03-2009 , 19:49   Re: Name of the attacker of an entity
Reply With Quote #3

Quote:
Originally Posted by Emp` View Post
You'll probably want to use the ham sandwich module for this.

Look into Ham_TakeDamage and Ham_Killed
does ham_killed work for entitys? O.o

should be like this?
RegisterHam(Ham_Killed, "entity", "fw_PlayerKilled")
Speed! is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 02-03-2009 , 20:00   Re: Name of the attacker of an entity
Reply With Quote #4

Pretty sure it does.

If you plan on replacing "entity" with the classname, yes.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Speed!
BANNED
Join Date: Jan 2009
Old 02-03-2009 , 20:05   Re: Name of the attacker of an entity
Reply With Quote #5

thank you very much emp your help is to useful here
+k
Speed! is offline
Speed!
BANNED
Join Date: Jan 2009
Old 02-03-2009 , 20:43   Re: Name of the attacker of an entity
Reply With Quote #6

it isnt working :S
im doint this

PHP Code:
RegisterHam(Ham_KilledENT_CLASS_NAME"fw_somethingKilled"
PHP Code:
public fw_somethingKilled(victimattackershouldgib)
{
    new 
owner;
    
owner pev(victim,LASERMINE_OWNER);
    new 
name1[2];
    new 
name2[2];
    
get_user_name(ownername1sizeof name1 1);
    
get_user_name(attackername2sizeof name2 1);
    
client_print(ownerprint_chat,"%s blablabla %s"name2name1);
    
client_print(attackerprint_chat,"%s blablabla %s"name2name1);

PHP Code:
    set_pev(i_Ent,pev_classname,ENT_CLASS_NAME);

    
engfunc(EngFunc_SetModel,i_Ent,ENT_MODELS);

    
set_pev(i_Ent,pev_solid,SOLID_NOT);
    
set_pev(i_Ent,pev_movetype,MOVETYPE_FLY);

    
set_pev(i_Ent,pev_frame,0);
    
set_pev(i_Ent,pev_body,3);
    
set_pev(i_Ent,pev_sequence,TRIPMINE_WORLD);
    
set_pev(i_Ent,pev_framerate,0);
    
    
set_pev(i_Ent,pev_takedamage,DAMAGE_YES);
    
    
set_pev(i_Ent,pev_dmg,100.0);
    
set_user_health(i_Ent,get_pcvar_num(g_LHEALTH)); 
message is never shown
Speed! is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-03-2009 , 22:36   Re: Name of the attacker of an entity
Reply With Quote #7

If "ENT_CLASS_NAME" is not a normal classname for entities, then you will need to use RegisterHamFromEntity().
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Speed!
BANNED
Join Date: Jan 2009
Old 02-03-2009 , 22:54   Re: Name of the attacker of an entity
Reply With Quote #8

Quote:
Originally Posted by Exolent[jNr] View Post
If "ENT_CLASS_NAME" is not a normal classname for entities, then you will need to use RegisterHamFromEntity().
will try thnks for the help
Speed! is offline
Speed!
BANNED
Join Date: Jan 2009
Old 02-03-2009 , 23:10   Re: Name of the attacker of an entity
Reply With Quote #9

doesent work O.o
im doing this (probably wrong coz y never used this LOL)

Code:
public spawn (id)
{
new i_Ent = engfunc(EngFunc_CreateNamedEntity,g_EntMine);
...
...
RegisterHamFromEntity(Ham_Killed, i_Ent, "fw_SomethingKilled")
}
Speed! is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-04-2009 , 14:47   Re: Name of the attacker of an entity
Reply With Quote #10

Show the full code.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 02:44.


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