Doongogar Posted February 10, 2023 Posted February 10, 2023 existe algum evento pra quando um player entra de piloto em um veiculo, mas ja tem alguem no piloto ou seja um evento pra quando ele rouba o carro de outra pessoa? se nao tiver, como eu poderia criar um evento assim?
SableLightning78 Posted February 10, 2023 Posted February 10, 2023 Não, mas possuí o evento OnVehicleEnter que você pode verificar o acento do motorista e retirar o motorista se tiver alguém la!
Blaack Posted February 10, 2023 Posted February 10, 2023 1 hour ago, SableLightning78 said: Não, mas possuí o evento OnVehicleEnter que você pode verificar o acento do motorista e retirar o motorista se tiver alguém la! Nesse proprio evento onVehicleEnter, no terceiro parâmetro da função tu consegue verificar se ele esta retirando alguém do assento. addEventHandler ( "onVehicleEnter", getRootElement(), function ( thePlayer, seat, jacked ) if seat == 0 and jacked and isElement(jacked) and getElementType(jacked) == "player" then -- verificamos se o assento é 0 (p1), se existe algum player que foi ejetado, se existir verificamos se é um elemento, em seguida se é um player. -- use thePlayer para assaltante -- jacked para quem foi retirado -- source para veiculo. end end) 1
Doongogar Posted February 13, 2023 Author Posted February 13, 2023 On 10/02/2023 at 13:59, Blaack said: Nesse proprio evento onVehicleEnter, no terceiro parâmetro da função tu consegue verificar se ele esta retirando alguém do assento. addEventHandler ( "onVehicleEnter", getRootElement(), function ( thePlayer, seat, jacked ) if seat == 0 and jacked and isElement(jacked) and getElementType(jacked) == "player" then -- verificamos se o assento é 0 (p1), se existe algum player que foi ejetado, se existir verificamos se é um elemento, em seguida se é um player. -- use thePlayer para assaltante -- jacked para quem foi retirado -- source para veiculo. end end) pra que serve esse "isElement"? alias muito obrigado
Blaack Posted February 14, 2023 Posted February 14, 2023 1 hour ago, SciptNovato said: pra que serve esse "isElement"? alias muito obrigado Verifica se aquele argumento “jacked” é um elemento.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now