![]() |
Finding Killer
Is there a way to find, if a player dies, who killed the player?
|
No. You will have to code something yourself.
|
Would be helpful if there was a reference to the object of the PKer passed or something D:
|
Use triggerAction() to send the account information of the player hurting another player to the player getting hurt then whenever that player dies, simply read the account sent for the person that last hit him to read who he was killed by.
|
If you're using default? Not really. If you're persistent, you can add a weapon that duplicates default HD without the actual HD, and simply use it to detect who is hitting you.
|
I was wondering this myself when I was making a Classic-Mode for Zodiac CTF.
Stefan should/could add an event on the serverside, I'd imagine this wouldn't be that hard because the server already handles the adding of player.kills + player.deaths. function onPlayerKilled(killer_obj) { } |
I found this, and figured I could use this idea except instead of using onweaponfired, use onkeydown, keypress = "s". Although, if someone wouldnt mind helping sort through this to get to just the part that has to deal with the radius of the player, and marking who the player killed... xD
http://forums.graalonline.com/forums...ad.php?t=68271 |
Quote:
Don't check if the player presses the 's' key, use the keydown() value just in case the player alters their default control configuration (via the F3 menu). Also, what I said a few posts above still holds merit. Send a triggerAction() when the player swings their sword and have whoever they hit catch the action and work from there. |
Quote:
Good: PHP Code:
Bad: PHP Code:
|
I figure that:
PHP Code:
|
Quote:
PHP Code:
|
Quote:
|
Theoretically we could add an event for it, something like onPlayerKilled or so. Right now the only way to detect would be to check if the kills increased, although that doesn't tell you who killed who.
|
Quote:
edit, nvm i understand thats the only way to do it inside an event. |
Quote:
Quote:
|
How do you check to see if the players kills increased? That would be sufficient for what Im doing possibly.
Also, stefan, adding an even for that would probably be very very helpful to the entire graal community. |
Quote:
|
I would personally think if you were looking for who killed a player, better to pass through who killed it, rather than checking the hit each time to see if the player died.
|
Quote:
|
Quote:
anyone? |
Quote:
|
It's not hard to detect who you were killed by if your bow and bomb (unless you use putbomb) have custom scripts for compatibility with gmaps.
I'd imagine if you had a function to find the closest player with the sword animation within range when you the player dies, that would pretty much pinpoint the killer, but it's not a perfect detection method and could produce false positives. I.e: PHP Code:
|
Does onWasH!t() return any useful parameters?
Edit: WOW, censorship FTL |
For playerhurt, does this still apply in gs2?
Quote:
Quote:
Would that work? Am I correct? Or is my logic wrong? |
Quote:
|
Ok, well again I ask if anyone knows how to see if the players kils increase? Wouldn't even know what variable to use for that.
|
Quote:
you could shove it in a timeout in the clientside and send a triggeraction to the server whenever it increases, but it seems messy and likely to fail to me. |
onPlayerDies() is only clientside correct? or can it be serverside?
|
Quote:
|
detects clientside :)
|
| All times are GMT +2. The time now is 04:18 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.