Plate Posted October 18, 2012 Share Posted October 18, 2012 Hola tengo una duda se puede poner un helicoptero (hunter) que dentro tenga un ped (el ped no hace nada solamente esta hay) y que el hunter se mueva (vuele) que valla de un lado al otro haci se puede? Link to comment
Araa Posted October 18, 2012 Share Posted October 18, 2012 Podrias crear el vehiculo, warpeas al ped dentro del hunter y usar toggleControl para hacer que lo maneje, es medio complicado pero me parece que se puede. Link to comment
Renkon Posted October 18, 2012 Share Posted October 18, 2012 O podés usar el resource 'STAGE'. Búscalo en Community Link to comment
Tonyx97 Posted October 18, 2012 Share Posted October 18, 2012 Araa creo que te equivocas con toggleControl, eso solo es para el jugador local y en muy pocos casos para peds... Seria setPedControlState, no? Link to comment
Araa Posted October 18, 2012 Share Posted October 18, 2012 Araa creo que te equivocas con toggleControl, eso solo es para el jugador local y en muy pocos casos para peds... Seria setPedControlState, no? Cierto, me confundi Link to comment
Plate Posted October 18, 2012 Author Share Posted October 18, 2012 Gracias por la ayuda a los dos Link to comment
Xperia Posted October 18, 2012 Share Posted October 18, 2012 ¿No seria asi? createVehicle createPed setPedControlState Link to comment
Plate Posted October 18, 2012 Author Share Posted October 18, 2012 Si gracias pero lo de createped y create vehicle era obio jaja lo unico que necesitaba era la otra funcion muchas gracias igual PD: que falla de esto? Client: function createhunters () local hunter = createVehicle (411, 18.04815673828, 1997.5656738281, 17.640625) local ped = createPed ( 2, 18.04815673828, 1998.5656738281, 17.640625) tiggerEvent("warp", getRootElement()) setPedControlState(ped, accelerate) end addEventHandler("onResourceStart", getRootElement(), createhunters) server: addEvent("warp", true) function warptheped() warpPedIntoVehicle(ped, hunter) end addEventHandler("warp", getRootElement(), warptheped) Link to comment
Renkon Posted October 18, 2012 Share Posted October 18, 2012 tiggerEvent no existe primero. Es TRIGGER. Segundo, estás trigeando el evento en el CLiente. No estas haciendo triggerServerEvent. Link to comment
Plate Posted October 18, 2012 Author Share Posted October 18, 2012 PERO IGUAL EL PED NO ENTRA EN EL VEICULO D: Link to comment
NodZen Posted October 18, 2012 Share Posted October 18, 2012 PERO IGUAL EL PED NO ENTRA EN EL VEICULO D: Probaste sacer el getRooElement()? Link to comment
Alexs Posted October 18, 2012 Share Posted October 18, 2012 Prueba sacar el trigger. Available client side from 1.3.1 (It will only work with client side vehicles and peds) function createhunters () local hunter = createVehicle (411, 18.04815673828, 1997.5656738281, 17.640625) local ped = createPed ( 2, 18.04815673828, 1998.5656738281, 17.640625) warpPedIntoVehicle(ped, hunter) setPedControlState(ped, accelerate) end addEventHandler("onResourceStart", getRootElement(), createhunters) y asegúrate el MTA este actualizado. Link to comment
Plate Posted October 18, 2012 Author Share Posted October 18, 2012 el warpPedIntoVehicle es server side nada mas u.u Link to comment
Alexs Posted October 18, 2012 Share Posted October 18, 2012 Lee la wiki. Available client side from 1.3.1 (It will only work with client side vehicles and peds) Link to comment
Plate Posted October 18, 2012 Author Share Posted October 18, 2012 No se crea el auto ni el ped u.u Link to comment
Alexs Posted October 18, 2012 Share Posted October 18, 2012 Tu evento es server, el script client. function createhunters () local hunter = createVehicle (411, 18.04815673828, 1997.5656738281, 17.640625) local ped = createPed ( 2, 18.04815673828, 1998.5656738281, 17.640625) warpPedIntoVehicle(ped, hunter) setPedControlState(ped, accelerate) end addEventHandler("onClientResourceStart", getRootElement(), createhunters) Link to comment
Renkon Posted October 18, 2012 Share Posted October 18, 2012 Tu evento es server, el script client. function createhunters () local hunter = createVehicle (411, 18.04815673828, 1997.5656738281, 17.640625) local ped = createPed ( 2, 18.04815673828, 1998.5656738281, 17.640625) warpPedIntoVehicle(ped, hunter) setPedControlState(ped, accelerate) end addEventHandler("onClientResourceStart", getRootElement(), createhunters) warpPedIntoVehicle es serverside Link to comment
Renkon Posted October 18, 2012 Share Posted October 18, 2012 Si gracias pero lo de createped y create vehicle era obio jaja lo unico que necesitaba era la otra funcion muchas gracias igual PD: que falla de esto? Client: function createhunters () local hunter = createVehicle (411, 18.04815673828, 1997.5656738281, 17.640625) local ped = createPed ( 2, 18.04815673828, 1998.5656738281, 17.640625) tiggerEvent("warp", getRootElement()) setPedControlState(ped, accelerate) end addEventHandler("onResourceStart", getRootElement(), createhunters) server: addEvent("warp", true) function warptheped() warpPedIntoVehicle(ped, hunter) end addEventHandler("warp", getRootElement(), warptheped) ClientSide addEventHandler("onClientResourceStart", getRootElement(), function() triggerServerEvent("onClientResourceStarted", localPlayer) end) addEvent("onPedWarped", true) addEventHandler("onPedWarped", root, function(p) setPedControlState(p, "accelerate", true) end ) ServerSide addEvent("onClientResourceStarted", true) addEventHandler("onClientResourceStarted", root, function() local hunter = createVehicle (411, 18.04815673828, 1997.5656738281, 17.640625) local ped = createPed ( 2, 18.04815673828, 1998.5656738281, 17.640625) warpPedIntoVehicle(ped, hunter) triggerClientEvent(source, "onPedWarped", source, ped) end ) Nótese que podría haber una DESINCRONIZACIÓN entre otros JUGADORES, del Hunter. Link to comment
Plate Posted October 19, 2012 Author Share Posted October 19, 2012 (edited) Gracias !!! me funciono se lo agradesco a todos (es medio boludo el ped para manejar pero bueno que se le va a hacer) jaja despues le agrego mas controlsStates Saben cual es el control state para que el ped baya para adelante? EDIT: esto esta bien? addEventHandler("onClientResourceStart", getRootElement(), function() triggerServerEvent("onClientResourceStarted", localPlayer) end) addEvent("onPedWarped", true) addEventHandler("onPedWarped", root, function(p) setPedControlState(p, "accelerate", true) end ) addEvent("onPedWarped", true) function toggleaccelerate() setPedControlState(p, "accelerate", false) end addEventHandler("onPedWarped", root, toggleacerate) setTimer(50000, 1, toggleaccelerate) Edited October 19, 2012 by Guest Link to comment
BorderLine Posted October 19, 2012 Share Posted October 19, 2012 aqui tienes la lista de controles https://wiki.multitheftauto.com/wiki/Control_names es "forwards" Link to comment
Plate Posted October 19, 2012 Author Share Posted October 19, 2012 Si gracias yakuza ya lo habia encontrado peroa hora estoy intentando hacer que suba un poco y que despues se detenga y cuando se detiene empiese a ir despacio para adelante Link to comment
Alexs Posted October 19, 2012 Share Posted October 19, 2012 @Renkon lee antes de publicar, warpPedIntoVehicle es client side desde la v.131 Link to comment
Plate Posted October 19, 2012 Author Share Posted October 19, 2012 Sabe alguien como puedo hacer que acelere y con un setTimer deje de acelerar como puse arriba Link to comment
Renkon Posted October 19, 2012 Share Posted October 19, 2012 @Renkon lee antes de publicar, warpPedIntoVehicle es client side desde la v.131 Wow está bien en chiquito, me guié por el titulo Sabe alguien como puedo hacer que acelere y con un setTimer deje de acelerar como puse arriba addEventHandler("onPedWarped", root, function(p) setPedControlState(p, "accelerate", true) setTimer(setPedControlState, 5000, 1, p, "accelerate", false) end ) Link to comment
Plate Posted October 19, 2012 Author Share Posted October 19, 2012 gracias de nuevo renkon yakuza y alex Link to comment
Recommended Posts