Jump to content
Sign in to follow this  
dlegion

MP and JIP push script

Recommended Posts

hello all!

i'm trying to get a working "push" script for MP, JIP and respawn, for the infantry.
the idea is to be able to push everything that can be somehow pushed (i was thinking about a check about object mass, so it can work for players,light vehicles and all light objects)
the final result i wish is to have vehicles like boats, and helicopters (maybe without parking brakes) pushed, but not buildings or heavy tanks.
i already tried all the scripts i found on armaholic, but noone satisfy my needs. some were good, but dont work with objects added by zeus (seems they indicize map objects at start).
can anyone help me?

i found this simple push script, that works perfectly, the only trouble is that you have to initialize the object with the code in the first line, so cant work on objects added by zeus.

Spoiler

// push1 = [[this,["<t color=""#CC0000"">Push</t>","j_push.sqf",[], 9,true, false, "","((vehicle _target) distance  (vehicle _this)) < 8"]],"addAction",true] call BIS_fnc_MP;

_object = _this select 0;
_user = _this select 1;
if (_user != vehicle _user) exitwith {hint "You can't push from inside the vehicle you idiot!"};
_dir = getDir _user;
_dx = sin(_dir)*4;
_dy = cos(_dir)*4;
_object setVelocity [_dx,_dy,0];

 

maybe someone can help me to modify it to work for everything!

PS: as extra feature, if possible, i wish to add damage to "pushed" players/AI, so it double as a kind of melee damage!

Share this post


Link to post
Share on other sites

i've almost solved this problem,but i really need help on this.
the objective is to have a "kill" action working on everyone, while a "join squad" action working only on same faction (or side).

here's the relevant part of the code:

Spoiler

if(_a select 0)then{
            if(_a select 1!=-1)then{_le removeaction(_a select 1);a_a set[1,[true,-1]]};
            if(_sid==sid_e or(_sid==sid_e1))then{
                if(_e iskindof"man")then{
                    a_a set[2,[true,_e addaction["Kill",{
                        _u=_this select 0;
                        _u removeaction(_this select 2);
                        if(cursorTarget==_u)then{_u setdamage 1}
                    },[],0,true,true,"","_this distance _target<2.1"]]]
                }
            }else{
                if(_sid==sid)then{
                    a_a set[2,[true,_e addaction["Get in squad",{
                        _this select 0 removeaction(_this select 2);
                        crew(_this select 0)join(_this select 1)
                    },[],0,false,false]]]
                };
                if(_e getvariable['st_a',true])then{call _s_d}
            }

 

in fact here is a situation where script choose IF side=x THEN "kill" ELSE "join_squad",
and i wish to have kill for every faction (everyone) and join only on same faction!
can someone help me on this?
thanks !!

Share this post


Link to post
Share on other sites

Do you usually write your scripts like that or did you run them through some kind of obfuscator?

Hard to follow all those _sid sid_e1 sid a_a st_a variables.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

no.... was not written by me, i barely understand some parts :(
thats why i need help :)

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
Sign in to follow this  

×