Jump to content

BulgariaRoam

Members
  • Posts

    14
  • Joined

  • Last visited

Everything posted by BulgariaRoam

  1. Smart solution. Thanks working good!
  2. next to the vehicle, as he regularly do. because teleporting in vehicles not good. if anyone can help me
  3. How can i completly disable warping into vehicle. so when someone try to warp into vehicle it will warp him as normal, not inside vehicle? if anyone know, please help me. thanks. function warpMe(targetPlayer) if getElementData ( source, "attached" ) then return end if isPedDead(source) then spawnMe() end local vehicle = getPedOccupiedVehicle(targetPlayer) if not vehicle then -- target player is not in a vehicle - just warp next to him local x, y, z = getElementPosition(targetPlayer) clientCall(source, 'setPlayerPosition', x + 2, y, z) else -- target player is in a vehicle - warp into it if there's space left if getPedOccupiedVehicle(source) then --removePlayerFromVehicle(source) outputChatBox('Get out of your vehicle first.', source) return end local numseats = getVehicleMaxPassengers(vehicle) for i=0,numseats do if not getVehicleOccupant(vehicle, i) then if isPedDead(source) then local x, y, z = getElementPosition(vehicle) spawnMe(x + 4, y, z + 1) end warpPedIntoVehicle(source, vehicle, i) return end end outputChatBox('No free seats left in ' .. getPlayerName(targetPlayer) .. '\'s vehicle.', source, 255, 0, 0) end local interior = getElementInterior(targetPlayer) setElementInterior(source, interior) setCameraInterior(source, interior) end
  4. oh my god dude you are the boss! oh my god dude, you are a boss! works!!!!!
  5. function StuntCountDownFinish() for i, p in ipairs(getAlivePlayersInArena(getElementID(source))) do if getPedOccupiedVehicle(p) then setElementFrozen(getPedOccupiedVehicle(p), false) setVehicleDamageProof(getPedOccupiedVehicle(p), false) end toggleAllControls(p, true) toggleControl (p, "handbreak", false ) bindKey(p, "enter", "down", "suicide") end end if i toggle control to disable hanbreak it disable for all vehicle, if i want to disable only when vehicle infernus not working
  6. bad argument @ 'getElementModel' [Expected element at argument 1, got nil]
  7. function StuntCountDownFinish() for i, p in ipairs(getAlivePlayersInArena(getElementID(source))) do if getPedOccupiedVehicle(p) then setElementFrozen(getPedOccupiedVehicle(p), false) setVehicleDamageProof(getPedOccupiedVehicle(p), false) end toggleAllControls(p, true) bindKey(p, "enter", "down", "suicide") end if ( getElementModel (p, localVehicle) == 411 ) then toggleControl (p, "handbrake", false) end end i try alot of possibility but none seems to work for me. anyone know how i can disable hanbreak if the vehicle is infernus?
  8. Mr, you are a god to me! Thank you !!!
  9. thanks i already know that einstein, i also try this option but same problem local dimension = 0 local thePlayer = getLocalPlayer() function createVehicleCommand(cmd, ...) if (getElementDimension(thePlayer) == dimension) then local vehID local vehiclesToCreate = {} local args = { ... } for i,v in ipairs(args) do vehID = tonumber(v) if not vehID then vehID = getVehicleModelFromName(v) end if vehID then table.insert(vehiclesToCreate, math.floor(vehID)) end end server.giveMeVehicles(vehiclesToCreate) else outputChatBox("You cannot create vehicle as you are not in the Freeroam arena!", 255, 0, 0) end end addCommandHandler('createvehicle', createVehicleCommand) addCommandHandler('cv', createVehicleCommand)
  10. and how i do this for cv(createvehicle) i try put this code everywhere and not possible.
  11. Anyone has idea how do i enable the freeroam menu only for dimension 0? function openFrGui(client) if (getElementDimension(client) > 0) then outputChatBox("Your dimension doesn't allow you to open Freeroam Menu", client, 255, 0, 0) return end
  12. Hello im new i started BulgariaRoam few days ago, i have found this script but i could not make it start its all working good, until players need to join in event. it start saying this only: "hdfinfo" "hdfinfo2" ps. dont mind me im beginner in lua, so any help is welcomed. code: dfPlayer = {} local dfEliminatedPlayers = {} local dfPlayers = {} local dfStarted = false local hydradftimer local startingTimer local hydraDimension = 800 local minPlayers = 2 local maxPlayers = 30 local timeOut = 900000 -- 15 minutes until time out local hydraPos = { [1] = {1730.1080322266, -2481.8930664063, 13.5546875}, [2] = {1634.0745849609, -2483.7229003906, 13.5546875}, [3] = {1438.7257080078, -2484.6750488281, 13.5546875}, [4] = {1441.2454833984, -2592.9738769531, 13.546875}, [5] = {1532.2341308594, -2596.7080078125, 13.546875}, [6] = {1639.5656738281, -2598.0341796875, 13.546875}, [7] = {1790.9020996094, -2598.1767578125, 13.546875}, [8] = {1985.4617919922, -2599.8525390625, 13.546875}, [9] = {2107.1220703125, -2532.3002929688, 13.546875}, [10] = {2046.0454101563, -2492.328125, 13.546875}, [11] = {1954.8067626953, -2486.30859375, 13.53911781311}, [12] = {1839.9560546875, -2441.4934082031, 13.5546875}, [13] = {1875.158203125, -2382.9482421875, 13.5546875}, [14] = {1917.3041992188, -2330.8693847656, 13.546875}, [15] = {1964.9204101563, -2260.3515625, 13.546875}, } function cancelSignupCommand(player) if (not dfPlayer[player]) then outputChatBox("You didn't signup for the Hydra Dog Fight event", player, 255, 0, 0) return end if (dfStarted) then outputChatBox("The Hydra Dog Fight event had already started", player, 255, 0, 0) return end dfPlayer[player] = nil for index, player2 in pairs(dfPlayers) do if (player == player2) then table.remove(dfPlayers, index) break end end if (#dfPlayers < minPlayers and isTimer(startingTimer)) then killTimer(startingTimer) end removeEventHandler("onPlayerQuit", player, onDFQuit) end addCommandHandler("canceldf", cancelSignupCommand) function signupForDF(client) if (exports.playerEvents:isEventStarted("Hydra Dog Fight") ~= true) then return outputChatBox("This event is not yet started", client, 255, 0, 0) end if (getPlayerMoney(client) < 5000) then outputChatBox("You can't afford the entry fee (5,000)", client, 255, 0, 0) return end if (dfPlayer[client]) then outputChatBox("You have already signed up for the Hydra Dog Fight event", client, 255, 0, 0) return end if (#dfPlayers == maxPlayers) then outputChatBox("The event is already full and about to start", client, 255, 0, 0) return end if (dfStarted) then outputChatBox("The Hydra Dog Fight event had already started. Please wait till it ends", client, 255, 0, 0) return end if (getElementDimension(client) > 0) then outputChatBox("Your dimension doesn't allow you to join the Hydra Dog Fight", client, 255, 0, 0) return end dfPlayer[client] = true sendToDFPlayers(getPlayerName(client).." has signed up. "..(#dfPlayers + 1).."/"..maxPlayers.." players signed up", 255, 255, 0) table.insert(dfPlayers, client) takePlayerMoney(client, 5000, "Signed up for Hydra Dog Fight") addEventHandler("onPlayerQuit", client, onDFQuit) outputChatBox("You have successfully signed up for the Hydra Dog Fight event. "..(#dfPlayers).."/"..maxPlayers.." players signed up", client, 255, 255, 0) outputChatBox("You can use /canceldf to cancel signing up for the Hydra Dog Fight event. You can't use this command after the event has started", client, 255, 255, 0) if (#dfPlayers == minPlayers) then startingTimer = setTimer(beforeStartDF, 6000, 1) end if (#dfPlayers == maxPlayers) then if (isTimer(startingTimer)) then killTimer(startingTimer) end beforeStartDF() end end --addEvent("events.HDFsignUp", true) addCommandHandler("events.HDFsignUp", signupForDF) --addCommandHandler("joinhdf", signupForDF) function beforeStartDF() dfStarted = true sendToDFPlayers(#dfPlayers.." players have signed up for the Hydra Dog Fight event. The event will start in 10 seconds.", 255, 255, 0) addWastedHandler() setTimer(startDF, 10000, 1) end function startDF() local vehicle = createVehicle(520, hydraPos[index][1], hydraPos[index][2], hydraPos[index][3] + 1) triggerClientEvent(player, "Countdown", player) setVehicleDamageProof(vehicle, true) setTimer(setVehicleDamageProof, 8000, 1, vehicle, false) setElementFrozen(player, true) setElementDimension(vehicle, hydraDimension) setElementDimension(player, hydraDimension) toggleAllControls(player, false) warpPedIntoVehicle(player, vehicle) setTimer(setElementFrozenDelayed, 12000, 1, player, false) addEventHandler("onVehicleStartExit", resourceRoot, cancelVehicleDamage) hydradfTimer = setTimer(endDF, timeOut, 1) end function setElementFrozenDelayed(plr, bool) if (isElement(plr)) then toggleAllControls(plr, true) setElementFrozen(plr, bool) toggleControl(plr, "vehicle_secondary_fire", false) setTimer(toggleControl, 10000, 1, plr, "vehicle_secondary_fire", true) end end function onDFWasted() if (not dfPlayer[source]) then return end dfPlayer[source] = nil table.insert(dfEliminatedPlayers, source) removeEventHandler("onPlayerWasted", source, onDFWasted) removeEventHandler("onPlayerQuit", source, onDFQuit) sendToDFPlayers(getPlayerName(source).." is out!", 255, 255, 0) for index, player in pairs(dfPlayers) do if (source == player) then table.remove(dfPlayers, index) break end end end function onDFQuit() if (not dfPlayer[source]) then return end for index, player in pairs(dfPlayers) do if (source == player) then table.remove(dfPlayers, index) break end end if (dfStarted) then sendToDFPlayers(getPlayerName(source).." is out!", 255, 255, 0) if (#dfPlayers == 1) then endDF(dfPlayers[1]) end else if (#dfPlayers < minPlayers and isTimer(startingTimer)) then killTimer(startingTimer) end end end function onLogin() if (getElementDimension(source) == hydraDimension) then setElementDimension(source, 0) end end addEventHandler("onPlayerLogin", root, onLogin) function endDF(player) if (isElement(player)) then dfPlayer[player] = nil outputChatBox("You won the Hydra Dog Fight event! You got $50000. You'll be warped shortly", player, 0, 255, 0) removeEventHandler("onPlayerWasted", player, onDFWasted) removeEventHandler("onPlayerQuit", player, onDFQuit) givePlayerMoney(player, 50000, "Won Hydra Dog Fight", false) for index, player2 in pairs(dfEliminatedPlayers) do outputChatBox(getPlayerName(player).." has won the Hydra Dog Fight event!", player2, 255, 255, 0) end local function warp() if (not isElement(player)) then return end fadeCamera(player, false) local function warp() if (not isElement(player)) then return end removePedFromVehicle(player) setElementDimension(player, 0) fadeCamera(player, true) setElementPosition(player, 2731.0529785156, -1832.8316650391, 11.050182342529) end setTimer(warp, 1000, 1) end setTimer(warp, 5000, 1) else for index, player in pairs(dfPlayers) do dfPlayer[player] = nil outputChatBox("Timeout! No one won", player, 255, 0, 0) removeEventHandler("onPlayerWasted", player, onDFWasted) removeEventHandler("onPlayerQuit", player, onDFQuit) killPed(player) end for index, player in pairs(dfEliminatedPlayers) do outputChatBox("Timeout! No one won", player, 255, 0, 0) end end dfPlayers = {} dfEliminatedPlayers = {} dfPlayer = {} dfStarted = false if (isTimer(hydradfTimer)) then killTimer(hydradfTimer) end hydradfTimer = nil exports.playerEvents:stopEvent("Hydra Dog Fight") exports.playerEvents:startEvent("Duels Tournament") removeEventHandler("onVehicleStartExit", resourceRoot, cancelVehicleDamage) for index, vehicle in pairs(getElementsByType("vehicle", resourceRoot)) do destroyElement(vehicle) end end function sendToDFPlayers(message, r, g, b) for index, player in pairs(dfPlayers) do outputChatBox(message, player, r, g, b) end end function cancelVehicleDamage(player) if (dfStarted and dfPlayer[player]) then cancelEvent() end end function updatePlayerCount() if (not dfStarted) then return end for k, v in pairs(dfPlayers) do if (getElementDimension(v) == 800) then outputChatBox(v, "hdfinfo", "Do not fly outside Los Santos!", 255, 0, 0) outputChatBox(v, "hdfinfo2", "Status: "..#dfPlayers.." player/s remaining", 0, 255, 0) elseif (getElementDimension(v) ~= 800) then outputChatBox(v, "hdfinfo", "", 255, 255, 0) outputChatBox(v, "hdfinfo2", "", 255, 255, 0) end end end setTimer(updatePlayerCount, 1000, 0)
×
×
  • Create New...