HonzaVinCZ 18 Posted July 30, 2019 Hello, guys. I have done this script but it won't take away instigator's score and shows "any" instead of -100 points in system message. Any help please? Also if possible, could you give me a advice how to set message to show score ammount taken not in minus? Thank you! // Turn Punishments ON/OFF _run = true; // Turn Civillian Punishment ON/OFF //_civillianPunishment = true; // How many points take away to instigator for civillian killed - WORKS ONLY IF _civillianPunishment = true _civilianPunishmentPoints = -100; // Turn Team Kill Punishment ON/OFF //_teamKillPunishment = true; // How many points take away to instigator for teamkill - WORKS ONLY IF _teamKillPunishment = true _teamKillPunishmentPoints = -100; if (_run) then { addMissionEventHandler ["EntityKilled", { params ["_killed", "_killer", "_instigator"]; // UAV/UGV player operated road kill if (isNull _instigator) then { _instigator = UAVControl vehicle _killer select 0 }; // player driven vehicle road kill if (isNull _instigator) then { _instigator = _killer }; // Civillian Punishment if ((side group _killed == civilian) && (isPlayer _instigator)) then { if (isServer) then { _instigator addScore _civilianPunishmentPoints}; systemChat format ["%1 killed a civilian, he loses %2 score.", name _instigator, _teamKillPunishmentPoints]; }; // Team Kill Punishment if ((side group _killed == side _instigator) && (isPlayer _instigator)) then { if (isServer) then { _instigator addScore _teamKillPunishmentPoints}; systemChat format ["%1 did a team kill, he loses %2 score.", name _instigator, _teamKillPunishmentPoints]; }; }]; }; Share this post Link to post Share on other sites
wogz187 1085 Posted July 30, 2019 @HonzaVinCZ, _instigator addScore _civilianPunishmentPoints}; systemChat format ["%1 killed a civilian, he loses %2 score.", name _instigator, _teamKillPunishmentPoints];<--- is this a typo? Should be civilian? I'm not sure what the issue is. It's supposed to read, Quote "Player did a team kill, he loses -100 score." but says, Quote "Player did a team kill, he loses any score." and ideally you want it to say, Quote "Player did a team kill, he loses 100 score." I'd like to see this script work because I'll soon need something similar. Following... Quote Any help please? Given the context that is a pun. 😉 1 Share this post Link to post Share on other sites
HonzaVinCZ 18 Posted July 30, 2019 So... I still didn't found how to make it work. The problem are just number variables. When I set numbers in addScore manually, it works well but it won't work with variables I set. I must have it written wrong so I would like to ask you how I could write those number variables right because I have no idea how to write it. Share this post Link to post Share on other sites
HonzaVinCZ 18 Posted July 30, 2019 I was so lucky and I had to laugh what I noticed. In this situation you need to type variable without that "_" and then it will work. I was trying everything and then I tried to remove those "_" in variables containing just number and it worked! So then I could finish this script. Not sure with using "if-then" in this situation to turn on/off civilian or team kill punishment... it was just not working if even "if" was true so I removed that and let script be like this: // Turn Punishments ON/OFF _run = true; // How many points take away to instigator for civillian killed civilianPunishmentPoints = -100; // How many points take away to instigator for teamkill teamKillPunishmentPoints = -100; // Score to kick for is <= kickPoints kickPoints = -500; if ((_run) && (isServer)) then { civilianPunishmentPointsABS = abs civilianPunishmentPoints; teamKillPunishmentPointsABS = abs teamKillPunishmentPoints; addMissionEventHandler ["EntityKilled", { params ["_killed", "_killer", "_instigator"]; // UAV/UGV player operated road kill if (isNull _instigator) then { _instigator = UAVControl vehicle _killer select 0 }; // player driven vehicle road kill if (isNull _instigator) then { _instigator = _killer }; // Civillian Punishment if ((side group _killed == civilian) && (isPlayer _instigator)) then { _instigator addScore civilianPunishmentPoints; systemChat format ["%1 killed a civilian, he loses %2 score.", name _instigator, civilianPunishmentPointsABS]; }; // Team Kill Punishment if ((side group _killed == side _instigator) && (isPlayer _instigator)) then { _instigator addScore teamKillPunishmentPoints; systemChat format ["%1 did a team kill, he loses %2 score.", name _instigator, teamKillPunishmentPointsABS]; }; // Kick For Too Bad Points if ((score _instigator <= kickPoints) && (isPlayer _instigator)) then { _uid = getPlayerUID _instigator; systemChat format ["%1 has been kicked for killing too many civillians and/or team kills", name _instigator]; serverCommand format ["#kick %1", _uid]; }; }]; }; Hopefully someone find it helpful! 1 Share this post Link to post Share on other sites
Larrow 2801 Posted July 31, 2019 7 hours ago, HonzaVinCZ said: civilianPunishmentPointsABS = abs civilianPunishmentPoints; teamKillPunishmentPointsABS = abs teamKillPunishmentPoints; No need to set up separate global vars just for systemChat message. Just use abs in the systemChat lines. systemChat format ["%1 did a team kill, he loses %2 score.", name _instigator, abs teamKillPunishmentPoints]; 3 1 Share this post Link to post Share on other sites