Jump to content
nickcage

The _mySteamProfileName = profileNameSteam;

Recommended Posts

hi I'm using the https://community.bistudio.com/wiki/profileNameSteam command to display it as a string on RSC text box

 

my init.sqf:

 

_mySteamProfileName = profileNameSteam;

 

My command line:

 

_cuck = _mySteamProfileName;
_dialog = findDisplay -9;
_ctrl = _dialog displayCtrl 1000;
_ctrl ctrlSetText format ["The Cuck is: %1", _cuck];

 

Does it not produce a string? 

Share this post


Link to post
Share on other sites

U linked the biki entry ... it returns a string.

 

I have no clue bout dialogs but i guess u cant use a local variable there which was set in init.sqf

Share this post


Link to post
Share on other sites

Its a variable right? that displays as a string?

 

So what your saying is is should define it a  public variable?

Share this post


Link to post
Share on other sites

depends on your purpose but I guess a global variable would be enough:

 

//local - known on the scope ("script") where defined only
_mySteamProfileName = profileNameSteam;

//global - known in every script on the machine (client/server) where defined
mySteamProfileName = profileNameSteam;

//public - known in every script on every connected machine
missionNamespace setVariable [ "mySteamProfileName", profileNameSteam, true ];

 

Share this post


Link to post
Share on other sites

Why not just:

_ctrl ctrlSetText format ["The Cuck is: %1",profileNameSteam];

And local variables (being with _) are not accessible outside of where they were defined, to put it fairly basically.

Share this post


Link to post
Share on other sites

So what I'm trying to do is display the steam username of the person that plays this scenario on a dialog textbox. 

 

Anyone able to fix my janky code so it executes and displays the users steam name on a textbox?

 

This might not even be possible?

 

 

Share this post


Link to post
Share on other sites
20 minutes ago, beno_83au said:

Why not just:


_ctrl ctrlSetText format ["The Cuck is: %1",profileNameSteam];

And local variables (being with _) are not accessible outside of where they were defined, to put it fairly basically.

Tried it doesn't work thanks for trying.

Share this post


Link to post
Share on other sites
24 minutes ago, sarogahtyp said:

depends on your purpose but I guess a global variable would be enough:

 


//local - known on the scope ("script") where defined only
_mySteamProfileName = profileNameSteam;

//global - known in every script on the machine (client/server) where defined
mySteamProfileName = profileNameSteam;

//public - known in every script on every connected machine
missionNamespace setVariable [ "mySteamProfileName", profileNameSteam, true ];

 

Your an absolute legend. I totally forgot about public variables on connected machines. i'll remember to double check my work

Share this post


Link to post
Share on other sites

a global variable is enough because the event script init.sqf is executed on every machine.

Share this post


Link to post
Share on other sites

yeah both should work. I'm only new to C++ thanks.

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

×