Jump to content

GUI Advanced


iFoReX

Recommended Posts

This is my GUI but I need help :D

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Progress = {} 
  
GUIEditor_Window[1] = guiCreateWindow(100,191,363,551,"GUI Sistema de Warping de Casas",false) 
GUIEditor_Button[1] = guiCreateButton(11,75,228,44,"Warp a mi Primera Casa",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"default-bold-small") 
GUIEditor_Button[2] = guiCreateButton(11,123,228,44,"Warp a mi Segunda Casa",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[2],"default-bold-small") 
GUIEditor_Button[3] = guiCreateButton(11,169,228,44,"Warp a mi Tercera Casa",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[3],"default-bold-small") 
GUIEditor_Button[4] = guiCreateButton(11,216,228,44,"Warp a mi Cuarta Casa",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[4],"default-bold-small") 
GUIEditor_Button[5] = guiCreateButton(11,265,228,44,"Warp a mi Quinta Casa",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[5],"default-bold-small") 
GUIEditor_Button[6] = guiCreateButton(11,314,228,44,"Warp a mi Sexta Casa",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[6],"default-bold-small") 
GUIEditor_Button[7] = guiCreateButton(12,361,228,44,"Warp a mi Septima Casa",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[7],"default-bold-small") 
GUIEditor_Button[8] = guiCreateButton(12,409,228,44,"Warp a mi Octava Casa",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[8],"default-bold-small") 
GUIEditor_Button[9] = guiCreateButton(12,457,228,44,"Warp a mi Novena Casa",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[9],"default-bold-small") 
GUIEditor_Label[1] = guiCreateLabel(15,514,339,30,"GUI Creada por ElMota (c) 2012",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],200, 200, 0) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Progress[1] = guiCreateProgressBar(272,71,29,436,false,GUIEditor_Window[1]) 
  
  
  
  

:P

Link to comment

Something like this?

Client:

  
addEventHandler("onClientGuiClick", someButton, --Change someButton to your button.. 
function () 
triggerServerEvent("iWannaTeleportNow", getLocalPlayer()) 
end) 

Server:

  
addEvent("iWannaTeleportNow", true) 
addEventHandler("iWannaTeleportNow", getRootElement(), 
function () 
setElementPosition(source, posX, posY, posZ ) --Edit 
outputChatBox("Player " .. getPlayerName(source) .. " teleported!") 
end) 

It should work, you have to edit it a little bit, but you might get the idea.

Link to comment
Create a button server side

add onClientGuiClick handler to the button

make a function which triggers the server or client event for teleporting.

Done!

GUI is client side only, how will he create a button server side?

I was in rush, didn't saw what am I typing.

MIKI785

setElementPosition 
outputChatBox 

can be used client side also, no need for triggers actually..

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