dutchops Posted July 12, 2010 Share Posted July 12, 2010 hello i had a idea to make a script that a plane has a Barrel Attached to the bottem of it and when they push B the airplane drops 1 barrel and the barrel will explode on the floor but what i got now is this : function mount_barrel (player) local x, y, z = getElementPosition( player ) local plain = createVehicle( 511, x, y, z ) attachElementToElement( plain, player, 0, 0, -1 ) triggerClientEvent ("bind_key", getRootElement (), object) else end end addCommandHandler ("mount_barrel", mount_barrel) addEvent ("bind_key", true) function drop_barrel () local x, y, z = getElementPosition (getPlayerOccupiedVehicle (getLocalPlayer())) createObject ( getLocalPlayer(), 1225, x, y, z + -1, -1.0 ) end function bind_key_function () bindKey ("b", "down", drop_barrel) local attachedElements = getAttachedElements ( getPlayerOccupiedVehicle (getLocalPlayer()) ) for ElementKey, ElementValue in ipairs ( attachedElements ) do setElementCollisionsEnabled (ElementValue, false) end end addEventHandler ("bind_key", getLocalPlayer(), bind_key_function) what more to add could someone help me? thnx Link to comment
dzek (varez) Posted July 12, 2010 Share Posted July 12, 2010 its already made, search on forums or on community.multitheftauto.com Link to comment
dutchops Posted July 12, 2010 Author Share Posted July 12, 2010 i asume u mean this one? https://community.multitheftauto.com/index.html?p ... ils&id=129 but can you add it to a map? Link to comment
dutchops Posted July 13, 2010 Author Share Posted July 13, 2010 that script doesnt work this is my meta : this is the script local root = getRootElement()function callbackPlayerJoin() if (spawnPlayer(source, 0, 0, 5)) then fadeCamera(source, true) end end function callbackResourceStart(startedResource) if (getResourceName(startedResource) == "bomber") then createMarker(0, 0, 2.0, "cylinder", 5, 117, 193, 36, 255) createMarker(64, 220, 0, "cylinder", 5, 44, 124, 214, 255) call(getResourceFromName("bomber"), "regBombMarkers", getElementsByType("marker", root)) end end addEventHandler("onPlayerJoin", root, callbackPlayerJoin) addEventHandler("onResourceStart", root, callbackResourceStart) and it doesnt make any bombs or wtf it doesnt even make the marker 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