-
Posts
297 -
Joined
-
Last visited
Everything posted by Xperia
-
y xq usas un pickup? para obtener su posicion solo define x, y, z el no pidio un Pickup Pensaba que lo queria como ese recurso, no aplicarlo a ese, pls no me pegues, soy joven.
-
y xq usas un pickup? para obtener su posicion solo define x, y, z el no pidio un Pickup Pensaba que lo queria como ese recurso, no aplicarlo a ese, pls no me pegues, soy joven.
-
No estoy seguro pero supongo que con "moveObject" podrias hacerlo.Supongo algo tal que asi: function asd(source) pickUp1 = createPickup(0,0,0,3,1239) x,y,z = getElementPosition(pickUp1) moveObject(pickUp1,500,x,y,z,360,0,0) end setTimer(asd,500,0) PD: Lo he hecho rapido y esta sin testear.
-
onClientMarkerHit > createObject > moveObject ERROR
Xperia replied to -ffs-AbodyRulez's topic in Scripting
Do you want to move a object when somebody hit the marker? -
Yo prefiero hacerlo con las funciones Yo tambien lo preferia hasta que lo probé.
-
Yo prefiero hacerlo con las funciones Yo tambien lo preferia hasta que lo probé.
-
Con el tiempo sabras que es mejor usar el modLoader lol.
-
O usa ModLoader.
-
Ahora el problema es que el player no rota en la misma rotacion que el auto.¿Con las siguientes funciones podria hacer que siguiera la rotacion? getVehicleRotation setPlayerRotation ¿Y para que vuelva a la rotacion normal que funcion uso?
-
getElementModel dxDrawText "onClientVehicleEnter" y "onClientRender"
-
Nada.Aqui el script: Client: marker1 = createMarker(0,0,0,"arrow",0.5,0,0,0,0) addEvent("onEnterPlayerVeh",true) addEventHandler("onEnterPlayerVeh",root, function(w) if ( getElementModel( source ) == 470 ) then w = createWeapon ("minigun", 0, 0, 0 ) end end ) addEvent("onPlayerFireInVeh",true) addEventHandler("onPlayerFireInVeh",root, function() if isElementWithinMarker(localPlayer, marker1) then setWeaponState ( w, "firing") end end ) addEvent("onPlayerStopFireInVeh",true) addEventHandler("onPlayerStopFireInVeh",root, function() if isElementWithinMarker(localPlayer, marker1) then setWeaponState ( w, "ready") end end ) Server: marker1 = createMarker(0,0,0,"arrow",0.5,0,0,0,0) function glueElements(w) triggerClientEvent("onEnterPlayerVeh",root,w) attachElements ( w, source, 0, 0.5, 1.48, 0, 5, 90) attachElements( marker1,source, 0, -0.5, 0.89, 0, 0, 0) setElementAlpha(w,255) end addEventHandler("onVehicleEnter",getRootElement(),glueElements) function checkVeh1() triggerClientEvent("onPlayerFireInVeh",getRootElement(),w) end function checkVeh2() triggerClientEvent("onPlayerStopFireInVeh",getRootElement(),w) end function freeze1(hitElement) executeCommandHandler("glue",hitElement) setElementFrozen( hitElement, true ) setPedAnimation( hitElement, "ped", "ARRESTgun",0,false,false,false) toggleControl ( hitElement, "jump", false ) toggleControl ( hitElement, "forwards", false ) toggleControl ( hitElement, "left", false ) toggleControl ( hitElement, "right", false ) toggleControl ( hitElement, "sprint", false ) toggleControl ( hitElement, "walk", false ) toggleControl ( hitElement, "fire", false ) end addEventHandler("onMarkerHit",marker1,freeze1) function unfreeze1(source) executeCommandHandler("unglue") setPedAnimation( source, false ) setElementFrozen( source, false ) toggleControl ( source, "jump", true ) toggleControl ( source, "forwards", true ) toggleControl ( source, "backwards", true ) toggleControl ( source, "left", true ) toggleControl ( source, "right", true ) toggleControl ( source, "sprint", true ) toggleControl ( source, "walk", true ) toggleControl ( source, "fire", true ) end function binds(player) bindKey(player,"mouse1","down",checkVeh1) bindKey(player,"mouse1","up",checkVeh2) bindKey(player,"enter","down",unfreeze1) end addEventHandler("onResourceStart",getRootElement(),binds)
-
function freeze1(source) executeCommandHandler("glue") setElementFrozen( source, true ) setPedAnimation( source, "ped", "ARRESTgun",0,false,false,false) toggleControl ( source, "jump", false ) toggleControl ( source, "forwards", false ) toggleControl ( source, "backwards", false ) toggleControl ( source, "left", false ) toggleControl ( source, "right", false ) toggleControl ( source, "sprint", false ) toggleControl ( source, "walk", false ) toggleControl ( source, "fire", false ) end addEventHandler("onMarkerHit",marker1,freeze1) Me da error en el primer argumento de toogleControl.
-
¿Como puedo pegar al player al vehiculo?
-
Exacto, lo intentare con la informacion que me habeis dado y si algo falla, publico.
-
Unir al player al lugar de la torreta, y entrar como si fuera un sitio del "no-conductor", que cuando estes cerca, y pulses G, entres o te posiciones en la torreta y para salir igual.
-
¿Y para unirlo podria usar un marker?
-
¿Y que para se moviera y un player pudiera controlarla?
-
Le edite un par de cosas y me sirvio, gracias a todos por la ayuda.
-
Da error en attachElements addEventHandler("onClientVehicleEnter", root, function() if ( getElementModel( source ) == 470 ) then w = createWeapon ( "minigun", 0, 0, 0 ) end end ) function checkVehicles() local v = getPedOccupiedVehicle(source) if ( v and getElementModel( v ) == 470 ) then setWeaponState ( w, "firing") end end bindKey("lctrl","both",checkVehicles) addEventHandler("onClientVehicleEnter",root, function() attachElements ( w, v, 0, 0, 1.38, 0, 30, 90) end ) Si lo pongo como me diste, tambien me da error.
-
function checkVehicles() local v = getPedOccupiedVehicle(source) if ( getElementModel( v ) == 470 ) then w = createWeapon ( "minigun", 0, 0, 0 ) setWeaponAmmo( w, 99999999 ) attachElements ( w, v, 0, 0, 1.38, 0, 30, 90) if getKeyState ( "lctrl" ) == true then setWeaponState ( w, "firing") end end end addEventHandler( "onClientPlayerVehicleEnter", getRootElement( ), checkVehicles ) bindKey("lctrl","both",checkVehicles) Asi no funciona, y sin el bindKey, solo funciona cuando matengo pulsado lctrl al entrar.
-
Lo que pasa es que no para de disparar lol.
-
Cuando el player este ya dentro del Patriot pueda disparar como si fuese la torreta un arma como la Minigun. EDIT: Algo como .