Jump to content

gerlachmax123

Members
  • Posts

    45
  • Joined

  • Last visited

Everything posted by gerlachmax123

  1. And the gate should move every time, not one time..
  2. Server side or Client? Thank you
  3. Hello, How i can create a Gate thats moving every time. Without Command.. Thank you
  4. Hello, How i can freeze a vehicle, when the vehicle drives in a marker? After 1 second the vehicle will unfreeze..
  5. hi, How i get the nearest Object? Its the Object Model "17950" (Garage). That here get the nearest vehicle: function getNearestVehicle( player ) local x, y, z = getElementPosition( player ) local prevDistance local nearestVehicle for i, v in ipairs( getElementsByType( "vehicle" ) ) do local distance = getDistanceBetweenPoints3D( x, y, z, getElementPosition( v ) ) if distance <= ( prevDistance or distance + 1 ) then prevDistance = distance nearestVehicle = v end end return nearestVehicle or false end function doSomethingWithTheNearestVeh( player ) local vehicle = getNearestVehicle( player ) if vehicle then if not getPedOccupiedVehicle( player ) then else outputChatBox ( "blabla!", player, 125, 0, 0 ) end end end addCommandHandler( "blabla", doSomethingWithTheNearestVeh ) But i need the nearest Object.. Model 17950
  6. But what is the standart from the m4?
  7. How i can set the ak-47 like to m4. The ak-47 should equal to shoot well like the m4. The Ak-47 should be have the same stats ( skills, munition,...) like the m4 How i can do that?
  8. when the car is burning, you must go away and the come again to see the blip...
  9. oh it works, but when the car is burning, you must go away and the come again. Then is the Blip there This works serverside too?
  10. This wont check the vehicle, if the vehicle will be repaired.. addEvent("burnBlip", true) addEventHandler("burnBlip", root, function (car) if getElementType(car) == "vehicle" then local check = getElementHealth(car) if check < 250 then local x,y,z = getElementPosition(source) local blip = createBlip(x,y,z, 43) attachElements(blip, car) else destroyElement(blip) end end end )
  11. Why this want work? barricadeFactions = { [10]=true } vehicleBlips = {} addEventHandler( "onClientElementStreamIn", getRootElement(), function() if getElementType( source ) == "vehicle" then if getElementHealth ( source ) < 250 then if barricadeFactions[getElementData ( lp, "fraktion" )] then setTimer( function( v ) vehicleBlips[v] = createBlipAttachedTo( v, 27, 1 ) end, 100, 1, source ) end end end end ) addEventHandler( "onClientElementStreamOut", getRootElement(), function() if getElementType( source ) == "vehicle" then if vehicleBlips[source] then destroyElement( vehicleBlips[source] ) vehicleBlips[source] = nil end end end )
  12. Difficult ^^ Thank you for your help
  13. How i can create a Blip on any vehicle if the vehicle is burning = (249)
  14. yes No you dont want to say this I think because of you are making a rocket script for race? And when car shots rocket you want it to wait 5 second? I want to start a function after i hold the button 5 seconds
  15. No, that already works, but i like to press the button "lctrl" 5 seconds and not 1 second...
  16. function bindKeys() if isfeuerwehr ( player ) then bindKey(source, "lctrl", "down", "loeschen") end end addEventHandler("onPlayerJoin", root, bindKeys) How i can change it, that you must press lctrl 5 seconds?
  17. fraktionen/feuerwehr/feuerwehr_server.lua:75: ')' expected (to close '(' at line 74) near 'setPedAnimation'
  18. So? function getNearestVehicle( player ) local x, y, z = getElementPosition( player ) local prevDistance local nearestVehicle for i, v in ipairs( getElementsByType( "vehicle" ) ) do local distance = getDistanceBetweenPoints3D( x, y, z, getElementPosition( v ) ) if distance <= ( prevDistance or distance + 1 ) then prevDistance = distance nearestVehicle = v end end return nearestVehicle or false end function doSomethingWithTheNearestVeh( player ) local vehicle = getNearestVehicle( player ) local x1, y1, z1 = getElementPosition ( vehicle ) local x2, y2, z2 = getElementPosition ( player ) if vehicle then if not getPedOccupiedVehicle( player ) then if isfeuerwehr ( player ) then if (getPedWeapon (player) == 42) then if getDistanceBetweenPoints3D ( x1, y1, z1, x2, y2, z2 ) < 5 then if (getElementHealth ( vehicle ) <= 255 setPedAnimation( player, "FLAME", "FLAME_fire" ) setTimer( setPedAnimation, 15000, 1, player ) setElementHealth( vehicle, 255 ) else outputChatBox ( "Dieses Fahrzeug brennt nicht!", player, 125, 0, 0 ) end else outputChatBox ( "Hier ist kein Fahrzeug zum Reparieren!", player, 125, 0, 0 ) end else outputChatBox ( "Du hast keinen Feuerloescher!", player, 125, 0, 0 ) end else outputChatBox ( "Du bist kein Mitglied der Feuerwehr!", player, 125, 0, 0 ) end else outputChatBox ( "Du musst vor der Motorhaube des Fahrzeuges stehen!", player, 125, 0, 0 ) end end end addCommandHandler( "loeschen", doSomethingWithTheNearestVeh )
  19. Why this doesnt work? function getNearestVehicle( player ) local x, y, z = getElementPosition( player ) local prevDistance local nearestVehicle for i, v in ipairs( getElementsByType( "vehicle" ) ) do local distance = getDistanceBetweenPoints3D( x, y, z, getElementPosition( v ) ) if distance <= ( prevDistance or distance + 1 ) then prevDistance = distance nearestVehicle = v end end return nearestVehicle or false end function doSomethingWithTheNearestVeh( player ) local vehicle = getNearestVehicle( player ) if vehicle then if not getPedOccupiedVehicle( player ) then if isfeuerwehr ( player ) then if (getPedWeapon (player) == 42) then if (getElementHealth ( vehicle ) <= 255 setPedAnimation( player, "FLAME", "FLAME_fire" ) setTimer( setPedAnimation, 15000, 1, player ) setElementHealth( vehicle, 255 ) else outputChatBox ( "Dieses Fahrzeug brennt nicht!", player, 125, 0, 0 ) end else outputChatBox ( "Du hast keinen Feuerloescher!", player, 125, 0, 0 ) end else outputChatBox ( "Du bist kein Mitglied der Feuerwehr!", player, 125, 0, 0 ) end else outputChatBox ( "Du musst vor der Motorhaube des Fahrzeuges stehen!", player, 125, 0, 0 ) end end end addCommandHandler( "loeschen", doSomethingWithTheNearestVeh ) And how i can set the distance to 5m ? So I can repair the Vehicle (thats burning) only in 5 m
×
×
  • Create New...