AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [help] with entity (https://forums.alliedmods.net/showthread.php?t=140268)

QuickNet 10-10-2010 07:48

[help] with entity
 
hello,
i have the number of my 'ent'.
i want to know who press it,

(for deathrun)

i got this:
PHP Code:

public pfw_killed(idattackershouldgib

    new 
classname[32
    
pev(attackerpev_classnameclassname31

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

    client_print
(idprint_chat"KILLED BY TRIGGER HURT ent: %d"attacker
     
    return 
HAM_IGNORED 


how can i take the name who press the bottun?

shuttle_wave 10-10-2010 07:54

Re: [help] with entity
 
PHP Code:

new szName[32];
get_user_name(idszNamecharsmax(szName)); 


QuickNet 10-10-2010 07:57

Re: [help] with entity
 
can you add your code to my code?
( i think this no work )
the code take the name but, the name who press the bottun?

QuickNet 10-11-2010 01:54

Re: [help] with entity
 
BUMP

nikhilgupta345 10-11-2010 02:50

Re: [help] with entity
 
Code:

public pfw_killed(id, attacker, shouldgib)
{
    new
classname[32], name[32]
   
pev(attacker, pev_classname, classname, 31)
    get_user_name(id, name, 31)
    if (!
equal(classname, "trigger_hurt"))
        return
HAM_IGNORED

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




QuickNet 10-11-2010 08:45

Re: [help] with entity
 
doesn't work..
that print my name..
i also tried to change
'trigger_hurt'
to
'func_door'

QuickNet 10-15-2010 21:25

Re: [help] with entity
 
BUMP

nikhilgupta345 10-15-2010 21:47

Re: [help] with entity
 
What do you mean it print your name? Isnt' that what you want? The person who pressed the button? Or were you not the one who pressed it.

QuickNet 10-15-2010 22:05

Re: [help] with entity
 
Quote:

Originally Posted by nikhilgupta345 (Post 1325924)
What do you mean it print your name? Isnt' that what you want? The person who pressed the button? Or were you not the one who pressed it.

no,
if someone kill me so that need to print he's name..
and that print my name..
[i wasn't pressed it]

Exolent[jNr] 10-16-2010 01:51

Re: [help] with entity
 
Quote:

Originally Posted by QuickNet (Post 1325916)
BUMP

Don't bump until 2 weeks have passed since last post.


All times are GMT -4. The time now is 10:19.

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