Jump to content

Ajuda


Recommended Posts

-- server
marker2 = createMarker(-1893.38367, -1670.44324, 22.01563, "cylinder", 2.0, 0,255,0, 255)
setElementVisibleTo(marker2, root, false)

blip = createBlipAttachedTo (marker2, 19)
setElementVisibleTo(blip, root, false)

vehjob ={}
function iniciomcn (thePlayer)
        setElementVisibleTo(marker2,thePlayer,true)
        setElementVisibleTo(blip,thePlayer, true)
        vehjob = createVehicle(478, 1968.14075, -1642.37585, 15.96875)
        outputChatBox("Entregue a camionete na bandeira que o minimapa está indicando!", thePlayer)
end
addEvent ("maconha1", true)
addEventHandler("maconha1", getRootElement(),iniciomcn)

--client

addEventHandler ("onClientGUIClick", entregamcn, function()
    triggerServerEvent("maconha1", getRootElement(), thePlayer)
    removeEventHandler("onClientRender", root, dx)
    showCursor (false)
    guiSetVisible(close, false)
    guiSetVisible(entregamcn, false)
    guiSetVisible(entregacrk, false)
end)

 (((DEBUGSCRIPT 3))) server:  bad argument 'setElementVisibleTo'  [expected element at argument 2, got nill]
Se alguém conseguir ajudar eu agradeço de coração hshs só preciso dessa parte pra terminar o script 

Edited by alowner
Link to comment
  • Moderators

@alowner Este fórum possui um sub-fórum em Português, para uma boa organização do lugar, por favor use o local correto para postar. Other languages > Portuguese / Português (Programação em Lua)

Com relação ao script, em vez de utilizar a função setElementVisibleTo, você já pode estar ajustando a visibilidade no próprio argumento da função:

createMarker ( float x, float y, float z [, string theType = "checkpoint", float size = 4.0, int r = 0, int g = 0, int b = 255, int a = 255, element visibleTo = getRootElement( ) ] )

[Último argumento]

Isto irá dispensar o uso de:

setElementVisibleTo(elemento, root, false)

E também pode ser feito com as funções createBlipAttachedTo/createBlip

Leia: https://wiki.multitheftauto.com/wiki/Visibility

Link to comment
28 minutes ago, DNL291 said:

@alowner Este fórum possui um sub-fórum em Português, para uma boa organização do lugar, por favor use o local correto para postar. Other languages > Portuguese / Português (Programação em Lua)

Com relação ao script, em vez de utilizar a função setElementVisibleTo, você já pode estar ajustando a visibilidade no próprio argumento da função:

createMarker ( float x, float y, float z [, string theType = "checkpoint", float size = 4.0, int r = 0, int g = 0, int b = 255, int a = 255, element visibleTo = getRootElement( ) ] )

[Último argumento]

Isto irá dispensar o uso de:


setElementVisibleTo(elemento, root, false)

E também pode ser feito com as funções createBlipAttachedTo/createBlip

Leia: https://wiki.multitheftauto.com/wiki/Visibility

Muito obrigado mano, só agradece ♥

Mano eu dei uma lida nesses links que você recomendou, porém eu ainda tou com uma pulga atrás da orelha.
Tipo assim esse marker eu criei na parte server tá fora da function, como faço pra puxar esse marker pra function e deixar visivel pro player ?

Link to comment

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