GUI is not working ->Click Here<-

Started by InFIdeL, Nov 05, 2020, 01:55 PM

Previous topic - Next topic

InFIdeL



I am trying to add my GUI but (!success) :-[.So plz help meby giving an example of GUI. I want when a player join server a welcome GUI message occures. ;D
I'm Kai

Kelvin Garcia Mendoza

http://wiki.adtec.ovh/wiki/Scripting/Squirrel/Client_Functions#GUILabel

_label <- null;

function Script::ScriptLoad()
{
 local
 screenSize          = ::GUI.GetScreenSize(),
 label               = ::GUILabel( ::VectorScreen( ( screenSize.X * 0.005 ), ( screenSize.Y * 0.96 ) ), ::Colour( 255, 255, 255 ), format( "Hey, %s. Welcome to the server!", ::World.FindLocalPlayer().Name ) );
 label.FontName      = "Verdana";
 label.FontSize      = ( screenSize.X * 0.2 );
 label.FontFlags     = GUI_FFLAG_BOLD;
 label.TextAlignment = GUI_ALIGN_LEFT;

 ::_label = label;
}


which will display:
[spoiler="Click here!"][/spoiler]

if you want to delete the message, use:
::_label = null;

InFIdeL

Quote from: =TRC=Kelvin on Nov 05, 2020, 06:09 PMhttp://wiki.adtec.ovh/wiki/Scripting/Squirrel/Client_Functions#GUILabel

_label <- null;

function Script::ScriptLoad()
{
 local
 screenSize          = ::GUI.GetScreenSize(),
 label               = ::GUILabel( ::VectorScreen( ( screenSize.X * 0.005 ), ( screenSize.Y * 0.96 ) ), ::Colour( 255, 255, 255 ), format( "Hey, %s. Welcome to the server!", ::World.FindLocalPlayer().Name ) );
 label.FontName      = "Verdana";
 label.FontSize      = ( screenSize.X * 0.2 );
 label.FontFlags     = GUI_FFLAG_BOLD;
 label.TextAlignment = GUI_ALIGN_LEFT;

 ::_label = label;
}


which will display:
[spoiler="Click here!"][/spoiler]

if you want to delete the message, use:
::_label = null;

thanks its helpful
I'm Kai