-
Posts
2,947 -
Joined
-
Last visited
Everything posted by JR10
-
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.
-
Lol, that's a record for mysql problems.
-
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 )
-
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 )
-
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 )
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
setCameraTarget server/client side only works on players
-
setCameraTarget?, why? setCameraTarget currently works only with players, so you can't set the camera target on an object.
-
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.
-
He already solved it.
-
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 )
-
There is, check the wiki.
-
Your starting to do that again, seriously stop. -.-
-
LOL Lol all you want, just don't post it, i thought you stopped doing that. Don't post without a reason.