Jump to content
Sign in to follow this  
killshot

Little function issue

Recommended Posts

Hello people,

 

could someone help me with this small function, please?

 

I want to have the possibility to give an argument to choose between "ACE_Wheel" and "ACE_Track".

 

[player,"track"] call fnc_grabSparePart or [player,"wheel"] call fnc_grabSparePart

fnc_grabSparePart = {

    private ["_caller","_sparePart","_choice"];
   
    _caller = _this select 0;
    _sparePart = _this select 1;

    if (_sparePart isEqualTo "Track")
        then {_sparePart = "ACE_Track"};
    if (_sparePart isEqualTo "Wheel")
        then {_sparePart = "ACE_Wheel"};

    _choice = _sparePart createVehicle (position _caller);

    [_caller,_choice] call ace_dragging_fnc_startCarry;

};

Spend a couple hours without success.

 

 

Kind regards.

Share this post


Link to post
Share on other sites

May be it's a case sensitive issue

 

"wheel"  "Wheel"

 

"track"  "Track"

 

isEqualTo  is case sensitive I just checked.

Share this post


Link to post
Share on other sites

Do you have "show script errors" turned on, as it tells you where in your script is breaking.

Share this post


Link to post
Share on other sites

Thank you both for your responses.

 

I can't believe I was too lazy to press shift-key all these hours, it's working now, thank you f2k sel. :bounce3:

Share this post


Link to post
Share on other sites

Thank you both for your responses.

 

I can't believe I was too lazy to press shift-key all these hours, it's working now, thank you f2k sel. :bounce3:

   then {_sparePart = "ACE_Wheel};

But there's also a mistake in this line ?!?

Share this post


Link to post
Share on other sites

Oh yes, you are right, I changed from if else to two ifs here in the forum version. Thank's I corrected it in the first post.

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  

×