Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: InFIdeL on Nov 05, 2020, 01:55 PM

Title: GUI is not working ->Click Here<-
Post by: InFIdeL on Nov 05, 2020, 01:55 PM


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
Title: Re: GUI is not working ->Click Here<-
Post by: Kelvin Garcia Mendoza on Nov 05, 2020, 06:09 PM
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!"](https://i.imgur.com/wXGtkO2.png)[/spoiler]

if you want to delete the message, use:
::_label = null;
Title: Re: GUI is not working ->Click Here<-
Post by: InFIdeL on Nov 14, 2020, 01:46 PM
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!"](https://i.imgur.com/wXGtkO2.png)[/spoiler]

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

thanks its helpful