VariableAgaa Posted April 27, 2013 Share Posted April 27, 2013 Hey Guys, my Question ist how to script a GUI? Because i want to add that when you press 'F4' it should open a Window where you can choose between some places and than there should be a butten which teleportes you when you press it. Does somebody know how it works? The script which I have made til now only can teleport you with a command in the chat. It works but I would prefer a solution with a GUI and the wiki couldn't help me. That's my solution without a GUI: function LosSantos (thePlayer) setElementInterior ( thePlayer, 0, 2496.23, -1688.27, 14.70 ) setElementPosition ( thePlayer, 2496.23, -1688.27, 14.70 ) outputChatBox ( "TP: ".. getPlayerName(thePlayer) .. ": Teleported to Los Santos with /LosSantos | Teleportierte sich nach Los Santos mit /LosSantos", root, 0, 255, 0 ) end addCommandHandler ( "LosSantos", LosSantos ) addCommandHandler ( "losSantos", LosSantos ) addCommandHandler ( "Lossantos", LosSantos ) addCommandHandler ( "lossantos", LosSantos ) function SanFierro (thePlayer) setElementInterior ( thePlayer, 0, -2421.39965, -624.4323, 132.66188 ) setElementPosition ( thePlayer, -2421.39965, -624.4323, 132.66188 ) outputChatBox ( "TP: ".. getPlayerName(thePlayer) .. ": Teleported to San Fierro with /SanFierro | Teleportierte sich nach San Fierro mit /SanFierro", root, 0, 255, 0 ) end addCommandHandler ( "SanFierro", SanFierro ) addCommandHandler ( "sanFierro", SanFierro ) addCommandHandler ( "Sanfierro", SanFierro ) addCommandHandler ( "sanfierro", SanFierro ) function LasVenturas (thePlayer) setElementInterior ( thePlayer, 0, 1999.54, 1544.04, 13.88 ) setElementPosition ( thePlayer, 1999.54, 1544.04, 13.88 ) outputChatBox ( "TP: ".. getPlayerName(thePlayer) .. ": Teleported to Las Venturas with /LasVenturas | Teleportierte sich nach Las Venturas mit /LasVenturas", root, 0, 255, 0 ) end addCommandHandler ( "LasVenturas", LasVenturas ) addCommandHandler ( "Lasventuras", LasVenturas ) addCommandHandler ( "lasVenturas", LasVenturas ) addCommandHandler ( "lasventuras", LasVenturas ) function Ranch (thePlayer) setElementInterior ( thePlayer, 0, -683.5206, 952.4695, 12.1328 ) setElementPosition ( thePlayer, -683.5206, 952.4695, 12.1328 ) outputChatBox ( "TP: ".. getPlayerName(thePlayer) .. ": Teleported to the Ranch with /Ranch | Teleportierte sich zur Ranch mit /Ranch", root, 0, 255, 0 ) end addCommandHandler ( "Ranch", Ranch ) addCommandHandler ( "ranch", Ranch ) Thank you for your possibilities in advance. Link to comment
MIKI785 Posted April 27, 2013 Share Posted April 27, 2013 You have to learn... visit: https://wiki.multitheftauto.com/wiki/In ... ng_the_GUI Link to comment
VariableAgaa Posted April 27, 2013 Author Share Posted April 27, 2013 Yeah, but I don't know how to put that all together. Link to comment
iPrestege Posted April 27, 2013 Share Posted April 27, 2013 "onClientGUIClick" triggerServerEvent setElementPosition setElementInterior outputChatBox Link to comment
VariableAgaa Posted April 27, 2013 Author Share Posted April 27, 2013 What should I do with "onClientGUIClick" and triggerServerEvent, sorry but I don't understand that part. Link to comment
iPrestege Posted April 27, 2013 Share Posted April 27, 2013 When you click the gui element trigger it to the server side to do the function's . Link to comment
VariableAgaa Posted April 27, 2013 Author Share Posted April 27, 2013 Okay, but what do I have to write in the script? function LosSantos (thePlayer) "onClientGUIClick" triggerServerEvent setElementInterior ( thePlayer, 0, 2496.23, -1688.27, 14.70 ) setElementPosition ( thePlayer, 2496.23, -1688.27, 14.70 ) outputChatBox ( "TP: ".. getPlayerName(thePlayer) .. ": Teleported to Los Santos with /LosSantos | Teleportierte sich nach Los Santos mit /LosSantos", root, 0, 255, 0 ) end addCommandHandler ( "LosSantos", LosSantos ) addCommandHandler ( "losSantos", LosSantos ) addCommandHandler ( "Lossantos", LosSantos ) addCommandHandler ( "lossantos", LosSantos ) What do i have to add? Link to comment
iPrestege Posted April 27, 2013 Share Posted April 27, 2013 Sorry but you're script now make no sense you have to learn first . Link to comment
VariableAgaa Posted April 27, 2013 Author Share Posted April 27, 2013 My Script is not for GUI, it's for using commands in chat. So I think first it has to create a GUI on the client-side and then it should create buttons, but yeah, you're right i have to learn first Link to comment
iPrestege Posted April 27, 2013 Share Posted April 27, 2013 This will help you : https://forum.multitheftauto.com/viewtopic.php?f=148&t=40809 and good luck . Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now