StanMarsh Posted July 3, 2013 Posted July 3, 2013 Hola, bueno vi un mod (Cleo) Que me intereso mucho para hacer un ambiente mas realista a mi server bueno el mod consiste en que al llegar a una cierta velocidad un arma dispara y entonces se podria usar create Weapon para hacer eso?
Chaz-CR Posted July 3, 2013 Posted July 3, 2013 Queres poner un Cleo en el server o crear uno parecido?
StanMarsh Posted July 3, 2013 Author Posted July 3, 2013 Queres poner un Cleo en el server o crear uno parecido? Parecido.
BorderLine Posted July 3, 2013 Posted July 3, 2013 y usa esto para detectaar la velocidad https://wiki.multitheftauto.com/wiki/GetElementVelocity
StanMarsh Posted July 3, 2013 Author Posted July 3, 2013 y usa esto para detectaar la velocidadhttps://wiki.multitheftauto.com/wiki/GetElementVelocity bueno y al detectar la velocidad como hago para que el arma dispare? y le haga el attach
BorderLine Posted July 3, 2013 Posted July 3, 2013 https://wiki.multitheftauto.com/wiki/SetWeaponState
StanMarsh Posted July 3, 2013 Author Posted July 3, 2013 https://wiki.multitheftauto.com/wiki/SetWeaponState Ejemplo :I?
BorderLine Posted July 3, 2013 Posted July 3, 2013 no es nesesario, los argumentos estan mas que claro weap = createWeapon(... if speed > 150 then setWeaponState( weap, "firing") ..
StanMarsh Posted July 3, 2013 Author Posted July 3, 2013 no es nesesario, los argumentos estan mas que claroweap = createWeapon(... if speed > 150 then setWeaponState( weap, "firing") .. me da error en la linea 1 attempt to call global "createweapon" (a nil value)
NodZen Posted July 3, 2013 Posted July 3, 2013 Me imagino que no habrás copiado tal cual te lo dió Yakuza y lo pusiste en tu script... Es un ejemplo, no es el script.
StanMarsh Posted July 3, 2013 Author Posted July 3, 2013 Me imagino que no habrás copiado tal cual te lo dió Yakuza y lo pusiste en tu script... Es un ejemplo, no es el script. no yo lo scriptee aqui esta el script weap = createWeapon("38") if speed > 12 then setWeaponState( weap, "firing") end
Plate Posted July 3, 2013 Posted July 3, 2013 weap = createWeapon("38") if speed > 12 then setWeaponState( weap, "firing", true) end
BorderLine Posted July 3, 2013 Posted July 3, 2013 eso no sera suficiente.. te falta el getelementposition el getoccupedvehicle argumentos del createweapon, y el evento que seria onclientvehicleneter
StanMarsh Posted July 4, 2013 Author Posted July 4, 2013 me suige dando error .-. Probe asi: weap = createWeapon("38") if speed > 12 then setWeaponState( weap, "firing", true) end local x,y,z = getElementPosition( myCar ) -- create the minigun; weap = createObject ( 38, x, y, z + 3 ) -- attach the minigun to the car; attachElements ( samsite, myCar, 0, 0, 0 ) me suige dando error en la linea 1
StanMarsh Posted July 4, 2013 Author Posted July 4, 2013 no has definido my car. ni tampoco samsite Dame un ejemplo no entiendo...
Plate Posted July 4, 2013 Posted July 4, 2013 por ejemplo function comandoxd() local x, y, z = getElementPosition(localPlayer) local mycar = createVehicle(411, x, y, z) local weap = createWeapon(38, 0, 0, 0) attachElements (weap, mycar) end addCommandHandler("ejemplo", comandoxd)
NodZen Posted July 4, 2013 Posted July 4, 2013 por ejemplo function comandoxd() local x, y, z = getElementPosition(localPlayer) local mycar = createVehicle(411, x, y, z) local weap = createWeapon(38, 0, 0, 0) attachElements (weap, mycar) end addCommandHandler("ejemplo", comandoxd) createWeapon no vá con ID si no con el nombre del arma.
Recommended Posts