Morimaru Posted January 14, 2021 Report Share Posted January 14, 2021 Hi all, I'm looking for a script for my private mod that shows the distance in meters of a headshot on the notification feed. *Example - [ Headshot ] J. Doe [ 117m] My modding knowledge is plenty basic, and absolutely no idea about phyton coding. I'm trying to understand phyton files of Wookie's Sniper Mod (that makes the thing) but I am mental blind, because I understand nothing. Some helpful soul bring me a hand? Thank you so much! Quote Link to comment Share on other sites More sharing options...
Morimaru Posted January 21, 2021 Author Report Share Posted January 21, 2021 (edited) I'm on the right way? Quote class killevent: def __init__(self, attacker, victim, template): self.attacker = attacker self.victim = victim # determine target distance distance = vector.getDistance(playermanager.getPosition(attacker), playermanager.getPosition(victim)) self.distance = int(math.ceil(distance)) self.distanceScore = int(math.ceil(distance/100.0) * 5) self.weapon = constant.getName(template) self.weaponType = constant.getType(template) def process(self): # determine hit region if self.victim.isManDown() == 0: self.region = "headshot" self.regionScore = 20 else: self.region = "bodyshot" self.regionScore = 0 # SCORE / MESSAGE # rifle score elif self.weaponType == constant.rifle: self.score = self.distanceScore + self.regionScore + self.speedScore + self.stanceScore self.text = "%s [%s] %s [%+i] (%sm - %s - %s - %s)" % (playermanager.getName(self.attacker), self.weapon, playermanager.getName(self.victim), self.score, self.distance, self.region) common.message(self.text) Edited January 21, 2021 by Morimaru Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.