Jump to content

Gtagasje

Members
  • Posts

    141
  • Joined

  • Last visited

Everything posted by Gtagasje

  1. I have made a givemoney script for all players, but I wan't it to only give the team police paycheck. I don't know how to do this.. This is what I have: function allPlayersPayDay() local allPlayers = getElementsByType("player") for index,value in ipairs(allPlayers) do givePlayerMoney ( value, 5000 ) outputChatBox ( "PayTime! You have been given 5K! Enjoy!", value ) end end function onResourceStart(thisResource) setTimer ( allPlayersPayDay, 1000, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), onResourceStart ) Btw, the time is just for testing.
  2. I forget the marker to add, cus my script was a bit longer, so I coppied the needed things, and thx castillo
  3. I have made a script ( with help ) of gates, which will open if you are on the team AirForce. But now I wan't it to open for the teams AirForce and Army. Can somebody help me please? this is what I have: (P.S. it's only open gate, not the move back) local ingang1 = createObject ( 980, -1907.9000244141, 2172.8999023438, 3.2000000476837, 0, 0, 0 ) function moveGate1 ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" and getPlayerTeam ( hitElement ) ==getTeamFromName( "AirForce") then moveObject ( ingang1, 3000, -1907.9000244141, 2172.8999023438, 9 ) end end addEventHandler("onMarkerHit", ingangmarker, moveGate1) Ps, ingang1 means entrace1
  4. I have created a give vehicle marker, but I wan't it to only work when the team is "Police". I don't know how to do this.. I tried several things, but the most logic for me is this: local vehicleMarker = createMarker(1552.33, -1605.37, 12.5, 'cylinder', 2.0, 0, 0, 255, 150 ) function vehicleMarkerHit ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" and if getElementTeam ( hitElement ) == "Police" then local vehicle = createVehicle ( 596, 1552.33, -1605.37, 13, 0, 0, 180 ) warpPedIntoVehicle(hitElement, vehicle) end end end addEventHandler( "onMarkerHit", vehicleMarker , vehicleMarkerHit ) Can somebody please help me?
  5. Gtagasje

    moveObject

    Thx, I make it onMarkerHit again, cus I can't fix this.
  6. Gtagasje

    moveObject

    I know what it means. But I don't know what it gives.. the depth under the ground or what.. like height says the max height (if i'm right) in the air.
  7. Gtagasje

    moveObject

    where the **** did my reply go? Never mind I make it again. It doesn't show any debug errors. The colshape sizes may be wrong (I think) but I don't know how to solve this.. I also don't know what depth is.. It is just a little tube far away from the gate, and the coördinates from the colshape (X,Y,Z) are infront of the gate, and very close. Can u tell me what depth is? And maybe you know how to fix this problem..
  8. Gtagasje

    moveObject

    ok, so I created the colshape, it is also working.. but I don't get the position.. The colshape is there, but at the wrong place. It's a little area far away from the gate. This is what I have: local colshape1= createColCuboid( 1252.98486, -1399.16370, 13.01563, 20, 20, 20) local gate1 = createObject ( 980, 1252.8000488281, -1399.0999755859, 14.800000190735, 0, 0, 90 ) function movingObject ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" then moveObject ( gate1, 3000, 1252.8000488281, -1413, 14.800000190735 ) end end function moveObjectBack () moveObject ( gate1, 3000, 1252.8000488281, -1399.0999755859, 14.800000190735 ) end addEventHandler ( "onColShapeHit", colshape1 , movingObject ) addEventHandler ( "onColShapeLeave", colshape1 , moveObjectBack )
  9. Gtagasje

    moveObject

    Thank you, i'll try to add it to my moveObject script, and see if I did it right ;p
  10. Gtagasje

    moveObject

    And a colcuboid? I need to set the radius to for example 20 for a height like an AirportGate?
  11. Gtagasje

    moveObject

    So it need to be the exact position as yourself? Also the height?
  12. Gtagasje

    moveObject

    Oh, thank you Btw, do u know a place where I can see where to place a colshape for a gate?
  13. Gtagasje

    moveObject

    Hello, I made a script to move an object onmarkerhit, since I didn't know how to place the colshapes (Bad me.). But, if I enter the marker (debugscript 3 is on) it doesn't show an error message, but the gate won't move. Also if I start it in console, it doesn't show an error message. This is what I have: local marker1 = createMarker ( 1253.0999755859, -1399, 12, 'cylinder', 11, 222, 222, 1, 225 ) local gate1 = createObject ( 980, 1252.8000488281, -1399.0999755859, 14.800000190735, 0, 0, 90 ) function moveObject ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" then moveObject ( gate1, 3000, 1252.8000488281, -1413, 14.800000190735 ) end end function moveObjectBack () if getElementType ( hitElement ) == "player" then moveObject ( gate1, 3000, 1252.8000488281, -1399.0999755859, 14.800000190735 ) end end addEventHandler ( "onMarkerHit", marker1 , moveObject ) addEventHandler ( "onMarkerLeave", marker1, moveObjectBack ) I hope somebody can help me, or can tell me how and where to place the colShapes.
  14. Thank you very much. Also thanks for your fast reply . I tested it and it worked
  15. I made a vehicle spawn script, which will create a vehicle when you enter a marker. The only thing is, I don't know how to warp the player into the vehicle.. I couldn't find it on the internet, and wiki also couldn't (My script isn't the same) so that's why I post it here. This is what I currently have: local vehicleMarker = createMarker(1552.33, -1605.37, 13, 'cylinder', 2.0, 255, 0, 0, 150 ) function vehicleMarkerHit ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" and not isPedInVehicle (hitElement) then createVehicle ( 468, 1552.33, -1605.37, 13 ) end end addEventHandler( "onMarkerHit", vehicleMarker , vehicleMarkerHit ) Btw, if it's a failing script, say it.. this is one of my first scripts Greetz, Gtagasje
×
×
  • Create New...