Jump to content

Captain Cody

Members
  • Posts

    2,753
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Captain Cody

  1. Hasn't this server been posted like 10 times so far? Edit - 9 times, first topic being posted in 2011.
  2. Second computer most likely has better single core performance.
  3. @javadomidi12345 Please read the rules of this section, no effort put on your part means no help. The wiki is your ultimate source of scripting information regarding MTA, please atleast attempt to use it.
  4. Favorites added long ago. Also, it's as precise as it's gonna get.
  5. No server has done it conventially, you'd have to use a custom weapon system to come close
  6. Didn't even notice that holy crap the codes missing alot of stuff.
  7. You can't (With keeping the original AK intact) , instead use shaders.
  8. setElementRotation(theVeh,"steer"rotX,rotY,rotX*10) Well that's completely wrong, and even if it was the right function; you missed a comma after "steer" setVehicleComponentRotation(theVeh,'steer',rotX,rotY,rotX*10)
  9. You don't have to have them in the same file. You define the global table in one file then every file can use that table.
  10. I'd recommend using table based functions for organization. functions = {} functions['RoomA'] = {} functions['RoomB'] = {} functions['RoomA'].test = function () end functions['RoomB'].test = function () end functions['RoomA'].test() functions['RoomB'].test()
  11. Gotta make sure to do it on a timer, toggle the control state; and then kill it after a bit.
  12. https://wiki.multitheftauto.com/wiki/BreakObject
  13. Please post the script(s) corresponding to this, however from the sound of the debug ' safepassword ' is not defined.
  14. Please post the entire code (And be patient, chirst some of us have lives)
  15. NO EL POSTI QUESTIONA IN TUTORIALS
  16. First one does not contain 50 lines second one line 50 is blank. It's something else that's messed up.
  17. Oh did not know about that.
  18. To do so you either A have to make a custom weapon system, B make a custom jetpack system.
  19. https://wiki.multitheftauto.com/wiki/EngineLoadIFP https://wiki.multitheftauto.com/wiki/EngineReplaceAnimation swordAnimations = { 'sword_1', 'sword_2', 'sword_3', 'sword_4', 'sword_block', 'sword_hit_1', 'sword_hit_2', 'sword_hit_3', 'sword_idle', 'sword_part' } local IFP = engineLoadIFP( "sword.ifp", 'sword.custom' ) if IFP then for i,v in pairs(swordAnimations) do engineReplaceAnimation( localPlayer, "sword", v, 'sword.custom', v ) end else print('Failed to load - ','Sword.ipf') end Not tested, but should work, ensure to define it in meta properly and run that client side for everyone.
  20. Check debug, and ensure it is running client side.
  21. local playerHitCorona = {} local coronaElement = {} coronaElement[1] = createMarker(3955.6198730469, -1604.9947509766, 56.082000732422, "corona", 15, 0, 0, 255) coronaElement[2] = createMarker(3222.6970214844, -1473.5163574219, -1.5256999731064, "corona", 40, 0, 0, 255) coronaElement[3] = createMarker(3465.4184570313, -505.55020141602, 6.6930999755859, "corona", 15, 0, 0, 255) coronaElement[4] = createMarker(3788.0246582031, -807.74267578125, 110.54779815674, "corona", 10, 0, 0, 255) -- corona before hunter pickup -- and so on --[[ addEventHandler( "onClientMarkerHit", root, MarkerHit ) ]]--// Defined as markerHit and before the function move to line 31 function markerHit (element)--function MarketHit (player) // Was defined as MarketHit, switched to markerHit() if element == localPlayer then --// Just switched player to element because who knows what'll go through if source == coronaElement[1] then -- you check that the player hit the first corona playerHitCorona[1] = true -- set it to true, that means that the player hit the corona elseif source == coronaElement[2] then -- same as above playerHitCorona[2] = true elseif source == coronaElement[3] then -- on this corona, you check that the player hit all previous coronas playerHitCorona[3] = true --playerHitCorona[1] = true playerHitCorona[2] = true // Set to playerHitCorona[3], used 1 and 2 before elseif source == coronaElement[4] then if playerHitCorona[1] and playerHitCorona[2] and playerHitCorona[3] then -- Correcto -- player hit all coronas, do nothing else local vehicle = getPedOccupiedVehicle(localPlayer) outputChatBox("#ADD8E6AW#FFFFFFOL: You're not worthy") blowVehicle(vehicle) end end end end --) // ) should not be there because this is in a full function addEventHandler( "onClientMarkerHit", root, markerHit )--< addEventHandler should be moved here That goes through and explains what exactly was wrong the code, I'd say mostly just typos and misunderstandings how lua works. coronaInformation = {} coronaInformation[1] = {3955.6198730469, -1604.9947509766, 56.082000732422, "corona", 15, 0, 0, 255} coronaInformation[2] = {3222.6970214844, -1473.5163574219, -1.5256999731064, "corona", 40, 0, 0, 255} coronaInformation[3] = {3465.4184570313, -505.55020141602, 6.6930999755859, "corona", 15, 0, 0, 255} coronaInformation[4] = {3788.0246582031, -807.74267578125, 110.54779815674, "corona", 10, 0, 0, 255} function prep() if not running then running = true if coronaElement then for i,v in pairs(coronaElement) do if isElement(v) then destroyElement(v) end end end playerHitCorona = {} coronaElement = {} for i,v in pairs(coronaInformation) do coronaElement[i] = createMarker(unpack(v)) end addEventHandler( "onClientMarkerHit", root, markerHit ) end end function verifyScore(count) for i=1,(count or #coronaElement) do if not playerHitCorona[i] then return false -- # If a marker was not hit then return false end end return true --# If none of the above passes, return true end function markerHit (player) if player == localPlayer then for i,v in pairs(coronaElement) do if (source == v) then if (i == 1) or verifyScore(i-1) then --# Checks if marker is 1, and if not checks if you scored the previous ones. playerHitCorona[i] = true destroyElement(v) --# Removes the marker when you hit it if (i == #coronaElement) then -- # If this is the last one, try to score doScore() end end end end end end function doScore() if verifyScore() then -- # If all markers have been hit then continue -- Score else -- If a marker was not hit then blow em to peices local veh = getPedOccupiedVehicle(localPlayer) outputChatBox("#ADD8E6AW#FFFFFFOL: You're not worthy") blowVehicle(veh) end removeEventHandler( "onClientMarkerHit", root, markerHit ) running = nil end prep() Here's 'better' way of doing it that'll allow you to place more markers in the list and still have the function work 100% (Untested)
  22. Also next time, please give an attempt and at least have some sort of code written (Even if 100% broken) before posting here.
×
×
  • Create New...