Castillo Posted April 10, 2011 Posted April 10, 2011 GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} function createthegui() showCursor(true,true) GUIEditor_Window[1] = guiCreateWindow(6,0,297,596,"Spawn menu",false) GUIEditor_Button[1] = guiCreateButton(12,24,98,43,"Adminspawn",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(176,38,88,33,"Pilot",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(16,87,89,41,"Robber",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(16,149,88,40,"Hobo",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(15,200,92,35,"Carjacker",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(17,245,88,38,"Army Rangers",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(12,288,92,40,"Arms Dealer",false,GUIEditor_Window[1]) GUIEditor_Button[8] = guiCreateButton(14,335,87,37,"Drug Dealer",false,GUIEditor_Window[1]) GUIEditor_Button[9] = guiCreateButton(13,377,88,36,"The Organisation",false,GUIEditor_Window[1]) GUIEditor_TabPanel[1] = guiCreateTabPanel(288,123,0,5,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) addEventHandler("onClientGUIClick", GUIEditor_Button[1], teleportPlayer, false) end function openTeleportWindow() createthegui() end addCommandHandler("teleportme",openTeleportWindow) function teleportPlayer(button,state) if button == "left" and state == "up" then triggerServerEvent("movePlayerToPosition",getLocalPlayer(),1479.6,-1612.8,14.0,0) end end It should work. P.S: Proracer, this code had many other errors, you should have mentioned too.
Castillo Posted April 10, 2011 Posted April 10, 2011 Because the server side part is also wrong. function moveThePlayer(x,y,z,rotation) if x and y and z and rotation then local skin = getElementModel(source) spawnPlayer(source,x,y,z,rotation,skin) setCameraTarget(source,source) end end addEvent("movePlayerToPosition",true) addEventHandler("movePlayerToPosition",root,moveThePlayer) Try that.
Castillo Posted April 10, 2011 Posted April 10, 2011 GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} function createthegui() showCursor(true,true) GUIEditor_Window[1] = guiCreateWindow(6,0,297,596,"Spawn menu",false) GUIEditor_Button[1] = guiCreateButton(12,24,98,43,"Adminspawn",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(176,38,88,33,"Pilot",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(16,87,89,41,"Robber",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(16,149,88,40,"Hobo",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(15,200,92,35,"Carjacker",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(17,245,88,38,"Army Rangers",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(12,288,92,40,"Arms Dealer",false,GUIEditor_Window[1]) GUIEditor_Button[8] = guiCreateButton(14,335,87,37,"Drug Dealer",false,GUIEditor_Window[1]) GUIEditor_Button[9] = guiCreateButton(13,377,88,36,"The Organisation",false,GUIEditor_Window[1]) GUIEditor_TabPanel[1] = guiCreateTabPanel(288,123,0,5,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) addEventHandler("onClientGUIClick", GUIEditor_Button[1], teleportPlayer, false) addEventHandler("onClientGUIClick", myCloseButton, closeWindow, false) -- change myCloseButton to your close button element. end function openTeleportWindow() createthegui() end addCommandHandler("teleportme",openTeleportWindow) function teleportPlayer(button,state) if button == "left" and state == "up" then triggerServerEvent("movePlayerToPosition",getLocalPlayer(),1479.6,-1612.8,14.0,0) end end function closeWindow() if button == "left" and state == "up" then destroyElement(GUIEditor_Window[1]) end end
mjau Posted April 10, 2011 Author Posted April 10, 2011 GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} function createthegui() showCursor(true,true) GUIEditor_Window[1] = guiCreateWindow(6,0,297,596,"Spawn menu",false) GUIEditor_Button[1] = guiCreateButton(12,24,98,43,"Adminspawn",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(176,38,88,33,"Pilot",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(16,87,89,41,"Robber",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(16,149,88,40,"Hobo",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(15,200,92,35,"Carjacker",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(17,245,88,38,"Army Rangers",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(12,288,92,40,"Arms Dealer",false,GUIEditor_Window[1]) GUIEditor_Button[8] = guiCreateButton(14,335,87,37,"Drug Dealer",false,GUIEditor_Window[1]) GUIEditor_Button[9] = guiCreateButton(13,377,88,36,"The Organisation",false,GUIEditor_Window[1]) GUIEditor_TabPanel[1] = guiCreateTabPanel(288,123,0,5,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) addEventHandler("onClientGUIClick", GUIEditor_Button[1], teleportPlayer, false) addEventHandler("onClientGUIClick", myCloseButton, closeWindow, false) -- change myCloseButton to your close button element. end function openTeleportWindow() createthegui() end addCommandHandler("teleportme",openTeleportWindow) function teleportPlayer(button,state) if button == "left" and state == "up" then triggerServerEvent("movePlayerToPosition",getLocalPlayer(),1479.6,-1612.8,14.0,0) end end function closeWindow() if button == "left" and state == "up" then destroyElement(GUIEditor_Window[1]) end end
Castillo Posted April 10, 2011 Posted April 10, 2011 Is this a joke? where's your "close" button? you didn't changed my code.
Castillo Posted April 10, 2011 Posted April 10, 2011 You should have told that at the start. GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} function createthegui() showCursor(true,true) GUIEditor_Window[1] = guiCreateWindow(6,0,297,596,"Spawn menu",false) GUIEditor_Button[1] = guiCreateButton(12,24,98,43,"Adminspawn",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(176,38,88,33,"Pilot",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(16,87,89,41,"Robber",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(16,149,88,40,"Hobo",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(15,200,92,35,"Carjacker",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(17,245,88,38,"Army Rangers",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(12,288,92,40,"Arms Dealer",false,GUIEditor_Window[1]) GUIEditor_Button[8] = guiCreateButton(14,335,87,37,"Drug Dealer",false,GUIEditor_Window[1]) GUIEditor_Button[9] = guiCreateButton(13,377,88,36,"The Organisation",false,GUIEditor_Window[1]) GUIEditor_TabPanel[1] = guiCreateTabPanel(288,123,0,5,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) addEventHandler("onClientGUIClick", GUIEditor_Button[1], teleportPlayer, false) end function openTeleportWindow() createthegui() end addCommandHandler("teleportme",openTeleportWindow) function teleportPlayer(button,state) if button == "left" and state == "up" then triggerServerEvent("movePlayerToPosition",getLocalPlayer(),1479.6,-1612.8,14.0,0) closeWindow() end end function closeWindow() destroyElement(GUIEditor_Window[1]) end
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