PDA

View Full Version : Doesnt read...


edgaras85
06-20-2010, 19:34
if (Killer == engfunc( EngFunc_FindEntityByString, iEntity, "classname", "trigger_hurt" ))
{
//my code
}

Why not reading?

wrecked_
06-20-2010, 19:36
I'm pretty sure it counts as worldspawn when someone dies by trigger_hurt.

edgaras85
06-21-2010, 05:03
I'm pretty sure it counts as worldspawn when someone dies by trigger_hurt.
i was made like this :
if (Killer == find_ent_by_class"func_trigger_hurt")
{
//mycode
}
But it counts all entitys not only trigger hurt...

xPaw
06-21-2010, 08:15
roflcopteralert! Seriously, you really think that this code will work?

edgaras85
06-21-2010, 08:35
roflcopteralert! Seriously, you really think that this code will work?
Whats wrong?
maybe you have some ideas?

Alka
06-21-2010, 12:14
@xPaw - New avatar :(

So, what you want to do ? -.-'

edgaras85
06-21-2010, 12:20
@xPaw - New avatar :(

So, what you want to do ? -.-'
Check if killer entity(trigger_hurt)

wrecked_
06-21-2010, 12:51
public DeathMsg()
{
new Killer = read_data( 1 )
new classname[32]
pev( Killer, pev_classname, classname, 31 )

if( equal( classname, "trigger_hurt" ) )
{
// Keep in mind, this may not be executed since it'll probably
// be worldspawn that's registered as the killer

// ...
}
}

mottzi
06-21-2010, 12:57
@wrecked_ (https://forums.alliedmods.net/member.php?u=66803)

can you explain me what

equal

is?

wrecked_
06-21-2010, 13:00
http://www.amxmodx.org/funcwiki.php?search=equal&go=search

mottzi
06-21-2010, 13:05
wow, i didnt know that my english is so bad..

thank u

wrecked_
06-21-2010, 13:34
thank u
No problem.

edgaras85
06-21-2010, 13:58
Code:
public DeathMsg()</p><p>{</p><p>&nbsp;&nbsp;&nbsp;&nbsp;new Killer = read_data( 1 )</p><p>&nbsp;&nbsp;&nbsp;&nbsp;new classname[32]</p><p>&nbsp;&nbsp;&nbsp;&nbsp;pev( Killer, pev_classname, classname, 31 )</p><p>&nbsp;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;if( equal( classname, "trigger_hurt" ) )</p><p>&nbsp;&nbsp;&nbsp;&nbsp;{</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Keep in mind, this may not be executed since it'll probably</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// be worldspawn that's registered as the killer</p><p>&nbsp;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// ...</p><p>&nbsp;&nbsp;&nbsp;&nbsp;}</p><p>}


Something like that but still
my code working from all entitys...
like func_door,func_door_rotating

wrecked_
06-21-2010, 14:38
Something like that but still
my code working from all entitys...
like func_door,func_door_rotating
What?

edgaras85
06-21-2010, 14:50
What?
With your code still reads all entitys...(works my code with all entitys...)
like func_door and others not ONLY trigger_hurt....

ot_207
06-21-2010, 16:54
// plugin_init!
RegisterHam(Ham_TakeDamage, "player", "pfw_takedamage", 1)

public pfw_takedamage(id, inflictor, attacker, Float:damage, bits)
{
new classname[32]
pev(inflictor, pev_classname, classname, 31)

client_print(id, print_chat, "CLSNAME %s, Damage %f", classname, damage)

return HAM_IGNORED
}

edgaras85
06-21-2010, 17:10
// plugin_init!
RegisterHam(Ham_TakeDamage, "player", "pfw_takedamage", 1)

public pfw_takedamage(id, inflictor, attacker, Float:damage, bits)
{
new classname[32]
pev(inflictor, pev_classname, classname, 31)

client_print(id, print_chat, "CLSNAME %s, Damage %f", classname, damage)

return HAM_IGNORED
}
Whats this code do?

ot_207
06-21-2010, 17:13
Shows you the classname and the damage of the inflictor entity.
Edit I am sorry I posted the wrong code. Thought that you wanted damage.

Here is killed by:
// plugin_init!
RegisterHam(Ham_Killed, "player", "pfw_killed", 1)

public pfw_killed(id, attacker, shouldgib)
{
new classname[32]
pev(attacker, pev_classname, classname, 31)

client_print(id, print_chat, "CLSNAME %s", classname)

return HAM_IGNORED
}

It will print you when you are killed the entity that killed you classname.

edgaras85
06-21-2010, 17:51
Shows you the classname and the damage of the inflictor entity.
Edit I am sorry I posted the wrong code. Thought that you wanted damage.

Here is killed by:
// plugin_init!
RegisterHam(Ham_Killed, "player", "pfw_killed", 1)

public pfw_killed(id, attacker, shouldgib)
{
new classname[32]
pev(attacker, pev_classname, classname, 31)

client_print(id, print_chat, "CLSNAME %s", classname)

return HAM_IGNORED
}

It will print you when you are killed the entity that killed you classname.
With wrecked code on works on all entitys
Ot2007 i tested
Like working on func_door and others
but i need only on trigger_hurt

Alka
06-21-2010, 17:59
I'm pretty sure it counts as worldspawn when someone dies by trigger_hurt.
?

ot_207
06-21-2010, 18:00
With wrecked code on works on all entitys
Ot2007 i tested
Like working on func_door and others
but i need only on trigger_hurt

Here:
// plugin_init!
RegisterHam(Ham_Killed, "player", "pfw_killed", 1)

public pfw_killed(id, attacker, shouldgib)
{
new classname[32]
pev(attacker, pev_classname, classname, 31)

if (!equal(classname, "trigger_hurt"))
return HAM_IGNORED

client_print(id, print_chat, "KILLED BY TRIGGER HURT ent: %d", attacker)

return HAM_IGNORED
}