Jump to content

albers14

Members
  • Posts

    73
  • Joined

  • Last visited

Everything posted by albers14

  1. if getElementModel(thePlayer) == 287 then You just need to set a "then" after the getElementModel stuff. So it would look like this: function openbasegates(thePlayer) if getElementModel(thePlayer) == 287 then -- you code moveobject stuff end end addEventHandler('onColShapeHit', basecol, openbasegates) function closebasegates(thePlayer) if getElementModel(thePlayer) == 287 then -- you code moveobject stuff end end addEventHandler('onColShapeLeave', basecol, closebasegates)
  2. No theres 2 elements hitting the marker. The player and the vehicle. He just need to use getElementType The only reason the car/vehicle also dont warp with you is because you use getElementData. For that you can say, if getElementType(hitElement) == "player" then if isPedInVehicle(hitElement) then local car = getPedOccupiedVehicle(hitElement setElementPosition(car,x,y,z) setElementPosition(hitElement,x,y,z) warpPedIntoVehicle(hitElement, car) else setElementPosition(hitElement,x,y,z) This was the basic of it. You need to fix all the bugs that can happen. The thing i just wrote was an example and help for you
  3. Whats the name of the sound? You sure its spelled 100 percent correct? with capital letters, correct format so on?
  4. albers14

    Occupation

    No, it will not work if you job dont set the data of occupation. You sure that one is setted?
  5. If you edit the places where I said you shoul then yes. As event handler you use onMarkerLeave.
  6. No need for getPedOccupiedVehicle as that one is the hitElement, if you want to freeze the player you are in need of getVehicleController instead
  7. First question I will suggest you to read here, DxDrawImage Next one is about you skill percent. Edit you skill with m4 to 1000 in the admin panel and you should be able to move Just write here again if you need more help.
  8. createColCuboid(-1015.79376, 575.34369, 0, 3995, 2495, 1000) try use showCol and see if its fit well. Tried it on my own server and it looked for me good
  9. -- Wheres number 2?And please post full codes, we dont know what formula is and so on. **Orh didnt saw that it waas fixed, sorry **
  10. function EDIT ( hitPlayer, matchingDimension ) -- Need edit if getElementType(hitPlayer) =="player" and isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( hitPlayer ) ), aclGetGroup ( "Admin" ) ) then moveObject ( gate, 2000, new coords ) -- need edit end end addEventHandler ( "Edit the eventHandler", marker, EDIT!! ) -- Need edit It can take less than 1 minute if you know the coords already else 2 minutes
  11. Not really, you putted a timer in you script thats move it back after 2 seconds. If he want todo like you saying then he should remove the timer first
  12. Type refresh in console.
  13. It gonna bugs if you use a vehicle to enter as the hitElement is an vehicle now, not player. This will work, added getElementType. local gate = createObject ( 980, 1128.3000488281, -1541.0999755859, 16.10000038147, 0, 0, 180 ) local marker = createMarker ( 1128.3000488281, -1543.5999755859, 13.300000190735, "cylinder", 2, 255, 255, 255, 255 ) function moveGate ( hitPlayer, matchingDimension ) if getElementType(hitPlayer) =="player" and isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( hitPlayer ) ), aclGetGroup ( "Admin" ) ) then moveObject ( gate, 2000, 1118, -1541.0999755859, 16.10000038147 ) setTimer ( moveBack, 2000, 1 ) end end addEventHandler ( "onMarkerHit", marker, moveGate ) function moveBack ( ) moveObject ( gate, 2000, 1128.3000488281, -1541.0999755859, 16.10000038147 ) end
  14. The best thing you probaly can do is going inside MTA and try it out with runcodes when reading Wiki. Remember to use a small visible element.
  15. No as he want the sound moving this is impossible since getElementPosition with a command dont go in and get the position of him 24/7, it only gives it once. He need to use attachelements if he wants the sound following him all the way. you said sound moving ? .. so he can use this local gX, gY, gZ = getElementPosition ( localPlayer ) local myobject = createObject ( any object, floatX, floatY, floatZ ) etc.... local mysound = playSound ( "mysound.mp3", gX, gY, gZ ) etc ..... moveObject ( myobject , floatX, floatY, floatZ ) etc.... attachElements ( mysound , myobject ) that's enough i guess playSound dont support XYZ, playSound3D does. Why using moveObject and all that other shit when you can do it easy for yourself and just only use attachElements ? As far as I know the speakers should be attached to the car and the car is already a moving object (ofcourse), so I dont see any reason to use moveObject ?
  16. No as he want the sound moving this is impossible since getElementPosition with a command dont go in and get the position of him 24/7, it only gives it once. He need to use attachelements if he wants the sound following him all the way.
  17. If you directly want it to be at the trunk you need still todo it with attachElements Read about it on wiki how you can set the position of something with attachElements (: Anyways This script is serversided function music() triggerClientEvent('onNewRadioCreate', getRootElement(), source) end addCommandHandler('speaker', music) Its the script I use to start my music at my friends server, try it out.
  18. Create the objects clientsided and use attachElements
  19. if getElementData(source, 'zoneOwner') == 'false' then setElementData ( playerZones [ source ], "zoneOwner", source --true/false? )
  20. function onRadioCreate (x,y,z,path) local playerveh = getPedOccupiedVehicle(getLocalPlayer()) local sound = playSound3D (path, x,y,z) setSoundVolume (sound, volume) setSoundMaxDistance (sound, 300) attachElements(sound,playerveh)
  21. playSound streams out to the local player.. Use playSound3D and then set min. distance and max. distance (Read wiki), and then use attachElements. Remember to stream it serversided as you already did with triggerClientEvent, else others arent able to hear it.
×
×
  • Create New...