raynner Posted November 24, 2015 Posted November 24, 2015 (edited) Galera to criando um trabalho bem elaborado de caminhoneiro porem esta quase tudo perfeito só tem um defeito o destroyElement ele funciona bem porem ele n destrói o da pessoa que saio e sim do ultimo player que pegou o caminhão alguém tem alguma ideia do que eu posso fazer ja tentei usar [source] mais não funcionou. addEventHandler('onMarkerHit',SpawnveicleRcLr01, function ( hitElement ) if (isElement(hitElement)) and (getElementType (hitElement) == "player") then if ( not isPedInVehicle ( hitElement ) ) then local Pos = { getElementPosition ( hitElement ) } Cabine = createVehicle ( 515 , Pos[1] -5,Pos[2],Pos[3] +1 ) trailer = createVehicle ( 435, 0, 0, 4 ) attachTrailerToVehicle ( Cabine, trailer ) warpPedIntoVehicle ( hitElement , Cabine ) outputChatBox("#CCFF00[#FFA600 ! #CCFF00] #0080FFVocê Obteve Um Caminhão e Uma Carga Entrege No Ponto Marcado No Mapa.", hitElement, 255, 255, 255, true) else outputChatBox("#CCFF00[#FFA600 ! #CCFF00] #0080FFVocê Já Esta Dirigindo um Veiculo Tente Novamente Sem Veiculo em Posse.", hitElement, 255, 255, 255, true) end end end ) function ExitVehicle() destroyElement(Cabine) destroyElement(trailer) end addEventHandler ("onVehicleExit", getRootElement(), ExitVehicle) Edited November 24, 2015 by Guest
BonSay~^ Posted November 24, 2015 Posted November 24, 2015 Galera to criando um trabalho bem elaborado de caminhoneiro porem esta quase tudo perfeito só tem um defeito o destroyElement ele funciona bem porem ele n destrói o da pessoa que saio e sim do ultimo player que pegou o caminhão alguém tem alguma ideia do que eu posso fazer ja tentei usar [source] mais não funcionou. addEventHandler('onMarkerHit',SpawnveicleRcLr01, function ( hitElement ) if (isElement(hitElement)) and (getElementType (hitElement) == "player") then if ( not isPedInVehicle ( hitElement ) ) then local Pos = { getElementPosition ( hitElement ) } Cabine = createVehicle ( 515 , Pos[1] -5,Pos[2],Pos[3] +1 ) trailer = createVehicle ( 435, 0, 0, 4 ) attachTrailerToVehicle ( Cabine, trailer ) warpPedIntoVehicle ( hitElement , Cabine ) outputChatBox("#CCFF00[#FFA600 ! #CCFF00] #0080FFVocê Obteve Um Caminhão e Uma Carga Entrege No Ponto Marcado No Mapa.", hitElement, 255, 255, 255, true) else outputChatBox("#CCFF00[#FFA600 ! #CCFF00] #0080FFVocê Já Esta Dirigindo um Veiculo Tente Novamente Sem Veiculo em Posse.", hitElement, 255, 255, 255, true) end end end ) function ExitVehicle() destroyElement(Cabine) destroyElement(trailer) end addEventHandler ("onVehicleExit", getRootElement(), ExitVehicle) tenta isso ae function destroyCar() if Cabine and trailer then destroyElement (Cabine) destroyElement (trailer) end end addEventHandler ("onVehicleExit", root, destroyCar)
raynner Posted November 24, 2015 Author Posted November 24, 2015 Galera to criando um trabalho bem elaborado de caminhoneiro porem esta quase tudo perfeito só tem um defeito o destroyElement ele funciona bem porem ele n destrói o da pessoa que saio e sim do ultimo player que pegou o caminhão alguém tem alguma ideia do que eu posso fazer ja tentei usar [source] mais não funcionou. addEventHandler('onMarkerHit',SpawnveicleRcLr01, function ( hitElement ) if (isElement(hitElement)) and (getElementType (hitElement) == "player") then if ( not isPedInVehicle ( hitElement ) ) then local Pos = { getElementPosition ( hitElement ) } Cabine = createVehicle ( 515 , Pos[1] -5,Pos[2],Pos[3] +1 ) trailer = createVehicle ( 435, 0, 0, 4 ) attachTrailerToVehicle ( Cabine, trailer ) warpPedIntoVehicle ( hitElement , Cabine ) outputChatBox("#CCFF00[#FFA600 ! #CCFF00] #0080FFVocê Obteve Um Caminhão e Uma Carga Entrege No Ponto Marcado No Mapa.", hitElement, 255, 255, 255, true) else outputChatBox("#CCFF00[#FFA600 ! #CCFF00] #0080FFVocê Já Esta Dirigindo um Veiculo Tente Novamente Sem Veiculo em Posse.", hitElement, 255, 255, 255, true) end end end ) function ExitVehicle() destroyElement(Cabine) destroyElement(trailer) end addEventHandler ("onVehicleExit", getRootElement(), ExitVehicle) tenta isso ae function destroyCar() if Cabine and trailer then destroyElement (Cabine) destroyElement (trailer) end end addEventHandler ("onVehicleExit", root, destroyCar) Obrigado colega mais continua com mesmo erro tipo eu pego um caminhão meu colega pega outro se eu sair destroy o dele n o meu e se ele pegar primeiro destroy o meu n o dele ? alguma ideia doque seja
imCEASER Posted November 24, 2015 Posted November 24, 2015 Tente isto cabine = { } trailer = { } function onMarkerHit(hitElement) if(isElement(hitElement)) and (getElementType(hitElement) == "player") then if (not isPedInVehicle(hitElement)) then local Pos = {getElementPosition (hitElement)} cabine[hitElement] = createVehicle(515 , Pos[1] -5,Pos[2],Pos[3] +1) trailer[hitElement] = createVehicle(435, 0, 0, 4) attachTrailerToVehicle(cabine[hitElement], trailer[hitElement]) warpPedIntoVehicle(hitElement, cabine[hitElement]) outputChatBox("#CCFF00[#FFA600 ! #CCFF00] #0080FFVocê Obteve Um Caminhão e Uma Carga Entrege No Ponto Marcado No Mapa.", hitElement, 255, 255, 255, true) else outputChatBox("#CCFF00[#FFA600 ! #CCFF00] #0080FFVocê Já Esta Dirigindo um Veiculo Tente Novamente Sem Veiculo em Posse.", hitElement, 255, 255, 255, true) end end end addEventHandler("onMarkerHit", getRootElement(), onMarkerHit) function ExitVehicle(thePlayer) dCabine = destroyElement(cabine[thePlayer]) dTrailer = destroyElement(trailer[thePlayer]) if (dCabine and dTrailer) then cabine[thePlayer] = false trailer[thePlayer] = false end end addEventHandler ("onVehicleExit", getRootElement(), ExitVehicle)
raynner Posted November 24, 2015 Author Posted November 24, 2015 Tente isto cabine = { } trailer = { } function onMarkerHit(hitElement) if(isElement(hitElement)) and (getElementType(hitElement) == "player") then if (not isPedInVehicle(hitElement)) then local Pos = {getElementPosition (hitElement)} cabine[hitElement] = createVehicle(515 , Pos[1] -5,Pos[2],Pos[3] +1) trailer[hitElement] = createVehicle(435, 0, 0, 4) attachTrailerToVehicle(cabine[hitElement], trailer[hitElement]) warpPedIntoVehicle(hitElement, cabine[hitElement]) outputChatBox("#CCFF00[#FFA600 ! #CCFF00] #0080FFVocê Obteve Um Caminhão e Uma Carga Entrege No Ponto Marcado No Mapa.", hitElement, 255, 255, 255, true) else outputChatBox("#CCFF00[#FFA600 ! #CCFF00] #0080FFVocê Já Esta Dirigindo um Veiculo Tente Novamente Sem Veiculo em Posse.", hitElement, 255, 255, 255, true) end end end addEventHandler("onMarkerHit", getRootElement(), onMarkerHit) function ExitVehicle(thePlayer) dCabine = destroyElement(cabine[thePlayer]) dTrailer = destroyElement(trailer[thePlayer]) if (dCabine and dTrailer) then cabine[thePlayer] = false trailer[thePlayer] = false end end addEventHandler ("onVehicleExit", getRootElement(), ExitVehicle) Funcionou Obrigado colega ainda sou meio iniciante em scripts muito obrigado
imCEASER Posted November 24, 2015 Posted November 24, 2015 Funcionou Obrigado colega ainda sou meio iniciante em scripts muito obrigado Somos dois (também criei uns tópicos pedindo ajuda), mas com essa comunidade se ajudando iremos pra frente sem dúvidas.
raynner Posted November 24, 2015 Author Posted November 24, 2015 Funcionou Obrigado colega ainda sou meio iniciante em scripts muito obrigado Somos dois (também criei uns tópicos pedindo ajuda), mas com essa comunidade se ajudando iremos pra frente sem dúvidas. ss cara desculpa mais olha só eu fiz mais uma modificação que avia esquecido mais sei la ta bugado e criar um blip no ponto de entrega e tipo funciona quase perfeito so tem um porem eu utilizei a função mais fica visivel para todos alguma ideia doque seja ? quando sai do caminhão destroi so pra min pros outros continua visivel devido ao problema acima markpoint = createBlip(-1986, -2434, 20, 41, 1, 255, 255, 255, 255, 0) setElementVisibleTo (markpoint, hitElement, true)
imCEASER Posted November 24, 2015 Posted November 24, 2015 Tente assim: createBlip(-1986, -2434, 20, 41, 1, 255, 255, 255, 255, 0, hitElement)
raynner Posted November 25, 2015 Author Posted November 25, 2015 Tente assim: createBlip(-1986, -2434, 20, 41, 1, 255, 255, 255, 255, 0, hitElement) Não isto não funcionou
imCEASER Posted November 25, 2015 Posted November 25, 2015 Renovando o código Bom, tente este código aqui: cabine = { } trailer = { } function onMarkerHit(hitElement) if(isElement(hitElement)) and (getElementType(hitElement) == "player") then if (not isPedInVehicle(hitElement)) then local Pos = {getElementPosition (hitElement)} cabine[hitElement] = createVehicle(515 , Pos[1] -5,Pos[2],Pos[3] +1) trailer[hitElement] = createVehicle(435, 0, 0, 4) attachTrailerToVehicle(cabine[hitElement], trailer[hitElement]) warpPedIntoVehicle(hitElement, cabine[hitElement]) fBlip = createBlip(-1986, -2434, 20, 41, 2, 255, 255, 255, 255, 0, 99999, hitElement) outputChatBox("#CCFF00[#FFA600 ! #CCFF00] #0080FFVocê Obteve Um Caminhão e Uma Carga Entrege No Ponto Marcado No Mapa.", hitElement, 255, 255, 255, true) else outputChatBox("#CCFF00[#FFA600 ! #CCFF00] #0080FFVocê Já Esta Dirigindo um Veiculo Tente Novamente Sem Veiculo em Posse.", hitElement, 255, 255, 255, true) end end end addEventHandler("onMarkerHit", getRootElement(), onMarkerHit) function ExitVehicle(thePlayer) dCabine = destroyElement(cabine[thePlayer]) dTrailer = destroyElement(trailer[thePlayer]) if (dCabine and dTrailer) then cabine[thePlayer] = false trailer[thePlayer] = false destroyElement(fBlip) end end addEventHandler ("onVehicleExit", getRootElement(), ExitVehicle) Opinião Você está usando o icon id 41(chamado waypoint), aconselho a usar o icon id 53(chamado flag)
raynner Posted November 25, 2015 Author Posted November 25, 2015 Renovando o códigoBom, tente este código aqui: cabine = { } trailer = { } function onMarkerHit(hitElement) if(isElement(hitElement)) and (getElementType(hitElement) == "player") then if (not isPedInVehicle(hitElement)) then local Pos = {getElementPosition (hitElement)} cabine[hitElement] = createVehicle(515 , Pos[1] -5,Pos[2],Pos[3] +1) trailer[hitElement] = createVehicle(435, 0, 0, 4) attachTrailerToVehicle(cabine[hitElement], trailer[hitElement]) warpPedIntoVehicle(hitElement, cabine[hitElement]) fBlip = createBlip(-1986, -2434, 20, 41, 2, 255, 255, 255, 255, 0, 99999, hitElement) outputChatBox("#CCFF00[#FFA600 ! #CCFF00] #0080FFVocê Obteve Um Caminhão e Uma Carga Entrege No Ponto Marcado No Mapa.", hitElement, 255, 255, 255, true) else outputChatBox("#CCFF00[#FFA600 ! #CCFF00] #0080FFVocê Já Esta Dirigindo um Veiculo Tente Novamente Sem Veiculo em Posse.", hitElement, 255, 255, 255, true) end end end addEventHandler("onMarkerHit", getRootElement(), onMarkerHit) function ExitVehicle(thePlayer) dCabine = destroyElement(cabine[thePlayer]) dTrailer = destroyElement(trailer[thePlayer]) if (dCabine and dTrailer) then cabine[thePlayer] = false trailer[thePlayer] = false destroyElement(fBlip) end end addEventHandler ("onVehicleExit", getRootElement(), ExitVehicle) Opinião Você está usando o icon id 41(chamado waypoint), aconselho a usar o icon id 53(chamado flag) Thank you mais agora não tenho ninguem para me ajudar com os testes amanha se algo der errado eu volto aq mais eu to tentando e arrumar outro bug que e sobre a marker de chegada quando eu adiciono ela e o player esta no caminhão e aperta "R" para ligar a radio os eventos ocorrem ainda não consegui descobrir o erro. function Chegada(thePlayer) dCabine = destroyElement( cabineTrab[thePlayer] ) dTrailer = destroyElement( trailerTrab[thePlayer] ) setElementVisibleTo (markpoint, thePlayer, false) destroyElement (entrega1, thePlayer, false) money = getPlayerMoney(thePlayer) setPlayerMoney ( thePlayer, money +1000 ) if (dCabine and dTrailer) then cabineTrab[thePlayer] = false trailerTrab[thePlayer] = false end end addEventHandler("onMarkerHit", getRootElement(), Chegada)
raynner Posted November 25, 2015 Author Posted November 25, 2015 Me manda teu skype que eu te ajudo... meu skype e raynner lira mais se der entra no ts lr.noip.me:9988 ou (104.255.66.66:9988)
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