when console kills someone (with ply:Kill(), in reference to [url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexbdc5.html]this[/url]), what will the killer's name be?
You could test it out, but I think it returns nil. (the entity not the killers name)
How can console kill someone when it is not a player?
Though if you slay the bot through console with an admin mod then it would say:
Player Suicided.
[QUOTE=bluemist;39926614]How can console kill someone when it is not a player?
Though if you slay the bot through console with an admin mod then it would say:
Player Suicided.[/QUOTE]
ply:Kill()
[QUOTE=jack10685;39926741]ply:Kill()[/QUOTE]
Player Suicided.
(Prediction)
[QUOTE=bluemist;39926834]Player Suicided.[/QUOTE]
you asked how console could kill someone if it is not a player, anyways, back on topic. I'll test this in a few days when I get back from my trip.
I'm not sure how you are going to give console a gun though good luck on your testing.
[img]http://puu.sh/2ilMq[/img]
[QUOTE=Greetings;39927225][img]http://puu.sh/2ilMq[/img][/QUOTE]
so it's bot01? on my phone and all images are blurry and hard to read.
edit - i like how it says im on iphone + safari, when im on android +dolphin browser
Yes, the victim and the killer will be the same if a player suicides or is slain using Player.Kill. In this case, Bot01 is both victim and killer.
[QUOTE=Greetings;39928709]Yes, the victim and the killer will be the same if a player suicides or is slain using Player.Kill. In this case, Bot01 is both victim and killer.[/QUOTE]
so I can use
[lua]if victim:SteamID() = killer:SteamID() && not victim:Name() = weapon then
code code code
end[/lua]
You have to define victim and killer I think, not sure though.
what would it be if they suicided?
The victim and killer would both be themself.
[QUOTE=Derek_SM;39936088]The victim and killer would both be themself.[/QUOTE]
I know, but what would the weapon be?
[lua]
hook.Add( "PlayerDeath", "test", function( victim, inflictor, killer )
print( type( inflictor ), inflictor:Name() || "NULL", inflictor:GetClass() || "NULL" );
end );
[/lua]
Console output on suicide: (My Steam name is Yes.)
Player Yes. player
So:
Inflictor type: Player
Inflictor name: Person who committed suicide.
Inflictor class: player
[QUOTE=jack10685;39936114]I know, but what would the weapon be?[/QUOTE]
I think the keyboard may be the weapon. As the keyboard was used to trigger this script to kill the bot.
[QUOTE=Greetings;39936418][lua]
hook.Add( "PlayerDeath", "test", function( victim, inflictor, killer )
print( type( inflictor ), inflictor:Name() || "NULL", inflictor:GetClass() || "NULL" );
end );
[/lua]
Console output on suicide: (My Steam name is Yes.)
Player Yes. player
So:
Inflictor type: Player
Inflictor name: Person who committed suicide.
Inflictor class: player[/QUOTE]
thanks, mate.
Sorry, you need to Log In to post a reply to this thread.