Jump to content
Sign in to follow this  
alevelasco9

[SOLVED]I need help whit this.

Recommended Posts

Hi, I have a problem and it is that in this code:
 

switch (_this select 0) do {

    case "number": {

        mi_InputText = mi_InputText + format["%1", _this select 1];

        ctrlSetText[1000, mi_InputText];

    };

    case "restar": {

        mi_InputText = mi_InputText + format["-","%1", _this select 1];

        ctrlSetText[1000, mi_InputText];

    };

   

    case "clear": {

        mi_InputText = "";

        ctrlSetText[1000, mi_ClearText];

    };

   

    case "playerlist": {

        lbClear 1612;

        {_dato=lbAdd [1612,name _x];} foreach allPlayers;

        lbSetCurSel [1612, 0];

    };

   

    case "enter": {

        mi_OutputText = mi_InputText;

        playername = lbAdd [1612, 1];

        hint format["has ingresado %1", mi_OutputText];

        [playername, (parseNumber mi_OutputText)] call HALs_money_fnc_addFunds;

        closeDialog 0;

        mi_InputText = "";

    };

};

I am trying to get the players name as a variable(playername)and  as if it were a unit but it gives me an error saying that the variable I give it is a string, does anyone know how to fix it?

 

To contextualize a bit, this variable is taken from a dropdown where the players that are connected are generated.

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  

×