Jump to content

PresKoYT

Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

PresKoYT's Achievements

Newbie

Newbie (4/54)

0

Reputation

  1. My Pc is loud when playing MTA, my gpu or cpu are still in good temps like 30-50 degrees... Any1 knows how to fix?
  2. I got one script that when you press the pet, you start the job, but I don't know how to make it when someone presses the pet a vehicle comes up? I would be grateful if someone could help me script: local screenX, screenY = guiGetScreenSize() local pickupPos = {2466.32324, -2589.31519, 13.66070} local pickupBlip = nil local pickupMarker = nil local dropBlip = nil local dropMarker = nil local jobPed = nil local jobActive = false local Roboto = nil local dropPositions = { {1773.18201, -2050.24146, 13.56654}, --{2491.90967, -2640.29883, 13.64844} } local _destroyElement = destroyElement addEventHandler("onClientResourceStart", resourceRoot, function() jobPed = createPed(100, 2449.72021, -2591.47607, 13.65694, 270) setElementFrozen(jobPed, true) end) function startJob() outputChatBox("You started the job", 0, 255, 0) destroyElement(pickupMarker) pickupMarker = createMarker(pickupPos[1], pickupPos[2], pickupPos[3] - 3.7, "cylinder", 4, 255, 162, 0, 200) destroyElement(pickupBlip) pickupBlip = createBlip(pickupPos[1], pickupPos[2], pickupPos[3] - 3.7, 0, 2, 255, 162, 0) Roboto = dxCreateFont("Roboto.ttf", 12) addEventHandler("onClientRender", root, renderMarkerInfo) addEventHandler("onClientMarkerHit", root, markerHandler) end function stopJob() outputChatBox("You finished the job", 0, 255, 0) removeEventHandler("onClientRender", root, renderMarkerInfo) removeEventHandler("onClientMarkerHit", root, markerHandler) destroyElement(pickupMarker) destroyElement(pickupBlip) destroyElement(dropMarker) destroyElement(dropBlip) destroyElement(Roboto) end addEventHandler("onClientClick", root, function(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) if button == "left" and state == "down" then if clickedElement == jobPed then local x, y, z = getElementPosition(clickedElement) local distance = getDistanceBetweenPoints3D(x, y, z, getElementPosition(localPlayer)) if distance < 5 then if jobActive then stopJob() jobActive = false else startJob() jobActive = true end end end end end) local startAnim = false function markerHandler(player, matchDim) if player == localPlayer and matchDim then if source == pickupMarker then local vehicle = getPedOccupiedVehicle(localPlayer) if isElement(vehicle) then tempContainer = createObject(2935, 0, 0, 0) setObjectScale(tempContainer, 0.925) attachElements(tempContainer, vehicle, 0, -1.4, 1.1) setElementAlpha(tempContainer, 0) toggleAllControls(false) setElementFrozen(vehicle, true) startAnim = true initAnimation("bgAlpha", true, {0, 0, 0}, {1, 0, 0}, 1000, "Linear", function() triggerServerEvent("attachContainerToVehicle", localPlayer) initAnimation("bgAlpha", true, {1, 0, 0}, {0, 0, 0}, 1000, "Linear", function() toggleAllControls(true) startAnim = false setElementFrozen(vehicle, false) end) end) end elseif source == dropMarker then local vehicle = getPedOccupiedVehicle(localPlayer) if isElement(vehicle) then setElementFrozen(vehicle, true) startAnim = true initAnimation("bgAlpha", true, {0, 0, 0}, {1, 0, 0}, 1000, "Linear", function() triggerServerEvent("detachContainerFromVehicle", localPlayer) initAnimation("bgAlpha", true, {1, 0, 0}, {0, 0, 0}, 1000, "Linear", function() toggleAllControls(true) startAnim = false setElementFrozen(vehicle, false) end) end) destroyElement(dropMarker) destroyElement(dropBlip) end end end end function generateDropPoint() destroyElement(dropMarker) destroyElement(dropBlip) local rand = math.random(1, #dropPositions) local x, y, z = unpack(dropPositions[rand]) dropBlip = createBlip(x, y, z - 3.7, 0, 2, 50, 168, 82) dropMarker = createMarker(x, y, z - 3.7, "cylinder", 4, 50, 168, 82, 200) end addEvent("generateDropPoint", true) addEventHandler("generateDropPoint", root, generateDropPoint) function renderMarkerInfo() if isElement(pickupMarker) then local mX, mY, mZ = getElementPosition(pickupMarker) local distance = getDistanceBetweenPoints3D(mX, mY, mZ, getElementPosition(localPlayer)) local maxDistance = 30 if distance < maxDistance then local scale = 1 - distance / maxDistance local w, h = 210, 50 local x, y = getScreenFromWorldPosition(mX, mY, mZ + 4) if x and y then w, h = w * scale, h * scale x, y = x - w / 2, y - h / 2 dxDrawBorderedRectangle(x, y, w, h, tocolor(0, 0, 0, 150), tocolor(0, 0, 0, 200), 2) dxDrawText("Container pickup point", x, y, x + w, y + h, tocolor(255, 255, 255), 1 * scale, Roboto, "center", "center") end end end if isElement(dropMarker) then local mX, mY, mZ = getElementPosition(dropMarker) local distance = getDistanceBetweenPoints3D(mX, mY, mZ, getElementPosition(localPlayer)) local maxDistance = 30 if distance < maxDistance then local scale = 1 - distance / maxDistance local w, h = 210, 50 local x, y = getScreenFromWorldPosition(mX, mY, mZ + 4) if x and y then w, h = w * scale, h * scale x, y = x - w / 2, y - h / 2 dxDrawBorderedRectangle(x, y, w, h, tocolor(0, 0, 0, 150), tocolor(0, 0, 0, 200), 2) dxDrawText("Container drop off point", x, y, x + w, y + h, tocolor(255, 255, 255), 1 * scale, Roboto, "center", "center") end end end end function destroyElement(element) if isElement(element) then return _destroyElement(element) end end function dxDrawBorderedRectangle( x, y, width, height, color1, color2, _width, postGUI ) local _width = _width or 1 dxDrawRectangle ( x+1, y+1, width-1, height-1, color1, postGUI ) dxDrawLine ( x, y, x+width, y, color2, _width, postGUI ) -- Top dxDrawLine ( x, y, x, y+height, color2, _width, postGUI ) -- Left dxDrawLine ( x, y+height, x+width, y+height, color2, _width, postGUI ) -- Bottom dxDrawLine ( x+width, y, x+width, y+height, color2, _width, postGUI ) -- Right end --------------------------------------------------------------------------------------------------------------------------------------------------- local animations = {} addEventHandler("onClientRender", root, function() for k, v in pairs(animations) do if not v.completed then local currentTick = getTickCount() local elapsedTick = currentTick - v.startTick local duration = v.endTick - v.startTick local progress = elapsedTick / duration v.currentValue[1], v.currentValue[2], v.currentValue[3] = interpolateBetween( v.startValue[1], v.startValue[2], v.startValue[3], v.endValue[1], v.endValue[2], v.endValue[3], progress, v.easingType or "Linear" ) if progress >= 1 then v.completed = true if v.completeFunction then v.completeFunction(unpack(v.functionArgs)) end end end end if startAnim then dxDrawRectangle(0, 0, screenX, screenY, tocolor(0, 0, 0, 255 * getAnimationValue("bgAlpha")[1])) end end) function initAnimation(id, storeVal, startVal, endVal, time, easing, compFunction, args) if not storeVal then animations[id] = {} end if not animations[id] then animations[id] = {} end animations[id].startValue = startVal animations[id].endValue = endVal animations[id].startTick = getTickCount() animations[id].endTick = animations[id].startTick + (time or 3000) animations[id].easingType = easing animations[id].completeFunction = compFunction animations[id].functionArgs = args or {} animations[id].currentValue = storeVal and animations[id].currentValue or {0, 0, 0} animations[id].completed = false end function getAnimationValue(id) if animations[id] then return animations[id].currentValue end return {0, 0, 0} end function setAnimationValue(id, val) animations[id].currentValue = val end
  3. Hello, I am searching for a inventory script and 24/7 shops all around Los Santos. The shops should include: -Phone System (Just /call /msg commands no gui needed) -GPS System -Cigarettes with lighter -Watch to view the current time -Spraycan -Sim card that is allied with the phone Those all should be stored in the inventory, the inventory also should have the feature to drop and give items to other players. I would pay for it, Just reply on the thread or msg me on discord: presko#3533
  4. Hello, so I use the normal MTA voice chat and I want to make it people to hear it from maximum 50 meters, so local. It's for RP and when I speak the whole server hears it. Can someone help me to get it local?
  5. Hello y'all, Ive tried to script a police system for myself but I failed often and I want to look for a other system. I would also pay for a police system, that includes commands and functions like: -Arresting and prison function -Police interior -Loadout with skin, weapon and car options. -Radio (/r) -Ranks ( includes promotions and demotions) -Faction OOC chat (/f) As I said I am PAYING for it, so please don't say im begging or something for it. If someone got something just reply to the thread or Dm me on Discord: preskoo#3533
  6. Hello, I am searching for roleplay commands like /do /me /b etc. Can someone help me please, or give me a script?
  7. Hello, I am making a RP server and I have a script, that disables the global chat and only shows the chat from a radios. My question is, where do I have to put this script to work? I am a beginner in scripting so please dont judge me :D The script: local chatRadius = 20 --units -- define a handler that will distribute the message to all nearby players function sendMessageToNearbyPlayers(message, messageType) -- we will only send normal chat messages, action and team types will be ignored if messageType == 0 then -- get the chatting player's position local posX1, posY1, posZ1 = getElementPosition(source) -- loop through all player and check distance for id, player in ipairs(getElementsByType("player")) do local posX2, posY2, posZ2 = getElementPosition(player) if getDistanceBetweenPoints3D(posX1, posY1, posZ1, posX2, posY2, posZ2) <= chatRadius then outputChatBox(message, player) end end end -- block the original message by cancelling this event cancelEvent() end -- attach our new chat handler to onPlayerChat addEventHandler( "onPlayerChat", getRootElement(), sendMessageToNearbyPlayers )
×
×
  • Create New...