Author Topic: Opening a gui through a server command [Solved]  (Read 473 times)

client
Code: [Select]
function PushWeaponDealerGUI(%Gui)
{
   %Gui = canvas.pushDialog(WeaponDealerGUI);
}
server
Code: [Select]
function ServerCmdOpenStore(%Client)
{
OpenStore(%Client);
}
function OpenStore(%client)
{
%Client.money = getRandom(20,100);
commandToClient(%client,'WD_UpdateMoney', %client.money);
commandToClient(%client,'PushWeaponDealerGUI');
}

typing PushWeaponDealerGUI(); in the console works, why isn't the server command?
« Last Edit: December 31, 2012, 11:59:18 PM by swollow »

Prepend "clientCmd" to the client side function definition. Everything will work then.

Code: [Select]
function clientCmdPushWeaponDealerGUI(%Gui)
{
   %Gui = canvas.pushDialog(WeaponDealerGUI);
}

thanks lug and honorabl