Jump to content

Need a lil help pls. Cash for zombieKill / zombieheadshots or cash for kill a tank


GodZilla

Recommended Posts

Hi Guys,

I hope u can help me pls. I added just for fun cash for zombiekill to the local_eventkill.sqf and to get money for (Z)headshoots to the the fn_damageHandlerZ.sqf Now u can get money for some zombiekills. 

This comes with a message (system  -or hint)

In my variables is Z_singleCurrency = true;, and to show the value i have a hud.

Spoiler

//[unit, selectionName, damage, source, projectile]
//will only run when local to the created object
//record any key hits to the required selection
private["_killer","_Wallet", "_Amount"];

_array = _this select 0;
_zed = _array select 0;
_killer = _array select 1;
_type = _this select 1;
_Amount =500;

if (local _zed) then {
    _kills = _killer getVariable[_type,0];
    _killer setVariable[_type,(_kills + 1),true];

    //increase players humanity when zed killed
    _humanity = _killer getVariable["humanity",0];
    _humanity = _humanity + 50;
    _killer setVariable["humanity",_humanity,true];
    _Wallet =  _killer getVariable[Z_bankVariable, 0];
      _killer setVariable[Z_bankVariable, _Wallet + _Amount, true];
     call player_forceSave;
     systemChat format["[DE1OO1] %1 ZombieKill +%2 Skill %3 ", name player, _Amount];
    
   
};

Spoiler

//[unit, selectionName, damage, source, projectile]
//will only run when local to the created object
//record any key hits to the required selection
private ["_damage","_headShots","_Wallet","_Amount"];

_zed = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
_hitter = _this select 3;
_projectile = _this select 4;
_Amount =100;

_starL  = "<img image='\ca\ui\data\arrow_right.paa' align='left'/>";
_starL  = _starL;
_starR  = "<img image='\ca\ui\data\arrow_left_ca.paa' align='right' />";
_starR  = _starR;
_title  = "<t color='#ff0000' size='2.0' shadow='1' shadowColor='#000000' align='center'>HeadShot</t>";
_text   = "+100Skill";

if (_projectile in MeleeAmmo) then {
    _damage = _damage * 10;
};

if (local _zed) then {
    if (_damage > 1 and _projectile != "") then {
        //Record deliberate critical damages
        switch (_selection) do {
            case "head_hit": {
                if (!(_zed getVariable["hitRegistered",false])) then {
                    _headShots = _hitter getVariable["headShots",0];
                    _hitter setVariable["headShots",(_headShots + 1),true];
                    _zed setVariable["hitRegistered",true];
                    _Wallet =  _killer getVariable[Z_bankVariable, 0];
                      _killer setVariable[Z_bankVariable, _Wallet + _Amount, true];
                     call player_forceSave;
                    hint parseText (_starL + _starR + _title + _text);
                    
                    
                };
            };
        };
        
        //diag_log format["0: %1, 1: %2, 2: %3, 3: %4, 4: %5",_zed,_selection,_damage,_hitter,_projectile];    
        
        if (_projectile isKindOf "Bolt") then {
            _damageOrg = _hitter getVariable["firedDamage",0]; //_unit getVariable["firedSelection",_selection];
            if (_damageOrg < _damage) then {
                _hitter setVariable["firedHit",[_zed,_selection],true];
                _hitter setVariable["firedDamage",_damage,true];
            };
        };
    };
};

// all "HandleDamage event" functions should return the effective damage that the engine will record
_damage

Is there a way to add this funktion to kill vehicles like "air, land, ship"?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...