Jump to content

Recommended Posts

I use a rating system that gives you rating or takes it away depending on who you kill. not sure where i got it from.

 

Rating.sqf

Spoiler

// Rating System to improve your standings within the world.

 

null =
 [] spawn {
  while {true} do {
    sleep 2;
    {
      if (isNil {_x getVariable "oldSide"}) then {
        _x setVariable ["oldSide",side _x];
      }
    } forEach allUnits;
  }
};


if (isServer) then {
addMissionEventHandler  ["Entitykilled", {
   params ["_victim","_killer","_zombie"];


   if (!isPlayer _killer or _victim == _killer) exitWith {};

   if (_victim getVariable "oldSide" == west) exitWith {
      [_killer,{_this addRating -3000}] remoteExec ["call",_killer];
      parseText "<t color = '#ff9900'>You just killed a friendly unit!<t/>" remoteExec ["hintsilent",_killer];
    };
    if (_victim getVariable "oldSide" == civilian) exitWith {
      [_killer,{_this addRating -1000}] remoteExec ["call",_killer];
      parseText "<t color = '#A990D4'>You just killed an innocent!<t/>" remoteExec ["hintsilent",_killer];
    };
    if (_victim getVariable "oldSide" == east) exitWith {
      [_killer,{_this addRating 50}] remoteExec ["call",_killer];
      parseText "<t color = '#ff0000'>You just killed an Enemy Man<t/>" remoteExec ["hintsilent",_killer];
    };
    if ((_this select 2) isEqualTo player) then {
      [_killer,{_this addRating 10}] remoteExec ["call",_killer];
//      parseText "<t color = '#ff0000'>You just killed a Zombie<t/>" remoteExec ["hintsilent",_killer];
    };
}];
};
 

 

Added the zombie part with help form Haleks. Ravage mod.

 

Added with one a couple i have made. A script that checks your rating and promotes or demotes you depending on your rating

 

Rank.sqf

Spoiler


[] spawn {
while {alive player} do {

waitUntil {sleep .5; (rating player == 1000)};
if (rating player == 1000) then {[]execVM "Scripts\Rank\Promoted.sqf";};

 

waitUntil {sleep .5; (rating player == -1000)};
if (rating player == -1000) then {[]execVM "Scripts\Rank\demoted.sqf";};

}forEach allUnits;
};
 

 

Promoted.sqf

Spoiler

PromoteUnit = {
    private _rks = ["PRIVATE", "CORPORAL", "SERGEANT", "LIEUTENANT", "CAPTAIN", "MAJOR", "COLONEL"];
    private _old = rankId _this;
    if (count _rks - _old > 1) then {
        _this setUnitRank (_rks select _old + 1);
        systemChat format ["Unit %1 promoted to %2", _this, rank _this];
    }
};
player call PromoteUnit;
 

 

Demoted.sqf

Spoiler

DemoteUnit = {
    private _rks = ["PRIVATE", "CORPORAL", "SERGEANT", "LIEUTENANT", "CAPTAIN", "MAJOR", "COLONEL"];
    private _old = rankId _this;
    if (count _rks - _old > 1) then {
        _this setUnitRank (_rks select _old - 1);
        systemChat format ["Unit %1 demoted to %2", _this, rank _this];
    }
};
player call DemoteUnit;

 

Now the problem i have encounted and cant seem to fix is that the rank.sqf only fires one time. As in you will be promoted one rank or demoted one rank. So you can go form private to corporal but not any higher. Then you can go back from corporal to private. If you get demoted back to private you can still get promoted up to corporal again.

 

The problem may lie in the fact that if you get promoted or demoted your rating goes back to 0. You can also start the game as a Sargent and get promoted once and demoted once.

Not sure what is going on. The promote and demote scripts work fine one there own but the rank.sqf is what im having problems with.

 

Any help would be awesome thank you

  • Like 1

Share this post


Link to post
Share on other sites
On 23/1/2019 at 12:57 PM, Chuc said:

Any help would be awesome thank you

 

I think after our private chat everything now it's ready to publish !  :thumb:

 

What is your plan ?!!  :ftvsmilie2:

Share this post


Link to post
Share on other sites

yeah sorry. If you reckon its ready go for it

  • Thanks 1

Share this post


Link to post
Share on other sites
Just now, Chuc said:

If you reckon its ready go for it

 

Ok Chuck !

 

This shall be done !!!  :f:

Share this post


Link to post
Share on other sites

Hello there to Everyone !

 

 

Custom Rank and experience point system based on kills , with 3d icons available option  :

 

BgImkjT.png

 

available soon !

Share this post


Link to post
Share on other sites

Looks good! Is there a way to give more points for killing tanks or planes?  Or completing a task?  Or give points to the complete side? I know, i m asking too much...sorry 🙂

  • Like 1

Share this post


Link to post
Share on other sites
17 minutes ago, Texeiro said:

Looks good!

 

Hello there and thanks Texeiro !

 

This script isn't still published , unfortunately i have a lot of work that stays in my pc !

Your idea is very nice and if i continue sometime this script i will check this as well.

 

For more news generally , you can follow here :

 

 

PS : + if you remind me this again i can definitely check it.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×