Jump to content

Recommended Posts

Does anyone have a killstreak script theyd like to share? I have made a airdrop kills streak for a vehicles and ammo boxes but was looking for one for maybe mortar / air support or maybe a AI soldier.

Share this post


Link to post
Share on other sites

With the following script you can see how many kills the player has got so far (MP only!):

onPlayerRespawn.sqf:

player setVariable ["Killstreak_Count",0];
player addEventHandler ["HandleScore", {
    params ["_unit","_object","_score"];
    if !(_object isKindOf "MAN") exitWith {};
    _killstreak = player getVariable "Killstreak_Count";
    _killstreak = _killstreak +1;
    player setVariable ["Killstreak_Count", _killstreak];
    systemChat str _killstreak;
    false
}];

With _streak = player getVariable "Killstreak_Count"; You can return how many kills the player has got so far. Resets after every respawn.

  • Like 1

Share this post


Link to post
Share on other sites

okay I have a AI "parachuting to player" but he dies automatically when he drops. can someone tell me what I need to do or give a better code? 
here is what im using. Script works but AI dies. 

Spoiler

_killer = _this select 1;
_killed = _this select 0;
    if (isPlayer _killed) then
        {
        killstreak = 0; //if the player is killed his killstreak is reset to 0
    };
    
        if ((isplayer _killer) && (!isplayer _killed)) then
     {
        killstreak = killstreak + 1;
        if (killstreak == neededKillsForAI) then
     {
        killstreak = 0;
        drop_Action = player addAction ["call AI", 
         {
         _unit = _this select 0; //*caller of the action*//
                
         _dropMark =  createMarkerLocal ["Marker1", position _unit]; /////*Use Marker as player may move*////
                
        _dropPosition = getMarkerPos "Marker1";
            
        removeallActions _unit;
                
        _dropitem = selectRandom ["B_Soldier_F","B_Soldier_GL_F","B_Soldier_lite_F"];//*add items needed*//

                
                
        _DeliveryVeh = createVehicle ["C_Plane_Civil_01_racing_F",[(_dropPosition select 0)+600,(_dropPosition select 1),(_dropPosition select 2)],[], 0, "FLY"];
                
        _DeliveryVeh flyinHeight 250;
                
        _pilotGrp = createGroup independent;
                
        _dropPilot =_pilotGrp createUnit ["C_Marshal_F", position _DeliveryVeh,[],5,"NONE"];
                
        _dropPilot moveInDriver _DeliveryVeh;
                
        _DeliveryVeh move  _dropPosition;
                
        WaitUntil {(_DeliveryVeh distance2D _dropPosition) < 30};
                
        hint "Delivery Inbound";
                
        _releasePos = getPosATL _DeliveryVeh;
                    
                
        _itemToDrop = createVehicle [_dropItem,[(_releasePos select 0),(_releasePos select 1),(_releasePos select 2)-10],[], 0, "FLY"];
                
        _dropParachute = "B_Parachute_02_F" createVehicle getPosATL _itemToDrop;
                
        _dropParachute attachTo [_itemToDrop, [0,0,1]]; //at value of 1 to prevent para from collapsing
            sleep 0.5; 
        while{alive _dropParachute}do{
                
                
                _itemToDrop setVelocity [0,0,-15];
                
                    if ((((position _itemToDrop)select 2)<1))exitWith{
                
                        _itemToDrop setVelocity [0,0,0];
                        detach _dropParachute;
                        deleteVehicle _dropParachute;
                
                        sleep 5;
                        _DeliveryVeh deleteVehiclecrew driver _DeliveryVeh;
                        deleteVehicle _DeliveryVeh;
                        deleteGroup _pilotGrp;
                        deleteMarkerLocal "Marker1";
                
                
                        };
                
                };
                
                
                
            }];
        };
    };


            

 

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

×