BieHDC Posted June 26, 2013 Share Posted June 26, 2013 Hello, i think that this was ask already some time ago, but cant find ANYWHERE. So how to add cars a rocket launcher? I think there is already a script, so can you pls post me link? thanks Link to comment
bandi94 Posted June 26, 2013 Share Posted June 26, 2013 Downlaod the map and see the script inside it. Copy it or make your own one it's not hard. https://community.multitheftauto.com/in ... ls&id=2297 Link to comment
novo Posted June 26, 2013 Share Posted June 26, 2013 attachElements(); -- [url=https://wiki.multitheftauto.com/wiki/AttachElements]https://wiki.multitheftauto.com/wiki/AttachElements[/url] Link to comment
BieHDC Posted June 26, 2013 Author Share Posted June 26, 2013 Thx i was looking for^but scripts are complimed you know a map with these scripts uncomplimed? Link to comment
xTravax Posted June 26, 2013 Share Posted June 26, 2013 Here's a script for rockets from my OWN shooter map NOTE: You'll have to edit this a bit if u want to remove this text function cbinds() local keys1 = getBoundKeys("vehicle_fire") local keys2 = getBoundKeys("vehicle_secondary_fire") if keys1 then for keyName, state in pairs(keys1) do bindKey(keyName, "down", cdoshoot) end bindKey("F", "down", cdoshoot) cbindsText = "- Press CTRL or LMB to shoot rockets.\n- You can shoot a rocket once in every 3 seconds.\n- good luck and have fun!" end if keys2 then for keyName, state in pairs(keys2) do bindKey(keyName, "down", cdoshoot) end end if (not keys1) and (not keys2) then bindKey("F", "down", cdoshoot) bindKey("lctrl", "down", cdoshoot) bindKey("rctrl", "down", cdoshoot) cbindsText = "- Press CTRL or LMB to shoot rockets.\n- You can shoot a rocket once in every 3 seconds." end theVehicle = getPedOccupiedVehicle(cLP) allowShoots() bindKey("M", "down", toggleText) end Link to comment
BieHDC Posted June 26, 2013 Author Share Posted June 26, 2013 Is the script client side? And is it the full script for shooting rockets ouf of car? Link to comment
BieHDC Posted June 26, 2013 Author Share Posted June 26, 2013 Found this: cLP = getLocalPlayer() screenWidth, screenHeight = guiGetScreenSize() function cRStest() setTimer(resourcesCheck, 10000, 1) end addEventHandler("onClientResourceStart", getRootElement(), cRStest) function resourcesCheck() if check=="done" then return else setRadioChannel(0) setTimer(cbinds, 1000, 1) textToggle=0 check="done" end end function cRS() if check=="done" then return else setRadioChannel(0) setTimer(cbinds, 3333, 1) textToggle=0 check="done" end end addEventHandler("onClientPlayerSpawn", getLocalPlayer(), cRS) function markers(player) if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) fixVehicle(vehicle) end end addEventHandler("onClientMarkerHit", getResourceRootElement(getThisResource()), markers) function cbinds() local keys1 = getBoundKeys("vehicle_fire") local keys2 = getBoundKeys("vehicle_secondary_fire") if keys1 then for keyName, state in pairs(keys1) do bindKey(keyName, "down", cdoshoot) end bindKey("F", "down", cdoshoot) cbindsText = "- Press F or the button you use to fire to shoot rockets!\n- You can shoot once every 3 seconds.\n- good luck and have fun!.Scipt made By play3r" end if keys2 then for keyName, state in pairs(keys2) do bindKey(keyName, "down", cdoshoot) end end if (not keys1) and (not keys2) then bindKey("F", "down", cdoshoot) bindKey("lctrl", "down", cdoshoot) bindKey("rctrl", "down", cdoshoot) cbindsText = "- Press F or CTRL to shoot rockets!\n- You can shoot once every 3 seconds." end theVehicle = getPedOccupiedVehicle(cLP) allowShoots() bindKey("M", "down", toggleText) outputChatBox("#FF0000Press #00ff00M #ff0000to show/hide instructions! \"{SMILIES_PATH}/icon_biggrin.gif\" alt=\"\" title=\"Very Happy\" />", 255, 255, 255, true) end function toggleText() if textToggle==0 then addEventHandler("onClientRender", getRootElement(), bindsText) textToggle=1 elseif textToggle==1 then removeEventHandler("onClientRender", getRootElement(), bindsText) textToggle=0 end end function allowShoots() bindTrigger = 1 end function cdoshoot() if bindTrigger == 1 then if not isPlayerDead(cLP) then bindTrigger = 0 local x,y,z = getElementPosition(theVehicle) local rX,rY,rZ = getVehicleRotation(theVehicle) local x = x+4*math.cos(math.rad(rZ+90)) local y = y+4*math.sin(math.rad(rZ+90)) createProjectile(theVehicle, 19, x, y, z, 1.0, nil) setTimer(allowShoots, 3000, 1) end end end function bindsText() dxDrawText(cbindsText, screenWidth/15, screenHeight/2.5, screenWidth, screenHeight, tocolor(0, 149, 254, 255), 0.75, "bankgothic") end Link to comment
BieHDC Posted June 26, 2013 Author Share Posted June 26, 2013 Is this the script i was looking for? Link to comment
arezu Posted June 26, 2013 Share Posted June 26, 2013 That script doesn't always work correctly, here is better one: local shootTimer = nil function shoot() local vehicle = getPedOccupiedVehicle(localPlayer) if not isElement(vehicle) then return end if(not isTimer(shootTimer))then local posX, posY, posZ = getElementPosition(vehicle) shootTimer = setTimer(function()end, 3333, 1) createProjectile(vehicle, 19, posX, posY, posZ, 1.0) end end bindKey("vehicle_fire", "down", shoot) bindKey("vehicle_secondary_fire", "down", shoot) Link to comment
BieHDC Posted June 27, 2013 Author Share Posted June 27, 2013 can somebody confirm that the script works? Link to comment
arezu Posted June 27, 2013 Share Posted June 27, 2013 can somebody confirm that the script works? Just try it yourself?? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now