Dose not work:
Client:function deposit(%gui)
{
%amount = Deposit.getValue();
commandToServer('bankdeposit', %amount);
}
GUI://--- OBJECT WRITE BEGIN ---
new GuiWindowCtrl(bankGUI) {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "200 200";
minExtent = "8 2";
visible = "1";
maxLength = "255";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "1";
canMinimize = "1";
canMaximize = "1";
minSize = "50 50";
new GuiTextEditCtrl(deposit) {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "40 60";
extent = "82 18";
minExtent = "8 2";
visible = "1";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "38 88";
extent = "100 22";
minExtent = "8 2";
visible = "1";
command = "deposit();";
text = "Button";
groupNum = "-1";
buttonType = "PushButton";
};
};
//--- OBJECT WRITE END ---
Server:
function ServerCmdbankdeposit(%client, %amount)
{
%amount = atoi(%amount);
if (%amount <= 0)
{
commandToClient(%client, 'messageBoxOK', "Error", "Not a valid number.");
return;
}
if(%amount > PitroRPData.getData(%client.bl_id).valueMoney)
{
commandToClient(%client, 'messageBoxOK', "Error", "You don't have the much money dipstuff.");
return;
}
PitroRPData.getData(%client.bl_id).valueBank += %amount;
PitroRPData.getData(%client.bl_id).valueMoney -= %amount;
}
The deposit command dose not work.
Note: The GUI opens, The server.cs is running.