-
Posts
1,089 -
Joined
-
Last visited
Everything posted by Xwad
-
Hi! Is it possible to make a turret tower for a vehicle to make it like a rhino? I mean negotiable turret tower that the rhino have in the game.
-
Waait I have a good idea! Maybe set a bind for fixAc130 with space
-
and is there any event for that? for warping in vehicle?
-
its the same:/ Maybe the problem is becaouse when i buy the plane then the script warp me into the vehicle.
-
now if i buy the ac130 plane then i can only shoot if i write /fixAc130:/
-
it dosent work:/ I cant use the guns when i enter the plane:(
-
how can can i make that if i enter the andromada then i can use the guns? And no commands?
-
nooo its working but i dont want it like this becaouse its not creating the ac130 with usable guns when i buy it its just will create when i enter that plane:/ I mean when i enter an andromada then it will spawn the ac130.
-
1 fast question. I edited the script becaouse i dont like the addcomandhandle so i changed to an event for OnVehicleEnter but it does not work:/ Becaouse i have a vehicle shop and there i can buy ac130 but i can only shoot when i create the ac130 with command:/ function createAc130(thePlayer, cmd) local x,y,z = getElementPosition(thePlayer) ac130 = createVehicle(592, x+10,y,z+2) setElementData(ac130, "ac130", true) gun = createObject(2985, 0, 0, 0) attachElements(gun, ac130, -2, 0, 0, 0, 180, 0) setElementData(ac130, "gun", gun) end addEventHandler("OnVehicleEnter", createAc130)
-
Is it now good? vehWeapons = {} function createM4Weapon() if getElementModel(source) == 432 then triggerServerEvent ( "MachineGun", localPlayer, { vehWeapons[source] = {} local vX, vY, vZ = getElementPosition(source) -- Wep 1 vehWeapons[source][1] = createWeapon("m4", vX, vY, vZ + 1) setWeaponClipAmmo(vehWeapons[source][1], 500) setWeaponState(vehWeapons[source][1], "ready") attachElements(vehWeapons[source][1],source,0.7,2.4,0.7,0,0,90) setWeaponFiringRate ( vehWeapons[source][1] , 63 ) end end addEventHandler( "onClientVehicleEnter",getRootElement(),createM4Weapon) addEventHandler("onClientKey", root, function(button,state) local veh = getPedOccupiedVehicle(localPlayer) if veh then if getElementModel(veh) == 432 then if vehWeapons[veh][1] then if button == "lctrl" and state == true then setWeaponState(vehWeapons[veh][1],"firing") else setWeaponState(vehWeapons[veh][1],"ready") end end end end end) function destroyCurrentVehicleWeapons() destroyElement(vehWeapons[source][1]) vehWeapons[source] = false -- Destroy the Weapons end addEventHandler("onClientVehicleExit",root, destroyCurrentVehicleWeapons) addEventHandler("onClientVehicleExplode",root, destroyCurrentVehicleWeapons) addEvent ( "MachineGun2", true ); addEventHandler ( "MachineGun2", root, createM4Weapon )
-
or need i give for it and event for onCloentWeaponFire?
-
is it now correct? triggerServerEvent ( "MachineGun", root, localPlayer, { end
-
Thanks now its working perfect!! Thanks for your help!!!!:DDD
-
Now there is no camera bugs but very big lags when i want to look around with the camera:(
-
And im really thanks that you are helping me!
-
the line 2 and 3 is for triggering the server event. Is it not good?
-
Now the bug is that the camera dosent attach to the plane. I mean when i enter the plane then there is no camera bug it dosent switches back to the normal position but there is a bug. When i start going with the plane then the camera stays in one position. I mean the camera stays there where i spawned the ac130:/ the camera only attaches to the plane when i move the mause and if i dont move the mouse then the camera stays again.
-
Thanks that you help me but its bugging in line 389. Loading script failed: ac130\client.lua:389: unexpected symbol near '<'
-
Fnaly i made i hope i made it good without problems.. So is it good? Client triggerServerEvent ( "MachineGun", localPlayer, { end addEvent ( "MachineGun2", true ); addEventHandler ( "MachineGun2", root, function ( createM4Weapon ) vehWeapons = {} function createM4Weapon() if getElementModel(source) == 432 then vehWeapons[source] = {} local vX, vY, vZ = getElementPosition(source) -- Wep 1 vehWeapons[source][1] = createWeapon("m4", vX, vY, vZ + 1) setWeaponClipAmmo(vehWeapons[source][1], 500) setWeaponState(vehWeapons[source][1], "ready") attachElements(vehWeapons[source][1],source,0.7,2.4,0.7,0,0,90) setWeaponFiringRate ( vehWeapons[source][1] , 63 ) end end addEventHandler( "onClientVehicleEnter",getRootElement(),createM4Weapon) addEventHandler("onClientKey", root, function(button,state) local veh = getPedOccupiedVehicle(localPlayer) if veh then if getElementModel(veh) == 432 then if vehWeapons[veh][1] then if button == "lctrl" and state == true then setWeaponState(vehWeapons[veh][1],"firing") else setWeaponState(vehWeapons[veh][1],"ready") end end end end end) function destroyCurrentVehicleWeapons() destroyElement(vehWeapons[source][1]) vehWeapons[source] = false -- Destroy the Weapons end addEventHandler("onClientVehicleExit",root, destroyCurrentVehicleWeapons) addEventHandler("onClientVehicleExplode",root, destroyCurrentVehicleWeapons) server addEvent ( "MachineGun", true ); addEventHandler ( "MachineGun", root, function ( info ) triggerClientEvent ( root, "MachineGun2", root, info ); end );
-
I made a video from the bug and upload it to youtube!! pls watch!! https://www.youtube.com/watch?v=XFWAQ_4 ... e=youtu.be
-
i wrote donw my problem.. My problem is that when i type /ac130 and enter the plane and press space then i cant look around with the camera becaouse it always get back to the normal position. Please just try it out download the script and test it. You will see the problem. There must be a way to fix it. you mean need i try use this function?: setPedLookAt()
-
This is that part: function cammera(screenX, screenY, absoluteX, absoluteY, vx,vy,vz) local x,y,z = getElementPosition(getPedOccupiedVehicle(getLocalPlayer())) local rx, ry, rz = getElementRotation(getPedOccupiedVehicle(getLocalPlayer())) rz = rz +180 local cx = x + math.cos(math.rad(rz)) * 3 local cy = y + math.sin(math.rad(rz)) * 3 setCameraMatrix ( cx, cy, z, vx,vy,vz) drawHud() end function keepCamAtAc130() local x,y,z = getElementPosition(getPedOccupiedVehicle(getLocalPlayer())) local rx, ry, rz = getElementRotation(getPedOccupiedVehicle(getLocalPlayer())) rz = rz +180 local cx = x + math.cos(math.rad(rz)) * 3 local cy = y + math.sin(math.rad(rz)) * 3 setCameraMatrix(cx, cy, z) drawHud() end