Jump to content

[AJUDA]Trabalho barra dx


Recommended Posts

Posted

Opa sou novo em programação no mta estou tentando criar um script de trabalho ja criei marker painel so não sei como colocar uma barra de carregamento dx quando o player iniciar o trabalho

  • Other Languages Moderators
Posted

Mostre o código para que possamos ajudá-lo onde colocar a parte do carregamento.

Posted

Esse e um dos meus primeiros script de trabalho estou usando como base com o tempo vou mudando os codigos

--==-==-==-==-==-==-==Server-==-==-==-==-==-==-==-==-==-
function addNotification(player, text, type)
    if (player and text and type) then
        triggerClientEvent(player, 'addNotification', player, text, type);
    end
end
--==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-
local agen = createMarker(362.11437988281,173.84976196289,1008.3828125 -1, "cylinder", 1.1, 0, 53, 207, 100)
setElementDimension(agen,0)
setElementInterior(agen,3)

function abrir (source)
triggerClientEvent (source, "agen1", root)
end
addEventHandler ("onMarkerHit", agen , abrir)
--==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-
entregar = createMarker ( -2407.0791015625, 756.18304443359, 35.171875 -1, "cylinder", 2,255,0,0, 255)
setElementVisibleTo ( entregar, root, false )

blip = createBlipAttachedTo(entregar, 51, 3, 255, 0, 0, 255, 0, 65535, source)
setElementVisibleTo ( blip, root, false )
--==-==-==-==-==-==-MARKERS Entrada & Saida==-==-==-==-==-==-==-==-==-==-
mk1 = createMarker(1480.8489990234,-1771.9639892578,18.795755386353 +0.6,"arrow",1.1,0,108,255, 215)
mksaida = createMarker(390.14129638672,173.80827331543,1008.3828125 +0.6,"arrow",1.1,0,108,255, 215)
setElementDimension(mksaida,0)
setElementInterior(mksaida,3)
--==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-
function entrada (source)
setElementPosition(source,385.21496582031,174.41664123535,1008.3828125)
setElementDimension(source,0)
setElementInterior(source,3)
end
addEventHandler("onMarkerHit",mk1,entrada)
--==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-
function saida (source)
setElementPosition(source,1480.9069824219,-1768.5571289063,18.795755386353)
setElementDimension(source,0)
setElementInterior(source,0)
end
addEventHandler("onMarkerHit",mksaida,saida)
--==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-
function tele (thePlayer)
    setElementPosition ( thePlayer, 1481.2888183594,-1740.9116210938,13.546875)
    outputChatBox ('#FFFAFA[#1E90FF Tele #FFFAFA]: #00FFFF' .. getPlayerName(thePlayer) .. ' #868686Foi Para a Agencia de LS !', root, 255, 255, 255, true)
end
addCommandHandler ( "agencia", tele )
--==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-
veh = {}
function trabct (source)
if isElementWithinMarker (source, agen ) then
if veh[source] and isElement( veh[source] ) then destroyElement(veh[source] )
veh[source] = nil
 end
 x,y,z = getElementPosition(source)
 veh[source] = createVehicle(428 ,1472.3331298828,-1735.4774169922,13.3828125)
 warpPedIntoVehicle (source,veh[source])
addNotification(source, "Transporte os malotes até o marker em San Fiero !", "info")
setElementDimension(source,0)
setElementInterior(source,0)
setElementVisibleTo ( blip, source, true )
setElementVisibleTo ( entregar, source, true )
else
addNotification(source, "Você Precisa Estar No Marker !", "error")
end
end
addCommandHandler ( "trabguard", trabct  )
--==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-
function acabar (source)
if veh[source] and isElement(veh[source]) then
destroyElement (veh[source])
givePlayerMoney (source, 10000)
setElementVisibleTo ( entregar, source, false )
setElementVisibleTo ( blip, source, false )
addNotification(source, "Malotes entregues !", "info")
else
end
end
addEventHandler( "onMarkerHit", entregar, acabar )
--==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-
function sair (source)
if (veh[source]) and isElement(veh[source]) then
Trabalho = false
destroyElement (veh[source])
setElementVisibleTo ( entregar, source, false )
setElementVisibleTo ( blip, source, false )
setElementData(source, "Trab", false)
addNotification(source, "Você saiu do veiculo, transporte anulado !", "error")
else
end
end  
addEventHandler ("onVehicleExit", root, sair)
--==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-

  • Other Languages Moderators
Posted (edited)

Não poste o código direto no texto, use o botão <> para colocar código. E deixe o código devidamente indentado.

UqAT5Nh.png

Recomendo também que você assista esse vídeo antes de continuar: 

 

Edited by Lord Henry
  • Like 1
Posted
Então queria colocar a barra de carregamento por aqui , desculpe irei tentar assistir o video pois minha internet não esta carregando nem em 144p.

function acabar (source)
if veh[source] and isElement(veh[source]) then
destroyElement (veh[source])
givePlayerMoney (source, 10000)
setElementVisibleTo ( entregar, source, false )
setElementVisibleTo ( blip, source, false )
addNotification(source, "Malotes entregues !", "info")
else
end
end
addEventHandler( "onMarkerHit", entregar, acabar )

 

5 hours ago, Pires said:

.

 

Posted

Não entendi, Você quer uma barra para que o player fique ciente do tempo que ele tem para fazer a entrega ou barra para deixar o player ciente em quantos locais ele já passou?

Mas independente da forma você terá que fazer a barra pelo Client-side e passar ela para o Server-side pelo TriggerEvent

Posted

Sim eu sei que e no client-side eu queria mostrar uma barra de carregamento assim que o jogador entrar no marker , Tipo ele vai fazer a entrega o carro congela/desliga ai mostra uma barra de carregamento depois disso ele seria descongelado, so não sei o codigo da barra.

  • 10 months later...
Posted

Oi, to querendo fazer o sistema parecido, so que com tempo exemplo, a barra fica carregando com a demora de 10 segundos ate chegar no final. So que nao entendi como demovo começar com essa função  InterpolateBetween    no     dxDrawRectangle

 

pode me ajudar?

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