Jump to content

P[ow]er

Members
  • Posts

    28
  • Joined

  • Last visited

  • Days Won

    2

P[ow]er last won the day on May 26 2024

P[ow]er had the most liked content!

1 Follower

About P[ow]er

  • Birthday 10/03/2000

Details

  • Gang
    Bpb*>
  • Location
    Canada
  • Occupation
    Walmart
  • Interests
    Computers

Recent Profile Visitors

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

P[ow]er's Achievements

Advanced Member

Advanced Member (8/54)

6

Reputation

  1. GUIEditor = { checkbox = {}, label = {}, timer = nil } local f1State = false local guiVisible = false local deathmatchDisabled = false addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.label[1] = guiCreateLabel(341, 118, 130, 14, "Disable deathmatch", false) GUIEditor.checkbox[1] = guiCreateCheckBox(325, 117, 17, 17, "", false, false) guiSetVisible(GUIEditor.label[1], false) guiSetVisible(GUIEditor.checkbox[1], false) addEventHandler("onClientGUIClick", GUIEditor.checkbox[1], checkBox, false) end ) function checkBox() deathmatchDisabled = guiCheckBoxGetSelected(GUIEditor.checkbox[1]) local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle and getVehicleController(vehicle) == localPlayer then local model = getElementModel(vehicle) if model == 520 or model == 425 or model == 432 or model == 476 then toggleControl("vehicle_fire", not deathmatchDisabled) end end end addEventHandler("onClientVehicleEnter", root, function(thePed, seat) if thePed == localPlayer and seat == 0 then local model = getElementModel(source) if model == 520 or model == 425 or model == 432 or model == 476 then toggleControl("vehicle_fire", not deathmatchDisabled) end end end) addEventHandler("onClientVehicleExit", root, function(thePed, seat) if thePed == localPlayer and seat == 0 then toggleControl("vehicle_fire", true) end end)
  2. function onClientResourceStart() map = Map.new():init() map:setBounds(x*30, y*30, x*1306, y*708) map:setAlpha(200) radar = Map.new():init() radar:setBounds(x*20, y*560, x*281, y*193) radar:setStyle(2) radar:setAlpha(200) radar:setBlipSize(x*24) radar:setVisible(true) -- Variables to track mouse movement mouseDown = false lastX, lastY = 0, 0 map.Switch = function() local wasVisible = map:isVisible() map:setVisible(not wasVisible) radar:setVisible(not wasVisible) showChat(not wasVisible) -- Only show cursor and bind keys when map is visible if not wasVisible then showCursor(true) addEventHandler("onClientCursorMove", root, handleMouseMovement) addEventHandler("onClientMouseWheel", root, handleMouseWheel) addEventHandler("onClientClick", root, handleMouseClick) bindKey("mouse_wheel_up", "down", function() zoomMap("in") end) bindKey("mouse_wheel_down", "down", function() zoomMap("out") end) else showCursor(false) removeEventHandler("onClientCursorMove", root, handleMouseMovement) removeEventHandler("onClientMouseWheel", root, handleMouseWheel) removeEventHandler("onClientClick", root, handleMouseClick) unbindKey("mouse_wheel_up", "down") unbindKey("mouse_wheel_down", "down") end end bindKey('F11', 'down', map.Switch) setPlayerHudComponentVisible("radar", false) toggleControl("radar", false) end -- Function to handle mouse clicks for dragging function handleMouseClick(button, state) if map:isVisible() and button == "left" then if state == "down" then mouseDown = true local x, y = getCursorPosition() lastX, lastY = x, y else mouseDown = false end end end -- Function to handle mouse movement for dragging the map function handleMouseMovement(_, _, x, y) if map:isVisible() and mouseDown then local currentX, currentY = x, y local deltaX, deltaY = currentX - lastX, currentY - lastY -- Move map based on mouse movement local mapX, mapY, mapW, mapH = map:getBounds() -- Adjust movement sensitivity as needed local moveSpeed = 1.5 map:setBounds(mapX - deltaX * moveSpeed, mapY - deltaY * moveSpeed, mapW, mapH) lastX, lastY = currentX, currentY end end -- Function to handle mouse wheel for zooming function handleMouseWheel(direction) if map:isVisible() then zoomMap(direction > 0 and "in" or "out") end end -- Centralized zoom function function zoomMap(direction) if not map:isVisible() then return end local x, y, width, height = map:getBounds() local zoomFactor = 0.1 -- Adjust for faster/slower zooming if direction == "in" then -- Zoom in: decrease size, adjust position to zoom toward center local newWidth = width * (1 - zoomFactor) local newHeight = height * (1 - zoomFactor) local newX = x + (width - newWidth) / 2 local newY = y + (height - newHeight) / 2 map:setBounds(newX, newY, newWidth, newHeight) else -- Zoom out: increase size, adjust position to zoom from center local newWidth = width * (1 + zoomFactor) local newHeight = height * (1 + zoomFactor) local newX = x - (newWidth - width) / 2 local newY = y - (newHeight - height) / 2 map:setBounds(newX, newY, newWidth, newHeight) end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart) function onClientResourceStop() setPlayerHudComponentVisible("radar", true) toggleControl("radar", true) -- Clean up any remaining event handlers if map:isVisible() then removeEventHandler("onClientCursorMove", root, handleMouseMovement) removeEventHandler("onClientMouseWheel", root, handleMouseWheel) removeEventHandler("onClientClick", root, handleMouseClick) end end addEventHandler("onClientResourceStop", resourceRoot, onClientResourceStop)
  3. local minFOV, defaultFOV, maxFOV = 50, 70, 120 local currentFOV = defaultFOV addEventHandler('onClientKey', root, function(button, press) if press and getControlState("aim_weapon") then local change = (button == 'mouse_wheel_up' and 5) or (button == 'mouse_wheel_down' and -5) or 0 if change ~= 0 then currentFOV = math.clamp(currentFOV + change, minFOV, maxFOV) end end end) addEventHandler("onClientRender", root, function() setCameraFieldOfView("player", currentFOV) end)
  4. local sx, sy = guiGetScreenSize() local sw, sh = sx / 1680, sy / 1050 local panelVisible = false loadstring(exports.dxlibrary:dxGetLibrary())() -- Carregar a fonte Inter-Medium.ttf local fontLoaded = dxCreateFont('assets/fonts/Inter-Medium.ttf', 12, true) if not fontLoaded then outputDebugString("Falha ao carregar a fonte Inter-Medium.ttf") else outputDebugString("Fonte Inter-Medium.ttf carregada com sucesso") end function showPanel() outputDebugString("showPanel() chamado") if not panelVisible then dxEditor = {} dxEditor['dxWindow'] = {} dxEditor['dxGridList'] = {} dxEditor['dxEdit'] = {} dxEditor['dxButton'] = {} dxEditor['dxLabel'] = {} dxEditor['dxWindow'][1] = dxWindow(136 * sw, 271 * sh, 584 * sw, 256 * sh, 'Painel de Vendas', false, 7, nil, -15856105, -1, -15856105) dxEditor['dxGridList'][1] = dxGridList(160 * sw, 315 * sh, 154 * sw, 179 * sh, dxEditor['dxWindow'][1], -15461346, -1, -12177770, -14474451, nil, nil, nil) dxEditor['dxEdit'][1] = dxEdit(361 * sw, 346 * sh, 323 * sw, 24 * sh, '', dxEditor['dxWindow'][1], false, -1, nil, -13426320, -12177770) dxEditor['dxEdit'][2] = dxEdit(396 * sw, 421 * sh, 96 * sw, 24 * sh, '', dxEditor['dxWindow'][1], false, -1, nil, -13426320, -12177770) dxEditor['dxButton'][1] = dxButton(438 * sw, 475 * sh, 76 * sw, 25 * sh, 'ENVIAR', dxEditor['dxWindow'][1], 2, -12177770, -1, -12506991) dxEditor['dxButton'][2] = dxButton(539 * sw, 475 * sh, 76 * sw, 25 * sh, 'FECHAR', dxEditor['dxWindow'][1], 2, -12177770, -1, -12506991) -- Alterar a fonte dos labels para Inter-Medium dxEditor['dxLabel'][1] = dxLabel(488 * sw, 323 * sh, 78 * sw, 20 * sh, 'DESCRIÇÃO', dxEditor['dxWindow'][1], 'center', 'top', nil, -1, -1, nil) if fontLoaded then dxSetFont(dxEditor['dxLabel'][1], fontLoaded) end dxEditor['dxLabel'][2] = dxLabel(421 * sw, 397 * sh, 47 * sw, 20 * sh, 'VALOR', dxEditor['dxWindow'][1], 'center', 'top', nil, -1, -1, nil) if fontLoaded then dxSetFont(dxEditor['dxLabel'][2], fontLoaded) end dxEditor['dxLabel'][3] = dxLabel(576 * sw, 397 * sh, 67 * sw, 20 * sh, 'CONTATO', dxEditor['dxWindow'][1], 'center', 'top', nil, -1, -1, nil) if fontLoaded then dxSetFont(dxEditor['dxLabel'][3], fontLoaded) end dxEditor['dxEdit'][3] = dxEdit(560 * sw, 421 * sh, 96 * sw, 24 * sh, '', dxEditor['dxWindow'][1], false, -1, nil, -13426320, -12177770) dxEditor['dxLabel'][4] = dxLabel(201 * sw, 314 * sh, 78 * sw, 20 * sh, 'categorias', dxEditor['dxWindow'][1], 'center', 'top', nil, -1, -1, nil) if fontLoaded then dxSetFont(dxEditor['dxLabel'][4], fontLoaded) end panelVisible = true showCursor(true) end end function hidePanel() if panelVisible then -- Fechar todos os elementos do painel aqui -- Exemplo: destroyElement(dxEditor['dxWindow'][1]) panelVisible = false showCursor(false) end end function onPlayerCommand(cmd) outputDebugString("Comando recebido: " .. cmd) if cmd == "anunciar" then showPanel() end end addCommandHandler("anunciar", onPlayerCommand)
  5. local scx, scy = guiGetScreenSize() local myObject, myElement, guiWindow = nil, nil, nil local myRotation = {180, 180, 0} function showPlayerSkin() local x1, y1, z1 = getCameraMatrix() myElement = createPed(getElementModel(getLocalPlayer()), x1, y1, z1) myObject = exports.object_preview:createObjectPreview(myElement, 0, 0, 0, 1, 1, 1, 1, true, true, false) guiWindow = guiCreateWindow((scx / 2) - 100, (scy / 2) - 100, 200, 200, "Test area", false, false) guiSetAlpha(guiWindow, 0.05) end function updatePlayerSkin() if isElement(myElement) then destroyElement(myElement) end local x1, y1, z1 = getCameraMatrix() myElement = createPed(getElementModel(getLocalPlayer()), x1, y1, z1) exports.object_preview:setObjectElement(myObject, myElement) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), showPlayerSkin) addEventHandler("onClientElementModelChange", root, function(changedElement) if changedElement == getLocalPlayer() then updatePlayerSkin() end end) addEventHandler("onClientVehicleEnter", root, function(vehicle, seat) if source == getLocalPlayer() and seat == 0 then if isElement(myElement) then destroyElement(myElement) end local x1, y1, z1 = getCameraMatrix() myElement = createVehicle(getElementModel(vehicle), x1, y1, z1) exports.object_preview:setObjectElement(myObject, myElement) end end) addEventHandler("onClientVehicleExit", root, function(vehicle, seat) if source == getLocalPlayer() and seat == 0 then updatePlayerSkin() end end) addEventHandler("onClientPreRender", root, function() if not myElement or not myObject then return end local projPosX, projPosY = guiGetPosition(guiWindow, true) local projSizeX, projSizeY = guiGetSize(guiWindow, true) exports.object_preview:setRotation(myObject, myRotation[1], myRotation[2], myRotation[3]) exports.object_preview:setProjection(myObject, projPosX, projPosY, projSizeX, projSizeY, true, true) end, true, "high") addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), function() exports.object_preview:destroyObjectPreview(myObject) end)
  6. function ItemMove() for i, slot in ipairs(slots) do if isMouseInPosition(sx * slot[1], sy * slot[2], sx * slot[3], sy * slot[4]) then slots[DragNDrop[2]][5], slot[5] = slot[5], slots[DragNDrop[2]][5] local itemId = slots[DragNDrop[2]][5][1] if itemId and slots[DragNDrop[2]][5][2] > items[itemId][3] then print("Stack overflow in slot", DragNDrop[2]) end DragNDrop = nil return end end slots[DragNDrop[2]][5] = DragNDrop[1] DragNDrop = nil end ddEventHandler("onClientClick", root, function(Button, State) if IsInvShow then for i, slot in ipairs(slots) do if isMouseInPosition(sx * slot[1], sy * slot[2], sx * slot[3], sy * slot[4]) then if Button == "right" and State == "down" and slot[5][1] then ClickOnItem(slot[5], i) return elseif Button == "left" then if not slot[5][1] then if State == "down" then WindowMove = {getCursorPosition() - InvPos[1], getCursorPosition() - InvPos[2]} else WindowMove = {false, false} end else if State == "down" then DragNDrop = {slot[5], i} slot[5] = {false} elseif DragNDrop then ItemMove() end end end return end end end end)
  7. function sendTurfPayout() local playerJobs = {} -- getting all police for i, player in ipairs(getElementsByType('player')) do local job = exports.NGJobs:getPlayerJob(player) if (job == 'Police Officer') then if (playerJobs[player] == nil) then playerJobs[player] = 0 end playerJobs[player] = playerJobs[player] + 1 end end -- pay the players for player, count in pairs(playerJobs) do local cash = count * tonumber(get("*PAYOUT_CASH")) givePlayerMoney(player, cash) exports.NGMessages:sendClientMessage("Police: Here is $" .. tostring(cash) .. " payout.", player, 0, 255, 0) end end -- set the timer local payoutTimeStr = get("*PAYOUT_TIME") if payoutTimeStr ~= false and type(payoutTimeStr) == "string" then local payoutTimeInt= tonumber(payoutTimeStr) if type(payoutTimeInt) == "number" and payoutTimeInt > 0 then setTimer(sendTurfPayout,payoutInt*60*1000,0) else outputDebugString("Warning! Invalid *PAYOUT_TIME set in meta file",2); end else outputDebugString("warning No *PAYOUT_TIME parameter foundin meta file",2); end try this please
  8. function onPlayerLogin() local playerID = getPlayerID(source) local currentDate = getDateString() -- get the current date in string format -- save the login information to the database dbExec("INSERT INTO player_logins (player_id, last_login_date) VALUES (?, ?)", playerID, currentDate) end function onCommandLastLogin(player, cmd, targetPlayerID) if not targetPlayerID then outputChatBox("Usage: /lastlogin <playerID>") return end -- retrieve the last login date from the database local result = dbQuery("SELECT last_login_date FROM player_logins WHERE player_id=?", targetPlayerID) local row = dbPoll(result, -1)[1] if not row then outputChatBox("Player not found or has not logged in before.") else local lastLoginDate = row.last_login_date outputChatBox("Player "..targetPlayerID.." last logged in on "..lastLoginDate) end end
  9. function onVehicleStartEnter(player, seat, jacked) local vehicle = getPedOccupiedVehicle(player) if vehicle and getElementModel(vehicle) == 480 then cancelEvent() outputChatBox("You cannot enter this vehicle.") end end addEventHandler("onVehicleStartEnter", getRootElement(), onVehicleStartEnter)
  10. local func_str = "function(player) return getPlayerName(player) == owner end" local loadstringed = loadstring("local owner = 'owner'; return function(player) "..func_str.." end") local myFunc = loadstringed() -- Call the function with a parameter local testPlayer = getPlayerFromName("player1") local result = myFunc(testPlayer) print(result) -- true --- local func_str = "function(player) return getPlayerName(player) == 'owner' end" local loadstringed = loadstring("return "..func_str) local success, myFunc = pcall(loadstringed) -- Call the function with a parameter local testPlayer = getPlayerFromName("player1") local success2, isOwner = pcall(myFunc, testPlayer) print(success2, isOwner) -- true false
  11. Here is an example of how you could achieve this: Detecting the shift key press: function onClientKey ( button, press ) if ( button == "lshift" and press ) then -- Change the car handling end end addEventHandler ( "onClientKey", root, onClientKey ) Changing the car handling: function changeHandling () local handlingTable = getVehicleHandling ( getPedOccupiedVehicle ( localPlayer ) ) -- Modify the handling table to make the car more suitable for drifting setVehicleHandling ( getPedOccupiedVehicle ( localPlayer ), handlingTable ) end You would need to modify the changeHandling function to adjust the handling table to make the car more suitable for drifting. You could increase the car's rear-wheel grip, reduce its weight, or increase its acceleration, for example. You can find more information on MTA scripting in the official MTA wiki: https://wiki.multitheftauto.com/
  12. function sendTurfPayout() local playerJobs = {} for i, policeOfficer in ipairs(getElementsByType('player')) do local jobName = exports.NGJobs:getPlayerJob(policeOfficer) if jobName == 'Police Officer' then local jobLevel = exports.NGJobs:getPlayerJobLevel(policeOfficer, jobName) if jobLevel and jobLevel > 0 then local payout = jobLevel * tonumber(get('*PAYOUT_CASH')) givePlayerMoney(policeOfficer, payout) exports.NGMessages:sendClientMessage(policeOfficer, 'Police: Here is $'..payout..' payout', 0, 255, 0) end end end end setTimer(sendTurfPayout, (60 * tonumber(get('*PAYOUT_TIME'))) * 1000, 0) Try it and say if it works please
  13. how can i upload files from my own website to my ftp server ? now ?
  14. hey i have a question how can i uploads maps site to my server's ftp but site isnt server's site sorry for my english...
  15. P[ow]er

    Yardım edin

    Admin panelin sağ alt tarafında anonymous diye bir tik işareti vardır ona tik atarsan banladığın, kick veya mute attığın kişilerin kimin tarafından atıldığını kimse göremez
×
×
  • Create New...