Jump to content

[Ajuda] Move Objeto


Recommended Posts

Estou criando um systema de construção de bases para meu servidor de DayZ estou tentando que como move o objeto manual e não estou conseguindo cria esta função por exemplo apos eu colocar ele no local eu queria usa algum tipo de tecla para muda as rotação clicando na tecla e move ele clicando nele e coloca no luga que vou clica para ele fica , alguém poderia mim ajuda já estou virando madrugadas pesquisando estudando tentando fazer isso e esta um pouco complicado para mim!

Imagem:
RZk0kr4.png

Server.Lua

addEvent ("Wooden", true)
addEventHandler ("Wooden", getRootElement(), 
function()
  if (getPlayerMoney (source) >= tonumber(400)) then
	outputChatBox("#00FF00Você colocou um Wooden Parede", source, 255, 255, 255 , true)
	local x,y,z = getElementPosition(source)
	setElementPosition ( source, posX, posY, posZ )
	obj = createObject(3260,x,y + 3,z, -0, 0, 350.093)  -- ID DO OBJETO + POSIÇÃO
	setTimer ( destroyElement, 172800000, 1, obj ) -- 2 Dias
	takePlayerMoney (source, tonumber (400))
  else
    outputChatBox ("Você é muito pobre!", source, 255, 0, 0, false)
  end
end)

Client.Lua

        iSantistaWindow = guiCreateWindow(203, 154, 270, 370, "Painel Criar Base ~DayZ", false)
        guiWindowSetSizable(iSantistaWindow, false)
        guiSetAlpha(iSantistaWindow, 1.00)
        selecionar = guiCreateButton(9, 310, 270, 50, "COLOCAR", false, iSantistaWindow)
		guiSetFont(selecionar, "default-bold-small")
        guiSetProperty(selecionar, "NormalTextColour", "FFFFFFFF")
        Horns = guiCreateGridList(9, 24, 270, 280, false, iSantistaWindow)
		guiGridListSetSelectionMode(Horns, 1)
        column = guiGridListAddColumn(Horns, "Itens", 0.9)

		local painel
		painel = guiGridListAddRow(Horns)
	    guiGridListSetItemText(Horns, painel, 1, "MADEIRA", false, false)
		guiGridListSetItemColor (Horns, painel, 1, 255, 0, 0 )
	    painel = guiGridListAddRow(Horns)
	    guiGridListSetItemText(Horns, painel, 1, "   Wooden Parede         400 GOLD", false, false)
		painel = guiGridListAddRow(Horns)
        guiGridListSetItemText(Horns, painel, 1, "   Wood Fence              420 GOLD", false, false)
        painel = guiGridListAddRow(Horns)
        guiGridListSetItemText(Horns, painel, 1, "   Wooden Door            300 GOLD", false, false)
        painel = guiGridListAddRow(Horns)
        guiGridListSetItemText(Horns, painel, 1, "   Wood Structure         500 GOLD", false, false)
		painel = guiGridListAddRow(Horns)
        guiGridListSetItemText(Horns, painel, 1, "METAL", false, false)
		guiGridListSetItemColor (Horns, painel, 1, 255, 0, 0 )
        painel = guiGridListAddRow(Horns)
        guiGridListSetItemText(Horns, painel, 1, "   Metal Fence               600 GOLD", false, false)
        painel = guiGridListAddRow(Horns)
        guiGridListSetItemText(Horns, painel, 1, "   Metal Door                 570 GOLD", false, false)
        painel = guiGridListAddRow(Horns)
        guiGridListSetItemText(Horns, painel, 1, "   Metal Galpao              900 GOLD", false, false)
        painel = guiGridListAddRow(Horns)
        guiGridListSetItemText(Horns, painel, 1, "   Metal Escada              460 GOLD", false, false)
		painel = guiGridListAddRow(Horns)
        guiGridListSetItemText(Horns, painel, 1,"LUZES", false, false)
	    guiGridListSetItemColor (Horns, painel, 1, 255, 0, 0 )
		painel = guiGridListAddRow(Horns)
        guiGridListSetItemText(Horns, painel, 1,"   Lampada 1                100 GOLD", false, false)
		painel = guiGridListAddRow(Horns)
        guiGridListSetItemText(Horns, painel, 1,"   Lampada 2                150 GOLD", false, false)
		painel = guiGridListAddRow(Horns)
        guiGridListSetItemText(Horns, painel, 1,"   Tocha                       200 GOLD", false, false)
		painel = guiGridListAddRow(Horns)
        guiGridListSetItemText(Horns, painel, 1,"   Explosivo                   350 GOLD", false, false)
		painel = guiGridListAddRow(Horns)
        guiGridListSetItemText(Horns, painel, 1,"   Sofa                         120 GOLD", false, false)
        
		guiSetVisible(iSantistaWindow, false)


local player = getLocalPlayer()
addEventHandler("onClientGUIClick", selecionar, function()
  local row, column = guiGridListGetSelectedItem(Horns)
  if row == 1 then   ----- CZ
    triggerServerEvent("Wooden", player, 2)
  elseif row == 2 then  ----- M4
    triggerServerEvent("Fence", player,3)
	  elseif row == 3 then  ----- M4
    triggerServerEvent("Door", player,4)
	  elseif row == 4 then  ----- M4
    triggerServerEvent("Structure", player,6)
	  elseif row == 6 then  ----- M4
    triggerServerEvent("Fence2", player,7)
	  elseif row == 7 then  ----- M4
    triggerServerEvent("Door2", player,8)
	  elseif row == 8 then  ----- M4
    triggerServerEvent("Galpao", player,9)
	  elseif row == 9 then  ----- M4
    triggerServerEvent("Escada", player,10)
	  elseif row == 11 then  ----- M4
    triggerServerEvent("Luz", player,12)
	  elseif row == 12 then  ----- M4
    triggerServerEvent("Luz2", player,13)
	  elseif row == 13 then  ----- M4
    triggerServerEvent("Tocha", player,14)
	  elseif row == 14 then  ----- M4
    triggerServerEvent("Explosivo", player,15)
	  elseif row == 15 then  ----- M4
    triggerServerEvent("Sofa", player,16)
  end
end, false)

basecreat = function()
  if guiGetVisible(iSantistaWindow) then
    guiSetVisible(iSantistaWindow, false)
    showCursor(false)
  else
    guiSetVisible(iSantistaWindow, true)
    showCursor(true)
  end
end
addEvent("ShowGUI", true)
addEventHandler("ShowGUI", getRootElement(), basecreat)

 

Edited by Lord Henry
Link convertido em imagem
Link to comment
  • 3 weeks later...

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