ich bräuchte Hilfe bei einem Battlefield 2 Python Code.
http://bf2.fun-o-matic.org/index.php/Sc ... BaseRapeMM
Das Script verhindert, dass man "Hauptbasen" nicht angreifen kann. Tut man es dennoch, so werden einige Strafen eingeleitet. Erst Verwarnungen und dann wird man eliminiert
Ich fände es toll, wenn mir jemand helfen könnte das Script zu umzubauen, dass es nur bei Fahrzeugen Strafen einleitet.
Code: Alles auswählen
# ------------------------------------------------------------------------
# Punish attacker, give victim life back and inform all
# ------------------------------------------------------------------------
def justify(self, attacker, victim, controlPoint, distanceTo):
victim.score.deaths += -1
attacker.score.kills += -1
attacker.score.score += -2 - attacker.baseRapeWarning
attacker.baseRapeWarning += 1
self.sendWarning(attacker, controlPoint, distanceTo)
if attacker.baseRapeWarning > ALLOWED_SAFEBASEKILLS:
attacker.score.TKs += 1
if attacker.isAlive():
vehicle = attacker.getVehicle()
rootVehicle = getRootParent(vehicle)
if getVehicleType(rootVehicle.templateName) == VEHICLE_TYPE_SOLDIER:
rootVehicle.setDamage(0)
# This should kill them !
else:
rootVehicle.setDamage(1)
# a vehicle will likely explode within 1 sec killing entire crew,
# not so sure about base defenses though
Ich habe es auch schon versucht, aber da ich mich absolut nicht mit Python auskenne und für dieses eine Script wohl auch nicht lohnt es zu lernen, wäre es nett, wenn mir jemand helfen könnte. Folgendes habe ich schon probiert, aber dannach blieb das Script "deaktiviert":
Code: Alles auswählen
# ------------------------------------------------------------------------
# Punish attacker, give victim life back and inform all
# ------------------------------------------------------------------------
def justify(self, attacker, victim, controlPoint, distanceTo):
vehicle = attacker.getVehicle()
rootVehicle = getRootParent(vehicle)
if getVehicleType(rootVehicle.templateName) == VEHICLE_TYPE_SOLDIER:
return
else:
victim.score.deaths += -1
attacker.score.kills += -1
attacker.score.score += -2 - attacker.baseRapeWarning
attacker.baseRapeWarning += 1
self.sendWarning(attacker, controlPoint, distanceTo)
if attacker.baseRapeWarning > ALLOWED_SAFEBASEKILLS:
attacker.score.TKs += 1
if attacker.isAlive():
vehicle = attacker.getVehicle()
rootVehicle = getRootParent(vehicle)
if getVehicleType(rootVehicle.templateName) == VEHICLE_TYPE_SOLDIER:
return
else:
rootVehicle.setDamage(1)