Author Topic: GUI displaying a variable?  (Read 3464 times)

1. You could always add a schedule depending on .getPing()
2. The code is a small piece, which is meant to be inserted in a package.
1. No it's simply a shoddy way to do it, don't defend it. Send the information in the server request instead.
2. You've got to spoon feed on these forums. It's how it works.

1. No it's simply a shoddy way to do it, don't defend it. Send the information in the server request instead.
2. You've got to spoon feed on these forums. It's how it works.
1. Okay, but server request?
2. Strange forums.

RTB's going to break anything that tries to send more connection arguments. Normal mods shouldn't really be using this method anyway, there isn't enough space to accommodate everyone.

I thought of a way around this. Maybe make it so when you spawn there is a gui that pops up to check if you have the mod. if you dont hit ok within 30 seconds it bans you?

Banning them is slightly extreme isn't it?

All you have to do is send a clientCmd to them that asks them to send a serverCmd back to say they have the mod. This can happen within a few ms of connection and would be hidden from the user.

Or you could make your mod properly and allow people to join without the client mod, using chat commands/bottomprints/etc if they don't have it and have them download the GUI if they want to do things quicker and have it look nicer.

do this for a keybind to open, and close the gui, its easy ;d



function openClose()
{
$openClose+=1;
if($openClose==1)
{
canvas.popDialog(guinamehere);
}
if($openClose==2)
{
canvas.PushDialog(guinamehere);
$openClose=0;
}
if($openClose>2)
{
$openClose=0;
}
}

ez wtf ok and for the health bar thing


add this to the top part of your gui begin

 noCursor="1";




ez noob

Definitely do not use the above code.


I am suddenly reminded of this post:
Cool, I wrote this code to output something into the console:
Code: [Select]
function getOutputText(%text)
{
    eval("%text = \""@%text@"\";");
    return %text;
}
function outputTextToConsole(%text)
{
    %text = getOutputText(%text);
    %text = getSubStr(%text,0,strLen(%text));
    %text = strReplace("","",%text);
    echo(%text);
}

Then you just type this to echo something in the console:

outputTextToConsole(getWords("your text here",0,getwordCount("your text here")));

It works and it's correct - use that each time you want to echo something in the console now!
« Last Edit: January 26, 2010, 10:17:08 AM by -Jetz- »

why? it works idiot

So does:

Code: [Select]
if(guinamehere.isAwake())
    canvas.popDialog(guinamehere);
else
    canvas.pushDialog(guinamehere);

Your code uses a global variable to keep track of whether a gui is open or not, it's a ridiculous solution and would only work for one gui.
« Last Edit: January 26, 2010, 10:29:28 AM by Ephialtes »

I got the other stuff working. what about a gui like the healthbbar that does not effect gameplay but is on screen
You just make an GUI without a window.
Code: [Select]
PlayGui.Add(GUINAME);
PlayGui.Remove(GUINAME);
« Last Edit: January 30, 2010, 03:28:33 AM by goz3rr »

do this for a keybind to open, and close the gui, its easy ;d



function openClose()
{
$openClose+=1;
if($openClose==1)
{
canvas.popDialog(guinamehere);
}
if($openClose==2)
{
canvas.PushDialog(guinamehere);
$openClose=0;
}
if($openClose>2)
{
$openClose=0;
}
}

ez wtf ok and for the health bar thing


add this to the top part of your gui begin

 noCursor="1";




ez noob

Dear lord