Jump to content

Window


donut

Recommended Posts

That is eisier then replacing a vehicle model.

First take a look at: development.mtasa.com (in the menu: wiki)

Allright, we are going to create a window with the width of 500 and the height of 300 (nice window :) )

local welcomeWnd = nil;
 
function createWelcomeWindow()
-- Get the client screen resolution.
local scr = {guiGetScreenSize() };
 
-- Create the w and h variables (width, height)
local w, h = 500, 300;
-- Create the x and y variables, and we are going to center the window right here. Just watch and see.
local x, y = (scr[1]/2)-(w/2), (scr[2]/2)-(h/2);
 
-- Now we are going to create the window. (it will be centered in all resolutions.)
   welcomeWnd = guiCreateWindow(x, y, w, h, "The title", false);
 
guiSetVisible(welcomeWnd, false);
end
 
-- Now add the event onClientResourceStart (when the client has downloaded all the files)
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function()
   createWelcomeWindow();
   guiShowCursor(true)
guiSetVisible(welcomeWnd, true);
end);

That was easy :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...