~P0W3R~ Posted May 2, 2013 Posted May 2, 2013 Hola quisiera saber como puedo hacer si soy team "Piloto" que solo los del team piloto puedan coger el avion y el los demas no . Espero respuestas (; .No se si me explique bien
Renkon Posted May 2, 2013 Posted May 2, 2013 Un if statement con el getTeamName, controlando si es del team "Piloto" en el evento onVehicleStartEnter checkeando que el getElementModel del source sea idéntico al de los aviones.
~P0W3R~ Posted May 2, 2013 Author Posted May 2, 2013 Un if statement con el getTeamName, controlando si es del team "Piloto" en el evento onVehicleStartEnter checkeando que el getElementModel del source sea idéntico al de los aviones. Me darias un ejemplo porfavor.. PD: A lo que me refiero es que yo tengo un recurso que pasas por un marker y te da un avion.. lo que quiero es que si esta en team "Piloto" no te de el avion..
Renkon Posted May 2, 2013 Posted May 2, 2013 crea un if statement preguntando si el teamName del player es Piloto, y si es, procedes con el código .Sino simplemente usas return
Arsilex Posted May 2, 2013 Posted May 2, 2013 function Aviones (player) team = getPlayerTeam (player) if getTeamName (team ) == "Piloto" then outputChatBox ( "Bienvenido a bordo mi capitán e.e" ) else cancelEvent() outputChatBox ( "Pendejo que no eres piloto fuera de mi vista o te pego un tiro >.<" ) end end addEventHandler( "onVehicleStartEnter ", getRootElement(), Aviones)
~P0W3R~ Posted May 2, 2013 Author Posted May 2, 2013 No me funciono :C lo quiero poner en este recurso marker1 = createMarker (2093,-2478,12.5,"cylinder",1.2,255,255,0,255) marker2 = createMarker (-1667,-259,12.5,"cylinder",20.0,255,0,0,0) marker3 = createMarker (1478,1746,9.5,"cylinder",20.0,255,0,0,0) marker4 = createMarker (2054,-2593,12.5,"cylinder",20.0,255,0,0,0) progreso = 1 createBlip ( 2129.4560546875, -2479.3818359375, 13.546875, 56 ) function createPilotoTeam () Pilototeam = createTeam ("Piloto", 255, 255, 0) end addEventHandler ("onResourceStart", resourceRoot, createPilotoTeam) function joinPiloto() setPlayerTeam(source,Pilototeam) setElementModel(source, 61) setElementData( source, "Occupation", "Pilototeam", true ) setMarkerColor ( marker1, 255, 255, 0, 255 ) outputChatBox("Ahora Fuiste Asignado Piloto!!!",source,255,255,0) end addEvent("setPiloto", true) addEventHandler("setPiloto",root,joinPiloto) function part1 (player) if progeso == 1 then outputChatBox("Comenzando Mision!!! Vuela Asia SF Y LV Y Luego Regresa A LS",root,255,255,0,true) blip2 = createBlip ( -1667,-259,12, 19 ) car = createVehicle(519,2057,-2494,14,0,0,89) setMarkerColor ( marker2, 255, 0, 0, 255 ) progreso = 2 end end addEventHandler( "onMarkerHit", marker1, part1 ) function part2 (player) if progreso == 2 then outputChatBox("Primer Vuelo Completo Recompensa 4000$.Proximo Vuelo Hacia Las Venturas",root,255,255,0,true) blip3 = createBlip ( 1478,1746,9, 19 ) givePlayerMoney ( player, 4000 ) setMarkerColor ( marker3, 255, 0, 0, 255 ) setMarkerColor (marker2, 255,0,0,0) destroyElement(blip2) progreso = 3 end end addEventHandler( "onMarkerHit", marker2, part2 ) function part3 (player) if progreso == 3 then outputChatBox("Segundo Vuelo Completo Recompensa 4000$! Regresa A Los Santos Para Finalizar La Mision",root,255,255,0,true) blip4 = createBlip ( 2054,-2593,12, 19 ) givePlayerMoney ( player, 4000 ) setMarkerColor ( marker4, 255, 0, 0, 255 ) setMarkerColor (marker3,255,0,0,0) destroyElement(blip3) progreso = 4 end end addEventHandler( "onMarkerHit", marker3, part3 ) function part4 (player) if progreso == 4 then outputChatBox("Mision Completa! Felicitaciones!!!",root,255,255,0,true) destroyElement ( car ) givePlayerMoney ( player, 0 ) setMarkerColor(marker4,255,0,0,0) destroyElement(blip4) progreso = 1 end end addEventHandler( "onMarkerHit", marker4, part4 ) ayuda D:
Sasu Posted May 2, 2013 Posted May 2, 2013 marker1 = createMarker (2093,-2478,12.5,"cylinder",1.2,255,255,0,255) marker2 = createMarker (-1667,-259,12.5,"cylinder",20.0,255,0,0,0) marker3 = createMarker (1478,1746,9.5,"cylinder",20.0,255,0,0,0) marker4 = createMarker (2054,-2593,12.5,"cylinder",20.0,255,0,0,0) progreso = 1 createBlip ( 2129.4560546875, -2479.3818359375, 13.546875, 56 ) function createPilotoTeam () Pilototeam = createTeam ("Piloto", 255, 255, 0) end addEventHandler ("onResourceStart", resourceRoot, createPilotoTeam) function joinPiloto() setPlayerTeam(source,Pilototeam) setElementModel(source, 61) setElementData( source, "Occupation", "Pilototeam", true ) setMarkerColor ( marker1, 255, 255, 0, 255 ) outputChatBox("Ahora Fuiste Asignado Piloto!!!",source,255,255,0) end addEvent("setPiloto", true) addEventHandler("setPiloto",root,joinPiloto) function part1 (player) local team = getPlayerTeam(player) if not team then return end local teamName = getTeamName(team) if team and teamName == "Piloto" then if progeso == 1 then outputChatBox("Comenzando Mision!!! Vuela Asia SF Y LV Y Luego Regresa A LS",root,255,255,0,true) blip2 = createBlip ( -1667,-259,12, 19 ) car = createVehicle(519,2057,-2494,14,0,0,89) setMarkerColor ( marker2, 255, 0, 0, 255 ) progreso = 2 end end end addEventHandler( "onMarkerHit", marker1, part1 ) function part2 (player) local team = getPlayerTeam(player) if not team then return end local teamName = getTeamName(team) if team and teamName == "Piloto" then if progreso == 2 then outputChatBox("Primer Vuelo Completo Recompensa 4000$.Proximo Vuelo Hacia Las Venturas",root,255,255,0,true) blip3 = createBlip ( 1478,1746,9, 19 ) givePlayerMoney ( player, 4000 ) setMarkerColor ( marker3, 255, 0, 0, 255 ) setMarkerColor (marker2, 255,0,0,0) destroyElement(blip2) progreso = 3 end end end addEventHandler( "onMarkerHit", marker2, part2 ) function part3 (player) local team = getPlayerTeam(player) if not team then return end local teamName = getTeamName(team) if team and teamName == "Piloto" then if progreso == 3 then outputChatBox("Segundo Vuelo Completo Recompensa 4000$! Regresa A Los Santos Para Finalizar La Mision",root,255,255,0,true) blip4 = createBlip ( 2054,-2593,12, 19 ) givePlayerMoney ( player, 4000 ) setMarkerColor ( marker4, 255, 0, 0, 255 ) setMarkerColor (marker3,255,0,0,0) destroyElement(blip3) progreso = 4 end end end addEventHandler( "onMarkerHit", marker3, part3 ) function part4 (player) local team = getPlayerTeam(player) if not team then return end local teamName = getTeamName(team) if team and teamName == "Piloto" then if progreso == 4 then outputChatBox("Mision Completa! Felicitaciones!!!",root,255,255,0,true) destroyElement ( car ) givePlayerMoney ( player, 0 ) setMarkerColor(marker4,255,0,0,0) destroyElement(blip4) progreso = 1 end end end addEventHandler( "onMarkerHit", marker4, part4 )
~P0W3R~ Posted May 2, 2013 Author Posted May 2, 2013 marker1 = createMarker (2093,-2478,12.5,"cylinder",1.2,255,255,0,255) marker2 = createMarker (-1667,-259,12.5,"cylinder",20.0,255,0,0,0) marker3 = createMarker (1478,1746,9.5,"cylinder",20.0,255,0,0,0) marker4 = createMarker (2054,-2593,12.5,"cylinder",20.0,255,0,0,0) progreso = 1 createBlip ( 2129.4560546875, -2479.3818359375, 13.546875, 56 ) function createPilotoTeam () Pilototeam = createTeam ("Piloto", 255, 255, 0) end addEventHandler ("onResourceStart", resourceRoot, createPilotoTeam) function joinPiloto() setPlayerTeam(source,Pilototeam) setElementModel(source, 61) setElementData( source, "Occupation", "Pilototeam", true ) setMarkerColor ( marker1, 255, 255, 0, 255 ) outputChatBox("Ahora Fuiste Asignado Piloto!!!",source,255,255,0) end addEvent("setPiloto", true) addEventHandler("setPiloto",root,joinPiloto) function part1 (player) local team = getPlayerTeam(player) if not team then return end local teamName = getTeamName(team) if team and teamName == "Piloto" then if progeso == 1 then outputChatBox("Comenzando Mision!!! Vuela Asia SF Y LV Y Luego Regresa A LS",root,255,255,0,true) blip2 = createBlip ( -1667,-259,12, 19 ) car = createVehicle(519,2057,-2494,14,0,0,89) setMarkerColor ( marker2, 255, 0, 0, 255 ) progreso = 2 end end end addEventHandler( "onMarkerHit", marker1, part1 ) function part2 (player) local team = getPlayerTeam(player) if not team then return end local teamName = getTeamName(team) if team and teamName == "Piloto" then if progreso == 2 then outputChatBox("Primer Vuelo Completo Recompensa 4000$.Proximo Vuelo Hacia Las Venturas",root,255,255,0,true) blip3 = createBlip ( 1478,1746,9, 19 ) givePlayerMoney ( player, 4000 ) setMarkerColor ( marker3, 255, 0, 0, 255 ) setMarkerColor (marker2, 255,0,0,0) destroyElement(blip2) progreso = 3 end end end addEventHandler( "onMarkerHit", marker2, part2 ) function part3 (player) local team = getPlayerTeam(player) if not team then return end local teamName = getTeamName(team) if team and teamName == "Piloto" then if progreso == 3 then outputChatBox("Segundo Vuelo Completo Recompensa 4000$! Regresa A Los Santos Para Finalizar La Mision",root,255,255,0,true) blip4 = createBlip ( 2054,-2593,12, 19 ) givePlayerMoney ( player, 4000 ) setMarkerColor ( marker4, 255, 0, 0, 255 ) setMarkerColor (marker3,255,0,0,0) destroyElement(blip3) progreso = 4 end end end addEventHandler( "onMarkerHit", marker3, part3 ) function part4 (player) local team = getPlayerTeam(player) if not team then return end local teamName = getTeamName(team) if team and teamName == "Piloto" then if progreso == 4 then outputChatBox("Mision Completa! Felicitaciones!!!",root,255,255,0,true) destroyElement ( car ) givePlayerMoney ( player, 0 ) setMarkerColor(marker4,255,0,0,0) destroyElement(blip4) progreso = 1 end end end addEventHandler( "onMarkerHit", marker4, part4 ) No me anduvo sasuke si no estoy en el team piloto no me deja aser el spawn y si estoy en el team piloto tam poco no me deja aser el spawn
Recommended Posts