Blockland Forums > Modification Help

need help with %arg 1

Pages: << < (5/6) > >>

Triple Nickels:

Everyone in here but headcrab is obviously terrible at scripting.


--- Code: ---//serverside

function gameConnection::openGUI(%this, %arg)
{
if(!%arg)
return;
commandToClient(%this, 'openGUI',%arg);
}

registerOutputEvent("gameConnection","openGUI","string 100 100",0);

//clientside -- this is REQUIRED for the event to work

function clientCmdOpenGUI(%arg)
{
if(!isObject(%arg))
return;
canvas.pushDialog(%arg);
}

--- End code ---

That should work perfectly.

Honorable:

Didn't work. It doesn't even pop up the gui.

otto-san:


--- Quote from: Headcrab Zombie on August 05, 2010, 06:37:49 PM ---Your event is named OpenGUI while the method is named GUIOpener

You're also trying to call a clientside function through the server.
Anytime anyone in the server triggers the event, it will open the GUI on the host's screen.

And finally, using both %this and %client in that function is redundant.



--- End quote ---
CRAP

I was going to say the exact same thing.

Honorable:


--- Quote from: Triple Nickels on August 06, 2010, 02:03:06 AM ---Everyone in here but headcrab is obviously terrible at scripting.


--- Code: ---//serverside

function gameConnection::openGUI(%this, %arg)
{
if(!%arg)
return;
commandToClient(%this, 'openGUI',%arg);
}

registerOutputEvent("gameConnection","openGUI","string 100 100",0);

//clientside -- this is REQUIRED for the event to work

function clientCmdOpenGUI(%arg)
{
if(!isObject(%arg))
return;
canvas.pushDialog(%arg);
}

--- End code ---

That should work perfectly.

--- End quote ---

As i just said... This is NOT working perfectly. THIS doesn't even pop up the GUI. COULD SOMEONE TEST IT BEFORE THEY RELEASE THERE THEORY! I mean seriously. this should work. omg well it doesn't.

Destiny/Zack0Wack0:

What are you entering in the string. You're probably putting an invalid gui name. Try "JoinServerGui"

Pages: << < (5/6) > >>

Go to full version