Jump to content

JR10

Retired Staff
  • Posts

    2,947
  • Joined

  • Last visited

Everything posted by JR10

  1. I fixed it: addEventHandler("onMarkerHit", root, function(hitElement) for k, marker in ipairs(myMarkers) do if marker == source then table.remove(myMarkers, k) destroyElement (source) if #myMarkers == 0 then giveWeapon(hitElement, 31, 300, true) end end end end ) Tested.
  2. Lol, that's a record for mysql problems.
  3. JR10

    Hydra .

    Hmm, then it's another wiki mistake. function disableFireForHydra ( theVehicle, seat, jacked ) if ( getElementModel ( theVehicle ) == 520 ) then -- if they entered a hydra if hasObjectPermissionTo (source, "function.banPlayer", false) then setVehicleGunsEnabled ( theVehicle, true) else setVehicleGunsEnabled ( theVehicle, false) end end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), disableFireForHydra )
  4. local myMarkers = { createMarker( 0, 0, 4, 'cylinder', 1, 255, 0, 0, 150 ), createMarker( 0, 2, 4, 'cylinder', 1, 255, 0, 0, 150 ), createMarker( 0, 4, 4, 'cylinder', 1, 255, 0, 0, 150 ), createMarker( 0, 6, 4, 'cylinder', 1, 255, 0, 0, 150 ), createMarker( 0, 8, 4, 'cylinder', 1, 255, 0, 0, 150 ) } function PlayerMarkerHit( markerHit, matchingDimension ) for k, marker in ipairs(myMarkers) do if marker == markerHit then marker = nil destroyElement ( markerHit ) break end end if #myMarkers == 0 then giveWeapon ( source, 31 ) end end addEventHandler( "onPlayerMarkerHit", root, PlayerMarkerHit )
  5. JR10

    Hydra .

    I did, in one [lua] check again.
  6. 22 Days later ... What's happens? any errors? local myMarkers = { createMarker( 0, 0, 4, 'cylinder', 1, 255, 0, 0, 150 ), createMarker( 0, 2, 4, 'cylinder', 1, 255, 0, 0, 150 ), createMarker( 0, 4, 4, 'cylinder', 1, 255, 0, 0, 150 ), createMarker( 0, 6, 4, 'cylinder', 1, 255, 0, 0, 150 ), createMarker( 0, 8, 4, 'cylinder', 1, 255, 0, 0, 150 ) } function PlayerMarkerHit( markerHit, matchingDimension ) for k, marker in ipairs(myMarkers) do if marker == markerHit then table.remove(myMarkers, markerHit) destroyElement ( markerHit ) break end end if #myMarkers == 0 then giveWeapon ( source, 31 ) end end addEventHandler( "onPlayerMarkerHit", root, PlayerMarkerHit )
  7. JR10

    Hydra .

    It's working, you are using it server side, that's why the functions works on all the players. Here: -- SERVER SIDE function disableFireForHydra ( theVehicle, seat, jacked ) if ( getElementModel ( theVehicle ) == 520 ) then -- if they entered a hydra if not hasObjectPermissionTo (source, "function.banPlayer", false) then -- disable their guns triggerClientEvent(source, "disableHydraGuns", source, theVehicle) end end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), disableFireForHydra ) -- CLIENT SIDE addEvent("disableHydraGuns", true) addEventHandler("disableHydraGuns", root, function(veh) setVehicleGunsEnabled(veh, false) end) Should work, notice that there is server and client sides.
  8. JR10

    attachelement

    attachElements (object, car, posX, posY, posZ, rotX, rotY, rotZ) and else outputChatBox ("* Error!", Player, 255, 0, 0) end else @ a functions? Where is the effort really i can't see any effort in a 11 line code. I use this for attaching: function attachRotationAdjusted ( from, to ) local frPosX, frPosY, frPosZ = getElementPosition( from ) local frRotX, frRotY, frRotZ = getElementRotation( from ) local toPosX, toPosY, toPosZ = getElementPosition( to ) local toRotX, toRotY, toRotZ = getElementRotation( to ) local offsetPosX = frPosX - toPosX local offsetPosY = frPosY - toPosY local offsetPosZ = frPosZ - toPosZ local offsetRotX = frRotX - toRotX local offsetRotY = frRotY - toRotY local offsetRotZ = frRotZ - toRotZ offsetPosX, offsetPosY, offsetPosZ = applyInverseRotation ( offsetPosX, offsetPosY, offsetPosZ, toRotX, toRotY, toRotZ ) attachElements( from, to, offsetPosX, offsetPosY, offsetPosZ, offsetRotX, offsetRotY, offsetRotZ ) end function applyInverseRotation ( x,y,z, rx,ry,rz ) local DEG2RAD = (math.pi * 2) / 360 rx = rx * DEG2RAD ry = ry * DEG2RAD rz = rz * DEG2RAD local tempY = y y = math.cos ( rx ) * tempY + math.sin ( rx ) * z z = -math.sin ( rx ) * tempY + math.cos ( rx ) * z local tempX = x x = math.cos ( ry ) * tempX - math.sin ( ry ) * z z = math.sin ( ry ) * tempX + math.cos ( ry ) * z tempX = x x = math.cos ( rz ) * tempX + math.sin ( rz ) * y y = -math.sin ( rz ) * tempX + math.cos ( rz ) * y return x, y, z end use it like: attachRotationAdjusted(object, vehicle) Example: addCommandHandler("attach", function(player) local x, y, z = getElementPosition(player) local veh = createVehicle(411, x, y+3, z) local obj = createObject(2985, x, y+3, z+1) attachRotationAdjusted(obj, veh) This will create an infernus and attach a minigun base object to the top of it.
  9. JR10

    Cars

    It should be server side, and it should work.
  10. JR10

    Hydra .

    What happens exactly?
  11. Thanks. Yes, you can edit / delete / create resource files, and you don't 've to worry about the meta, it will be edited. You mean the settings? there is one for the bindKey I'm planning on adding Creating resources, and ACL edit.
  12. A resource manager resource made by me. Start / Stop / Restart resources. Edit / Create / Delete resource files. Find resource. Delete resource. F2 opens the gui, there is settings for it in the meta. Remp: for the gui editor. https://community.multitheftauto.com/index.php?p= ... ls&id=2575 Any ideas / bugs / questions post them please.
  13. Well, thanks jaysds. However i'm asking, if i'm releasing a new version, what should i do? post a new topic or just bump my old one. I couldn't find anything about it in the Forum rules topic.
  14. JR10

    Take anim

    You can make the player perform an animation but he won't do anything exept doing the animation, no picking from the floor. You can make the player pick something though by using attachElements you can attach a bottle(object) to a player using it, click on it for more information.
  15. JR10

    Camera Target

    setCameraTarget server/client side only works on players
  16. JR10

    Camera Target

    setCameraTarget?, why? setCameraTarget currently works only with players, so you can't set the camera target on an object.
  17. JR10

    Hydra .

    function disableFireForHydra ( theVehicle, seat, jacked ) if ( getElementModel ( theVehicle ) == 520 ) then -- if they entered a hydra if not hasObjectPermissionTo (source, "function.banPlayer", false) then setVehicleGunsEnabled ( theVehicle, false ) -- disable their guns end end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), disableFireForHydra ) And add it anywhere, doesn't matter.
  18. JR10

    Hydra .

    function disableFireForHydra ( theVehicle, seat, jacked ) if ( getElementModel ( theVehicle ) == 520 ) then -- if they entered a hydra if hasObjectPermissionTo (source, "function.banPlayer", false) then setVehicleGunsEnabled ( theVehicle, false ) -- disable their guns end end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), disableFireForHydra )
  19. JR10

    NPC Record?

    Your starting to do that again, seriously stop. -.-
  20. LOL Lol all you want, just don't post it, i thought you stopped doing that. Don't post without a reason.
×
×
  • Create New...