Jump to content

createObject visivel para todos


Recommended Posts

11 hours ago, Deniel said:

Então galera, tipo eu to com uma dúvida aqui, o createObject é possível colocar ele para que outros jogadores vejam o mesmo? por exemplo um celular na mão de outro player.
e isso interfere muito no desempenho?

local phone = {}

phone = createObject(330, 0, 0, 0, 0, 0, 0)

por exemplo assim

Link to comment
4 hours ago, Lord Henry said:

Sim. Crie o objeto no lado server.

local animTimer = {}
local phone = {}

function animacao_open_phone ( source )
   setPedAnimation (source, "ped","phone_in", 1000, false, false, false, true)
   setPedAnimationProgress(source, "phone_in", 0.8)
   phone = createObject(330, 0, 0, 0, 0, 0, 0)   
   animTimer[source] = setTimer(function ( )  
      setPedAnimationProgress(source, "phone_in", 0.8) 
   end, 500, 0) 
end
addEvent("openPhone", true)
addEventHandler("openPhone", getRootElement(), animacao_open_phone)

function desativar_animacao ( source )
    if isTimer(animTimer[source]) then killTimer(animTimer[source]) end
    setPedAnimation ( source , "ped", "phone_out", 50, false, false, false, false)
end
addEvent("closePhone", true)
addEventHandler("closePhone", getRootElement(), desativar_animacao)

por exemplo assim, porém ainda não aparece.

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