Jump to content

Gui window [Help!!]


Recommended Posts

I've create a gui window so how can put it on marker hit when the player hit the marker this window show up ?

  
function myfirstwindow() 
local siwdth,sheight=guiGetScreenSize 
local width, height = 400,400 
local x = (swidth /2 ) - ( width/2) 
local y = (sheight/2) - (height /2) 
  
window1 = guiCreateWindow(x,y,width,height,"Go to the moon",false) 
guiWindowSetMoveable(window1,false) 
guiWindowSetSizeable(window1,false) 
window1button= guiCreatebutton(137,380,158,37,"suumbit",false,window1) 
window1label= guiCreateLabel(10,25,380,359,[[Welcome to the moon trip. the moon trip is wonderful trip full of mystery stuff and nice gravitation. if you like to trip pay 50.000$ nice trip.]], false , window1) 
guiLabelSetHorizontalAlign (window1label , "center",true) 
addEventHandler("onClientGUIClick",window1button,window1buttonresponse,false) 
function window1buttonresponse(button,state) 
  
if button  =="left" and state =="up" then 
guiSetVisible(window1,false) 
showCursor(false,false) 
outputChatBox("Good buy") 
end 
end 
  

Marker position

x= 1007.3994140625

y=-2302.7998046875

z=12.10000038147

And when the player press start take from the player 50.000$ then the gate open

Gate position

x=1002.599609375

y=-2310.19921875

z=14.89999961853

gate rotation

x=0

y=0

z=295.99914550781

Link to comment

https://wiki.multitheftauto.com/wiki/CreateMarker

https://wiki.multitheftauto.com/wiki/OnClientMarkerHit

https://wiki.multitheftauto.com/wiki/TakePlayerMoney

and the label text must be in string.

and this wrong

addEventHandler("onClientGUIClick",window1button,window1buttonresponse,false) 
function window1buttonresponse(button,state) 
  
if button  =="left" and state =="up" then 
guiSetVisible(window1,false) 
showCursor(false,false) 
outputChatBox("Good buy") 
end 
end 

correct

addEventHandler("onClientGUIClick",window1button, 
function (button,state) 
if button  =="left" and state =="up" then 
guiSetVisible(window1,false) 
showCursor(false) 
outputChatBox("Good buy") 
end) 

and do the rest yourself

We're not going scripting for you

We're helping you only.

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...