Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google Log In with Steam Sign In
  • Create Account
Photo

dont get dialog variable (lbadd,w_RscCombo + pls help)

dont get dialog variable (pls

  • Please log in to reply
1 reply to this topic

#1
snooop87

snooop87

    100+ Post Club

  • Forum Member
  • 123 posts
  • Country: Country Flag
  • snooop1987

dear community , i want to create a Transfer Money Function but i got some trouble with the dialog variable.

 

player_setting.hpp -> class control

//dialog //
#include "player_sys.sqf"
idd = playersys_DIALOG;
class playerInput: w_RscCombo {
			idc = player_value;
			x = 0.625; y = 0.655;
			w = .1; h = .030;
		};

player_sys.sqf

#define player_value 2014

init.sqf

_playerDialog = createDialog "playerSettings";
_pvalue = _Dialog displayCtrl player_value;
{
    call compile format["_mIndex = _pvalue lbadd ""%1"";
    _pvalue lbSetData [(lbSize _pvalue)-1, ""%1""];", name _x];
    }foreach playableunits;

but if i try to sent the money :

dropmoney.sqf

#include "dialog\player_sys.sqf";
...
_Dialog = findDisplay playerSettings;
_player = _Dialog displayCtrl player_value;
player globalchat format ["transfering %2$ to %1...",_player,_money];
sleep 3 ; 
{if(_player == name _x)then {_x setVariable["choco",(_x getvariable"choco")+_money,true];};}foreach playableunits;
...

it says  : transfering 50000 to 0ED8BX5D...

 

picture:http://oi58.tinypic.com/nmxmi8.jpg

 





#2
Schatten

Schatten

    Survivor

  • Forum Member
  • 15 posts
  • LocationMinsk
  • Country: Country Flag

Perhaps due to the fact that variable _player in dropmoney.sqf has control type, not player name?

 

Try this code:

_Dialog = findDisplay playerSettings;

_playerValueCtrl = _Dialog displayCtrl player_value;
_index = lbCurSel _playerValueCtrl;
_player = _playerValueCtrl lbData _index;

player globalchat format ["transfering %2$ to %1...",_player,_money];
sleep 3 ;

{if (_player == (name _x)) exitWith {_x setVariable ["choco", (_x getVariable ["choco", 0]) + _money, true]}} count playableUnits;

Edited by Schatten, 11 September 2014 - 08:19 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users