Jump to content

FLUSHBICEPS

Members
  • Posts

    99
  • Joined

  • Last visited

  • Days Won

    4

FLUSHBICEPS last won the day on May 1 2023

FLUSHBICEPS had the most liked content!

1 Follower

Recent Profile Visitors

1,112 profile views

FLUSHBICEPS's Achievements

Punk-@ss B*tch

Punk-@ss B*tch (12/54)

26

Reputation

  1. --serverside function onHit(player) if (#m > 0 and #b > 0) then destroyElement(m[1]) destroyElement(b[1]) table.remove(m, 1) table.remove(b, 1) end for i, k in ipairs(Bomb2) do if (isElementAttached(Bomb2[i])) then detachElements(Bomb2[i], helic[1]) plantedBombs = plantedBombs + 1 outputChatBox("Bomb has been successfully installed, Do the same with the rest!", root, 34, 139, 34) outputChatBox(plantedBombs) ---- This returns what it should return triggerClientEvent(player, "updatePlantedBombs", root, plantedBombs) end end if (plantedBombs == 5) then triggerEvent("stopMission", root, onHit) givePlayerMoney(player, 50000) outputChatBox("Congratulations, you have passed the mission and got $50,000 as a reward!", root, 34, 139, 34) end end --clientside addEvent("updatePlantedBombs", true) addEventHandler("updatePlantedBombs", root, function(plantedBombsFromServer) plantedBombs = plantedBombsFromServer end) function renderTimer() local white = tocolor(255, 255, 255, 255) if (isTimer(startTimer)) then local remaining = getTimerDetails(startTimer) local remaining = remaining / 1000 outputChatBox(plantedBombs) ---- Should now print the updated value dxDrawText("Delivered Bombs : "..plantedBombs.."", 1162, 654, screenW, 711, white, 1.3, "default-bold", "right", "bottom") dxDrawText("Time Remaining : "..math.floor(remaining / 60)..":"..math.floor(remaining % 60).."", 1228, 725, screenW, 740, white, 1.3, "default-bold", "right", "bottom") end end
  2. Dynamic Weather System Ever wished to bring your server’s world to life? Dynamic weather systems offer an extra level of immersion and unpredictability to your game, giving each session a true one-of-a-kind feel. In this tutorial we are going to create dynamic basic weather system which’ll change over time and based on certain conditions. Introduction A dynamic weather system will periodically change the weather in your server, ensuring players experience a variety of conditions. This can be based on real-world data, predefined patterns, or random selections. Setting Up Weather Table: First, create a table of weather types you want to use. local weathers = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} Time-Based Changes: To make the weather change based on in-game time: setTimer(function() local hour, minute = getTime() if hour == 6 or hour == 12 or hour == 18 then setWeather(table.random(weathers)) end end, 60000, 0) -- Check every minute Random Weather Patterns: If you want more unpredictability: setTimer(function() if math.random(1, 10) > 7 then -- 30% chance every 10 minutes setWeather(table.random(weathers)) end end, 600000, 0) Advanced Features Weather Transitions: Instead of abrupt changes, smoothly transition between weathers. setWeatherBlended(table.random(weathers)) Seasonal Changes: Make certain weathers more likely during specific in-game months. local winterWeathers = {12, 13, 14, 15, 16} local summerWeathers = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} local month = getRealTime().month if month >= 11 or month <= 2 then setWeather(table.random(winterWeathers)) else setWeather(table.random(summerWeathers)) end Player Feedback: Notify players of significant weather changes. local weatherNames = { [0] = "Clear", [1] = "Cloudy", -- ... add all weather names } addEventHandler("onWeatherChange", root, function(newWeather) outputChatBox("The weather is now " .. weatherNames[newWeather] .. "!") end)
  3. Can you describe the issue? Why you need onPlayerWasted? getDistanceBetweenPoints3D is missing the target coordinates outputChatBox functions are missing messages to display to the player spawn points for the condition are not defined
  4. theres a small issue in your code The Z position in the createMarker function has a subtraction without proper spacing change this line bombMarker = createMarker(364.70267, 186.29311, 1019.98438 -0.5, "cylinder", 1, 255, 0, 0) to this line bombMarker = createMarker(364.70267, 186.29311, 1019.98438 - 0.5, "cylinder", 1, 255, 0, 0)
  5. https://wiki.multitheftauto.com/wiki/EngineReplaceAnimation
  6. --server side local startTime = getTickCount() addEvent("requestMusicPosition", true) addEventHandler("requestMusicPosition", root, function() local elapsedTime = getTickCount() - startTime local soundDuration = 20 * 60 * 1000 local playbackPosition = elapsedTime % soundDuration triggerClientEvent(client, "playClubMusic", client, playbackPosition) end ) --clientside addEventHandler('onClientResourceStart', resourceRoot, function() triggerServerEvent("requestMusicPosition", localPlayer) end ) addEvent("playClubMusic", true) addEventHandler("playClubMusic", root, function(playbackPosition) local sound = playSound3D("Dj_Ivan.mp3", -2677, 1411, 908, true) setSoundMaxDistance(sound, 100) setSoundVolume(sound, 4) setSoundPosition(sound, playbackPosition / 1000) end ) This setup ensures that when a player enters the club, they hear the music from the same position as everyone else
  7. I guess he wants the ability to cycle through and select different nearby players and not always target the closet one on the screen local playerSelectedTarget local alpha = 255 local nearbyPlayers = {} local selectedIndex = 1 addEventHandler("onClientRender", root, function() if getKeyState("mouse2") then local x, y, z = getElementPosition(localPlayer) nearbyPlayers = {} -- reset the table for _, target in ipairs(getElementsByType("player", root, true)) do if target ~= localPlayer then local px, py, pz = getElementPosition(target) local distance = getDistanceBetweenPoints3D(px, py, pz, x, y, z) if distance < 30 then table.insert(nearbyPlayers, target) end end end playerSelectedTarget = nearbyPlayers[selectedIndex] if isElement(playerSelectedTarget) then -- ur code to display the selection effect end else if isElement(playerSelectedTarget) then alpha = 0 setElementData(localPlayer, "Select", false) end end end ) addEventHandler("onClientKey", root, function(button, press) if button == "mouse_wheel_up" and press then selectedIndex = selectedIndex - 1 if selectedIndex < 1 then selectedIndex = #nearbyPlayers end elseif button == "mouse_wheel_down" and press then selectedIndex = selectedIndex + 1 if selectedIndex > #nearbyPlayers then selectedIndex = 1 end end end )
  8. the gate is not closing because the "Reset" event is being triggered immediately after the gate is opened local GateCloseTimer = nil -- variable to hold the timer addEventHandler("onClientClick", root, function(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) if GateMenu and button == "left" and state == "down" then if isMouseInPosition(sx*.42, sy*.6, sx*.15, sy*.08) then GateMenu = false moveObject(TheGate, 5000, 51.62455, -1524.62549, 0) GateStatus = true if isTimer(GateCloseTimer) then killTimer(GateCloseTimer) end GateCloseTimer = setTimer(function() triggerEvent("Reset", localPlayer) end, 5000, 1) -- This is the delay before the gate closes end end end) addEvent("Reset", true) addEventHandler("Reset", root, function() if (GateStatus) then moveObject(TheGate, 5000, 51.62455, -1524.62549, 5.05399) GateStatus = false end end )
  9. /plant cmd is called multiple times and multiple stones being created this could cause some stones to not be destroyed because the markers are overlapping add a delay
  10. thePlayer is nil and not defined, you’ve wrote “theplayer” function Kamshodan(thePlayer) setTimer(function() if isElement(thePlayer) then -- check if thePlayer is valid setPedStat(thePlayer, 23, getPedStat(thePlayer, 23) - 2) setPedStat(thePlayer, 22, getPedStat(thePlayer, 22) + 2) end end, 3600, 1, thePlayer) end addEventHandler('onResourceStart', getResourceRootElement(getThisResource()), Kamshodan)
  11. Pretty sure it just creates an illusion of a quicker firing speed and not actually increasing the fire rate you can make a rapid fire script you'd want to listen to the onClientPlayerWeaponFire event, and when it's fired, set a timer that triggers multiple shootings
  12. MenuPoints table values are hardcoded ur using absolute positioning use relative positioning instead
  13. the logic for creating and destroying markers and blips is :Oed up status2 = false -- Initialize status2 function unit1() local playerskin = getElementModel(source) local x, y, z = getElementPosition(source) if validSkin[playerskin] then if not status2 then statusB2 = createBlipAttachedTo(source, 0, 4, 0, 0, 255) statusMarker1 = createMarker(x, y, z, "checkpoint", 4, 255, 0, 0) attachElements(statusMarker1, source) if not validSkin[playerskin] then setElementAlpha(statusMarker1,0) -- Hide the marker else setElementAlpha(statusMarker1,255) -- Show the marker end outputChatBox("#898c8f<<#2c469cNeXoN Roleplay#898c8f>> #0f5720Sikeressen megváltoztatad az egységed állapotát: #ffffff||Üldözés||", source, 255, 255, 255, true) status2 = true else outputChatBox("#898c8f<<#2c469cNeXoN Roleplay#898c8f>> #0f5720Már ez az egységed állapota.", source, 255, 255, 255, true) end end end addEvent("Button2", true) addEventHandler("Button2", root, unit1)
  14. validSkin table is not defined, there are some variables that are not assigned globally and it will give you nil errors and checkSkin is not checking the specific player with the current akin it simply sets the alpha value for ‘statusMarker1’ depending on the skin try changing the function to this and defining those variables local validSkin = {[1] = true, [2] = true} -- replace 1 and 2 with valid skin IDs local status2 = false local statusMarker1 = nil local statusMarker = nil local statusB1 = nil function checkSkin(oldSkin, newSkin) local playerskin = newSkin if (validSkin[playerskin]) then if source == getAttachedTo(statusMarker1) then setElementAlpha(statusMarker1, 255) end else if source == getAttachedTo(statusMarker1) then setElementAlpha(statusMarker1, 0) end end end addEventHandler("onPlayerModelChange", root, checkSkin)
×
×
  • Create New...