Jump to content

[AJUDA]Trabalho barra dx


Recommended Posts

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)
--==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-

Link to comment
  • Other Languages Moderators

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
Link to comment
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:

.

 

Link to comment

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

Link to comment

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.

Link to comment
  • 10 months 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...