GSC editing score help.
-
Hello,
I have been working on gungame GSC script, the script will be ran on a default free for all match. I can't seem to figure out how to edit a players score but I need to edit the score when a player gets a double kill with a launcher.
I am trying to avoid the count of multiples kills when a player gets kills with a rocket, I just want the first kill to count.
Anyone have a idea of how to handle this edge case? -
For anyone looking for a solution, I did not find a way to edit score yet. But I did come across a work around.
init() { level.callbackplayerdamagestub = level.callbackplayerdamage; level.callbackplayerdamage = ::cancelDamage; } cancelDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset ) { if (SOME LOGIC HERE) { iDamage = 0; } self [[level.callbackplayerdamagestub]]( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset ); }
You can do logic in this callback function, such as canceling damage to a second target.
-
HazeOnPlutonium The score will be still registred
-
Sorex Mind elaborating?
The current implementation works for me. Ill probably have to do more in-depth testing, but as of now I have found not real issues. The logic I have checks to see if the damage is being done with the correct weapon in the cycle, and if you kill someone with a rocket and someone else is standing next to them it will cancel the damage because the player will already be on the next weapon making the statement trueeWeapon != eAttacker getWeapon()
. I have tested this with all the launchers.