Jump to content

#DeltaSCR

Members
  • Posts

    395
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by #DeltaSCR

  1. Então amigos, estou modificando a Handling de um certo veículo, porém eu necessito mexer também na parte de "Handling Flags", porém gostaria de saber qual valor eu deveria colocar no terceiro parâmetro para WHEEL_F_NARROW.

     

    Ficarei muito grato com quem puder me ajudar xD

  2. Então, eu não manjo tanto de tabela, aí eu tô precisando fazer o seguinte: Quando o player passar em um Marker com veículo, vai checar se ele está na tabela (o veículo), aí tipo, se o veículo for de ID 123, vai dar tanto de dinheiro para o player, mas se for ID 234 vai dar outra quantia, porém não posso fazer em condições alternativas, pois vão ser muitos veículos.

     

    Gostaria de que me exemplificassem de não for pedir muito, rs.

  3. 1 hour ago, ODutii said:

    Quando o jogador morrer e ele irá teleportar ao hospital, oque está havendo de errado?

    
    function aomorrer()
        setElementPosition ( client, 2033.6293945313,-1414.7727050781,16.9921875)
        outputChatBox("Você perdeu a conciência e foi levado ao hospital.",client,255,255,255)
    end
    addEventHandler ( "onPlayerWasted", getRootElement(), aomorrer )
    

     

    Quem seria o "client" para você?

  4. Só mais uma dúvida - O sistema funciona assim: Quando um player clicar em outro jogador, se esse player estiver na ACL, daí abre o painel, porém eu fiquei em dúvida nessa questão da ACL, tipo, o que eu devo acrescentar depois de verificar a ACL?

     

    Server:

    function DeltaACL()
    	local accountName = getAccountName(getPlayerAccount(client))
    	if isObjectInACLGroup("user."..accountName, aclGetGroup("FT")) then
    		--// O que devo acrescentar aqui?
    	end
    end
    addEvent("Delta:VACL", true)
    addEventHandler("Delta:VACL", resourceRoot, DeltaACL)

     

    Client:

    function DeltaAbrir(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement)
    	triggerServerEvent("Delta:VACL", getLocalPlayer())
    	if button == "left" and state == "down" then
    		if clickedElement then
    			if (getElementType(clickedElement) == "player") then
    				local x, y, z = getElementPosition(localPlayer)
    				local px, py, pz = getElementPosition(clickedElement)
    				local distance = getDistanceBetweenPoints3D(x, y, z, px, py, pz)
    				if distance <= 3 then
    					if not isEventHandlerAdded("onClientRender", root, DeltaDX) then
    						playerName = getPlayerName(clickedElement):gsub("#%x%x%x%x%x%x", "")
    						addEventHandler("onClientRender", root, DeltaDX)
    						DX = true
    					end
    				end
    				playerClicked = clickedElement
    			end
    		end
    	end
    end
    addEventHandler("onClientClick", root, DeltaAbrir)

     

  5. 1 minute ago, DNL291 said:
    
    triggerServerEvent("Delta:RemoveData", resourceRoot, playerClicked, theData)

    Sobre as armas do player, o recomendado é obter as armas no lado server e mandar os valores ao cliente.

    As armas eu consegui obter no client com função util... Mas fazer no Server, resultará em melhor desempenho do código?

  6. Pelo o que eu entendi, o que vc quer fazer é mais ou menos isso ae:

    function executions(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement)
    	if painel == true then
    		if button == "left" and state == "down" then
    			outputChatBox("Você agora trabalha de Taxi", 255, 255, 255)
    			removeEventHandler("onClientRender", root, Dx)
    			painel = false
    			showCursor(false)
    		end
    	end
    end
    addEventHandler("onClientClick", root, executions)

     

  7. Essas dúvidas ai acima eu resolvi, agora no mesmo código, estou com um certo problema, aparentemente simples, porém não to conseguindo resolver - Podem me ajudar?

    ERRO:

    Spoiler

    1IwCjGD.png

    Código a seguir:

    client-side:

    elseif isCursorOnElement(screenW * 0.8281, screenH * 0.5667, screenW * 0.1563, screenH * 0.0333) then
    	if not getElementData(playerClicked, "Delta:Algemado") then
    		setPedAnimation(playerClicked, "GRAVEYARD", "mrnM_loop", -1, true, false, false, false)
    		setElementData(playerClicked, "Delta:Algemado", true)
    	else
    		setPedAnimation(playerClicked)
    		theData = "Delta:Algemado"
    		triggerServerEvent("Delta:RemoveData", playerClicked, theData)
    	end
    end

     

    server-side:

    function removePlayerData(playerClicked, theData)
    	removeElementData(playerClicked, theData)
    end
    addEvent("Delta:RemoveData", true)
    addEventHandler("Delta:RemoveData", getRootElement(), removePlayerData)

     

  8. Eu tentei fazer assim também, porém não aparece armamento nenhuma na lista ;-;

    if clickedElement then
    	if (getElementType(clickedElement) == "player") then
    		for i = 1, 12 do
    			local playerWeapon = getPedWeapon(clickedElement, i)
    			if i and i ~= 0 then
    				theRow = guiGridListAddRow(gridWeapons)
    				guiGridListSetItemText(gridWeapons, theRow, 1, playerWeapon, false, false)
    			end
    		end
      	end
    end
    guiSetVisible(gridWeapons, true)

     

  9. Então, primeiro eu tinha tentando fazer um loop nos slots, porém no debug acusa era necessário um elemento como argumento, no caso o "clickedElement" que era pra ser o argumento, não tá existindo, e eu confirmei isso utilizando uma função útil para obter as armas, onde eu verifico se existe o jogador, e se existir, adiciona uma row, porém a mesma não é adicionada.

×
×
  • Create New...