[Support] Code for distance meter for trickshots?
-
it did not work it says it when someone dies not when they get a kill
-
It does work, I tested it just now. I'm not sure what the problem is.
-
Sass this is what i do as Deicide told me but it says it when someone dies not when they get a kill
onPlayerKilled(einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime, deathanimduration) { thread [[level.onkillscore]](einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime, deathanimduration); // ^ this is here so you can still score normally iPrintLn(int(distance(self.origin, attacker.origin)*0.0254) + "m away"); }
-
Duui YT
When someone dies, does another player not get a kill?
1 KILL (attacker) = 1 DEATH (self)You're literally making no sense when it comes to this. Instead of spamming the forums with questions over and over, how about do some research into the game files and ask YOURSELF, "why is this script behaving like this?" Instead of asking a million questions on the forums. (Which could all be solved on your own if you put a little time into learning)
I personally don't like the idea of someone running a server that only knows how to copy and paste other people's scripts, but couldn't tell you how any of them work. This is exactly the type of stuff that leads to servers crashing more frequently due to poorly made/unstable scripts being used by someone who doesn't know that it is poorly made/unstable.
Research GSC there's plenty of information out on the internet.
-
Backing up on what Cahz , this is basic GSC knowledge. If you're willing to host servers with mods, you should atleast take the time to learn and comprehend how the script works. We could babysit you through the whole process, but that will never play in your favor and you'll be stuck because of the smallest issues such as this one. You can find plenty of resources and even tutorials with enough searching. Please take some time to learn, it will help you alot.
-
so i did do some research on it but can't get it. so this what happens when i die it says (X m away) and not when i kill someone so when i die it says it so how can i make it not say it when i die and i did try calling it on onplayerdamge but that did not work
-
If you want it to show when you kill someone, then don't remove
attacker
, simple as that. If you want it to show for everyone, maybe do something like aforeach(player in level.players)
and useplayer
instead ofattacker
?I don't know, there are plenty of ways to do this, you have to give it more thought than that.
-
so i did do some research on how to use foreach. so i did it like this still the same thing
onPlayerKilled(einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime, deathanimduration) { foreach(player in level.players) { thread [[level.onkillscore]] (einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime, deathanimduration); // ^ this is here so you can still score normally player iPrintLn(int(distance(self.origin, attacker.origin) * 0.0254) + "m away"); } }
-
The script you've made gives point to every player once you get a kill... This isn't about "doing research" at this point, this is about knowing how to script at all.
The following should work, but PLEASE take some time to LEARN how to do such simple tweaks :
onPlayerKilled(einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime, deathanimduration) { thread [[level.onkillscore]](einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime, deathanimduration); foreach(player in level.players) player iPrintLn( attacker.name + " killed " + self.name + " from " + int(distance(self.origin, attacker.origin)*0.0254) + "m away"); }
-
This post is deleted!
-
gunji you can check on player kill whether or not the player/teams score is equal to that of the score required to win the mode.
-
gunji you just check if the attacker is on last, nothing to do with the gameended notify