FluxoTotal Posted August 5, 2019 Posted August 5, 2019 (edited) boa tarde , estou tentando um script simples onde o player pega um carro e destroi em um marker. me ajudem a resolver , conseguir por uma mensagem ao entra e tambem ao entra cria o marker, so nao consigo colocar o destruir veiculo ao encostar no marker infernus = createVehicle (411, 1183.784, -1312.099, 12.5 + 1) function teste (player) marker = createMarker(1206.313, -1284.754, 12, "cylinder",3,255,255,255,50) outputChatBox("Pegue o veiculo e leve ate o local indicado no mapa", player) end addEventHandler ( "onVehicleEnter", infernus, teste ) function final (player) if isElementWithinMarker(player, marker) then if destroyElement(infernus[player]) end addEventHandler("onHitMarker", marker, infernus) Edited August 5, 2019 by DNL291
DNL291 Posted August 5, 2019 Posted August 5, 2019 Primeiro erro: onHitMarker não existe, deveria ser onMarkerHit Fora isso o evento onMarkerHit está sendo adicionado antes da marker ser criada, marker ali irá retornar nil (além de outros erros na função 'final'). Tente: infernus = createVehicle (411, 1183.784, -1312.099, 12.5 + 1) function teste (player) marker = createMarker(1206.313, -1284.754, 12, "cylinder",3,255,255,255,50) addEventHandler("onMarkerHit", marker, final) outputChatBox("Pegue o veiculo e leve ate o local indicado no mapa", player) end addEventHandler ( "onVehicleEnter", infernus, teste ) function final (player) if getElementType(player) == "player" then local veh = getPedOccupiedVehicle(player) if veh and veh == infernus then destroyElement(infernus) end end end 1 Please do not PM me with scripting related question nor support, use the forums instead.
FluxoTotal Posted August 5, 2019 Author Posted August 5, 2019 esses espaços sao obrigatorios ou so questao de organizaçao mesmo?
DNL291 Posted August 5, 2019 Posted August 5, 2019 É organização mesmo. Isso se chama indentação. 1 Please do not PM me with scripting related question nor support, use the forums instead.
FluxoTotal Posted August 5, 2019 Author Posted August 5, 2019 duas peguntas rapidas , onde vejo uma lista dos eventos que existem no mta e qual o evento para encaixar o caminhao no comtainer dele?
DNL291 Posted August 5, 2019 Posted August 5, 2019 Na Wiki do MTA: https://wiki.multitheftauto.com/wiki/Main_Page https://wiki.multitheftauto.com/wiki/Client_Scripting_Events - eventos clientside https://wiki.multitheftauto.com/wiki/Server_Scripting_Events - eventos serverside Estes eventos: onTrailerAttach onTrailerDetach * Se você quer anexar no trailer em vez de detectar então use as funções: attachTrailerToVehicle / detachTrailerFromVehicle Qualquer dúvida simples, você pode perguntar no discord do mta no canal pt-scripting Please do not PM me with scripting related question nor support, use the forums instead.
FluxoTotal Posted August 5, 2019 Author Posted August 5, 2019 isso mesmo obg , onde encontro o link de convite do Discord?
DNL291 Posted August 5, 2019 Posted August 5, 2019 > https://discord.com/invite/mtasa Please do not PM me with scripting related question nor support, use the forums instead.
FluxoTotal Posted August 5, 2019 Author Posted August 5, 2019 desculpa perguntar denovo , e que procurei por tudo mais nao achei , qual o evento de tempo ? tipo queria que a cada 2 horas spawnace um veiculo
DNL291 Posted August 5, 2019 Posted August 5, 2019 setTimer + createVehicle Se for respawn use respawnVehicle 1 Please do not PM me with scripting related question nor support, use the forums instead.
Moderators Lord Henry Posted August 6, 2019 Moderators Posted August 6, 2019 19 hours ago, FluxoTotal said: esses espaços sao obrigatorios ou so questao de organizaçao mesmo? Considere indentação obrigatória. É muito mais difícil ler e interpretar seu código se ele não estiver indentado. 18 hours ago, FluxoTotal said: tipo queria que a cada 2 horas spawnace um veiculo Pra grandes períodos de tempo, recomendo getRealTime().timestamp em vez de setTimer. 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