O.G Kash Posted August 29, 2019 Posted August 29, 2019 Fixei um marker em um veiculo, fui colocar uma função no marker (onMarkerHit) porém não funcionou. O que fiz: mcarregar = createMarker(-1085.234, -1609.752, 75.367, "cylinder", 2, 255,100,100, 60) Carregar = true Van = createVehicle(482, -1086.357, -1615.635, 76.367, 0, 0, -90) mvan = createMarker(0,0,0, "cylinder", 1, 255,100,100, 70) function carregar ( thePlayer ) if Carregar == true then droga = createObject (1578, 0,0,0,0,0,0, true) setPedAnimation(thePlayer, "carry", "crry_prtial", 1, false, true) attachElements ( mvan, Van, 0, -3, -1.2 ) attachElements ( droga, thePlayer, 0, 0.4, 0.3) drogac = true end end addEventHandler("onMarkerHit", mcarregar, carregar) function drogaca ( player ) if drogac == true then setPedAnimation(thePlayer, "carry", "crry_prtial", 1, false, true) end end addEventHandler("onMarkerHit", mvan, drogaca)
Moderators Lord Henry Posted August 30, 2019 Moderators Posted August 30, 2019 (edited) Já tentei fazer isso uma vez mas deu errado. Aparentemente a colisão do marker não pode ser anexada em outros elementos (você vê o marker anexado mas a colisão dele fica no lugar que estava). A solução que encontrei foi anexar um colShape esférico da mesma forma que o marker. Dai o marker fica aparecendo só pra bonito, mas o script usa a colisão do colShape em vez disso. createColSphere Edited August 30, 2019 by Lord Henry 1 Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment Discord Oficial do MTA: https://mtasa.com/discord Blacklist e Whitelist de Scripters: Planilha Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.
+[T]rakin Posted August 31, 2019 Posted August 31, 2019 mvan = createMarker(100, 100, 100, "cylinder", 1, 255,100,100, 70) Tenta assim, ja fiz isso varias vezes e sempre funciona e também deixa o tamanho do Marker para 1.8
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