Search the Community
Showing results for tags 'triggerevent'.
-
Hello, I have a problem with this code, this creates a Dx on you that other players can see, it is activated with a trigger from the server-side and a setElementData, but when I use it at the same time as someone else the render gets bug, It says that it was already handled.. local sX, sY = guiGetScreenSize ( ) local onEmoji4 = {}; local plyEmoji4 = getElementsByType ( "player" ) local showEmoji4 = false function onEmoji4Render ( ) local cx, cy, cz = getCameraMatrix () for i = 1, #plyEmoji4 do local p = plyEmoji4[i] if ( onEmoji4[p] ) then local x, y, z = getPedBonePosition.. --- -- blag blah blah local dEmoji4 = getDistanceBetweenPoints3D ( cx... -- blag blah blah if ( dEmoji4 < 100 ) then if ( isLineOfSightClear ( cx, cy... -- blag blah blah if (getElementData (p, "Emoji4") == true) then local sx, sy = getScreenFromWorldPosition...-- blag blah blah if ( sx ) and ( sy ) then local sEmoji4 = 400 / ...-- blag blah blah dxDrawImage ( sx - ( sEmoji4 / 2 ), sy - ( sEmoji4 / 2 ), sEmoji4, sEmoji4, "T_UI_Message_Icon_Aisatsu_BC.webp", 0, 0, 0, tocolor ( 255, 255, 255, 255 ) ) end end end end end end end function attachEmoji4 ( Emoji4 ) if not ( Emoji4 and isElement ( Emoji4 ) ) then return end onEmoji4[Emoji4] = true addEventHandler ( "onClientRender", root, onEmoji4Render ) setTimer(function() removeEventHandler ( "onClientRender", root, onEmoji4Render ) end, 2000, 1) end addEvent( "StartEmoji", true ) addEventHandler( "StartEmoji", root, attachEmoji4 )
- 6 replies
-
- triggerevent
- help
-
(and 1 more)
Tagged with:
-
Server.lua addEvent("oyuncuBilgisi", true) addEventHandler("oyuncuBilgisi", getRootElement(), function(hedef, theVehicle) for key, value in ipairs(exports.pool:getPoolElementsByType("vehicle")) do local owner = tonumber(getElementData(value, "owner")) local dbid2 = getElementData(theVehicle, "dbid") local fetchData = mysql:query_fetch_assoc( "SELECT `fiyat` FROM `vehicles` WHERE `id`='"..mysql:escape_string(getElementData(value, "dbid")).."'" ) local fiyat = fetchData["fiyat"] or 0 end triggerClientEvent(source, "oyuncuBilgisiDevam", source, hedef, fiyat ) end) how do i attract this to the client Client.lua function showText(hedef,fiyat) local fiyat = getElementData(theVehicle, "fiyat") or 0 toBeShowed = toBeShowed.."Arac Fiyatı: "..fiyat.."\n" lines = lines + 1
-
Tudo bem? Bom não sei se to fazendo algo de errado desse script e tbm não sei se isso funciona. Eu estou tentando pegar o marker de um script.lua e levar para outro .lua exemplo crio o Marker do exemplo.lua e queria leva ele para o exemplo2.lua so que nao sei . Aqui esta o meu script de como estou fazendo Pegar o marker desse script. addEvent("opengui",true) function opengui_func() AgenciaT = guiCreateWindow(412, 90, 546, 486, "Agencia de Empregos", false) Aceitar = guiCreateButton(78, 436, 130, 27, "Aceitar", false, AgenciaT) Cancelar = guiCreateButton(348, 436, 130, 27, "Cancelar", false, AgenciaT) Lista = guiCreateGridList(53, 170, 451, 253, false, AgenciaT) guiGridListAddColumn(Lista, "Empregos", 0.3) guiGridListAddColumn(Lista, "Salários", 0.3) guiGridListAddColumn(Lista, "Cidades", 0.3) for i = 1, 2 do guiGridListAddRow(Lista) end guiGridListSetItemText(Lista, 0, 1, "Piloto", false, false) guiGridListSetItemText(Lista, 0, 2, "1500", false, false) guiGridListSetItemText(Lista, 0, 3, "Los Santos", false, false) guiGridListSetItemText(Lista, 1, 1, "Fazendeiro", false, false) guiGridListSetItemText(Lista, 1, 2, "1000", false, false) guiGridListSetItemText(Lista, 1, 3, "Los Santos", false, false) Messager = guiCreateMemo(48, 38, 451, 124, "Seja Bem Vindo a Prefeitura do Servidor, BRASIL TOP RPG para você começar a trabalhar precisa selecionar o emprego que você deseja trabalhar e apertar em Aceitar. Boa Sorte com seu novo emprego", false, AgenciaT) guiMemoSetReadOnly ( Messager, true) showCursor(true) addEventHandler("onClientGUIClick", Cancelar, function() destroyElement(AgenciaT) showCursor(false) end, false) function onGridListClick(source) local itemrow,itemcolumn = guiGridListGetSelectedItem(Lista) if itemrow ~= -1 then if guiGridListGetItemText( Lista, itemrow, 1 ) == "Piloto" then blip = createBlip ( 2003.5859375, -2401.1025390625, 13.546875, 42) outputDebugString("Blip visible distance: "..getBlipVisibleDistance(blip)) setBlipVisibleDistance(blip, 10000) -- Distancia Aeroporto LS outputChatBox("Local marcador vá até o [T]", source) destroyElement(AgenciaT) showCursor(false) else if itemrow ~= -1 then if guiGridListGetItemText( Lista, itemrow, 1 ) == "Fazendeiro" then Carro = createMarker (1482.3427734375, -1729.4150390625, 13.3828125 -1, "cylinder", 2, 255 ,0 ,0, 255) --Quero levar esse marker para outro .lua para pode spawna o veiculo triggerServerEvent(source, "trabalho", source, true) -- e aqui é quando leva para o script servidor bom nao se se é aqui o erro outputChatBox("Local marcador vá até o [T]", source) destroyElement(AgenciaT) showCursor(false) end end end end end addEventHandler("onMarkerHit",Carro,onGridListClick) -- o evento addEventHandler("onClientGUIClick", Aceitar, onGridListClick) end addEventHandler("opengui", root, opengui_func) E levar para esse script. local marker = createMarker(362.8115234375, 173.8154296875, 1008.3828125 -1, "cylinder", 1.5, 255, 0, 0) setElementInterior(marker, 3) function guioeffnen(player) triggerClientEvent(player, "opengui", player, true) end addEventHandler("onMarkerHit",marker,guioeffnen) function pegar (source) -- quero usar o marker de la para fazer essa função if isElementWithinMarker(source, Carro) then if veh[source] and isElement( veh[source] ) then destroyElement ( veh[source] ) veh[source] = nil end x,y,z = getElementPosition(source) Islamico = true veh[source] = createVehicle(422,1481.083984375, -1730.6201171875, 13.3828125, 0, 0, 109.58242797852) warpPedIntoVehicle( source, veh[source] ) end addEvent("trabalho",true) end addEventHandler( "onMarkerHit",Carro, pegar )
- 11 replies
-
- script
- triggerevent
-
(and 2 more)
Tagged with: