Author Topic: How could I display %client.Wallet on a gui  (Read 1163 times)

I read that you cannot display local variables to a GUI but I need my Server sided mod to send the %client.Wallet to my gui if this is not posssible is there any way to use a global variable but have it seprate from all other players

Code: (Server.cs) [Select]
function doStuff(%client)
{
      commandToClient(%client, 'recieveMyGUIInfo', %client.wallet);
}

Code: (Client.cs) [Select]
function clientCmdRecieveMyGUIInfo(%wallet)
{
      MyTextControl.setText("$" @ %wallet);
}

Code: (Server.cs) [Select]
function doStuff(%client)
{
      commandToClient(%client, 'recieveMyGUIInfo', %client.wallet);
}

Code: (Client.cs) [Select]
function clientCmdRecieveMyGUIInfo(%wallet)
{
      MyTextControl.setText("$" @ %wallet);
}
do I make any edits to them and also the one thay goes in client do I just copy and paste into the bottom of the client.cs?

do I make any edits to them and also the one thay goes in client do I just copy and paste into the bottom of the client.cs?
It was just an example of what to do.
Rename clientCmdRecieveMyGUIInfo to something less generic.
Change MyTextControl to the name of your text control.
And then just call commandToClient(%client, 'whateverYouDecideToNameYourCl ientCommand', %client.wallet); whenever you change the value of the person's wallet.

It was just an example of what to do.
Rename clientCmdRecieveMyGUIInfo to something less generic.
Change MyTextControl to the name of your text control.
And then just call commandToClient(%client, 'whateverYouDecideToNameYourCl ientCommand', %client.wallet); whenever you change the value of the person's wallet.
ok one last question is there a way to call a function when ever a variable is edited and every time it is edited?

ok one last question is there a way to call a function when ever a variable is edited and every time it is edited?
The best way to do this is to just not edit the variable directly but instead call a function that edits it instead. Then you can send the client command within that function.