Author Topic: Need help setting up a slider  (Read 3258 times)

Code: [Select]
if(!isObject(StatsGui))
exec("add-ons/client/StatsGui.gui");

function updateStatsGui(%client){
PL_ID.setText(%client.BL_ID);
BLP_MENU.setText(%client.name @ "-BLP Menu");
PL_Score.setText(%client.score);
SV_INFO.setText($Pref::Server::WelcomeMessage);
SV_MLL.setText($Pref::Server::MaxLights_PerPlayer);
SV_ME.setText($Pref::Server::MaxEmitters_PerPlayer);
SV_MaxPlayers.setText($Pref::Server::MaxPlayers);
SV_BRL.setText($Pref::Server::BrickLimit);
SV_N.setText($Pref::Server::Name);
PL_BrickCount.setText(%client.brickGroup.getCount());
view1.setObject("BLPBack", "add-ons/shapes/sword.dts", "base/data/shapes/brickTOP", 0);
view2.setObject("BLPBack", "add-ons/shapes/jeep.dts", "base/data/shapes/brickTOP", 0);
360.setcameraZRot(%360_Val.value);
}

function serverCmdOpenStatsGui(%client){
canvas.pushDialog(StatsGui);
updateStatsGui(%client);
}
(everything else works)
you open the gui by typing "/openstatsgui" and that updates it.
A slider's values controls what the rotation of a player view is in a gui, this wont work
360_val is the slider
360 is the player view

a pictures is attached to help.
« Last Edit: October 29, 2007, 10:37:32 PM by BattleKon001 »


Nobody's replying because you have failed to go into any detail about what any of this even is.
« Last Edit: October 29, 2007, 10:35:51 PM by Ephialtes »

Nobody's replying because you are completely handicapped, and you have failed to go into any detail about what any of this even is.
a slider in a gui control, that handles the camreaZrotation for a playerView in a small gui...
Dont be a ass ephi, its hard to explain a slider when it can all be explained in one shot line of English letters.

Well you'd have to explain what you're doing at the moment that isn't working. How is updateStatsGui being called, and why is the client being sent to it? What is %360_Val?

kk i updated it, hope that helped
« Last Edit: October 29, 2007, 10:37:50 PM by BattleKon001 »



GUI stuff is clientside. Whenever anyone types /openstatsgui the host gets the GUI open... and it would crash Dedicated servers.

It should be 360_Val.getValue() and an update should be called whenever the slider is moved or on a timer loop instead of when you open the GUI.

That'd be my fault, I didn't know how to get the client.

function servercmdopenstatsgui(%client)
{
 commandtoclient(%client,'openstatsgui');
}

You'd need to create a clientcmdopenstatsgui function then with the same code that was in your original serverCmd.

Yeah. I assumed Gikon might know what a client command is if he is messing with GUIs and stuff.

Well he didn't know exactly how serverCmds worked :D

You type /<command> and it executes it.