ruanlima212 Posted December 3, 2018 Posted December 3, 2018 Estou tentando criar um sistema que acho que muitos conhecem, e um sistema para uma corporação, tipo a PMESP, como deveria funcionar, eu criaria uma marker para spawnar uma viatura na hora que algum policial com tag passa-se for cima da marker, mais to tendo erro, pq criei a marker, mais nao consigo colocar essa função a ela, sempre da erro, queria entender se tem alguma forma mais facil de dar esta função a minha marker poder spawnar apenas 1 carro por marker.
androksi Posted December 3, 2018 Posted December 3, 2018 local ACL_GROUP = "PMESP"; local VEH_ID = 411; local theMarker = createMarker ( 0, 0, 3, "cylinder", 1.80, 255, 255, 0, 185 ); local theVehicle = { }; addEventHandler ( "onMarkerHit", theMarker, function ( player, d ) if ( getElementType ( player ) == "player" and d ) then local vehicle = getPedOccupiedVehicle ( player ); if ( vehicle ) then return false; end if ( isGuestAccount ( getPlayerAccount ( player ) ) then return false; end if ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( ACL_GROUP ) ) ) then if ( theVehicle[player] and isElement ( theVehicle[player] ) ) then destroyElement ( theVehicle[player] ); end local playerPosition = { getElementPosition ( player ) }; theVehicle[player] = createVehicle ( VEH_ID, playerPosition[1], playerPosition[2], playerPosition[3] ); warpPedIntoVehicle ( player, theVehicle[player] ); end end end ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( theVehicle[source] and isElement ( theVehicle[source] ) ) then destroyElement ( theVehicle[source] ); end end ) Hello, world. Tutorial sobre interação de BOTs do Discord com o seu servidor - Visitar (Brazilian Portuguese) Tutorial sobre tabelas - Visitar (Brazilian Portuguese) Tutorial sobre banco de dados - Visitar (Brazilian Portuguese)
Moderators Lord Henry Posted December 3, 2018 Moderators Posted December 3, 2018 (edited) 2 hours ago, ruanlima212 said: mais to tendo erro, pq criei a marker, mais nao consigo colocar essa função a ela, sempre da erro, queria entender se tem alguma forma mais facil de dar esta função a minha marker poder spawnar apenas 1 carro por marker. Você disse que tentou fazer algo, mas está dando erro. Cadê o código pra gente verificar o erro? Qual erro que aparece no /debugscript 3? Edited December 3, 2018 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.
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