Jump to content

Search the Community

Showing results for tags 'mta'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. Lo siento por el Spam chicos. Pero... Me alegra anunciar al apertura de !!ESPAÑA RP!! ¿Tienes ganas de vivir la vida a tu gusto pero tu ordenador no llega a los recursos necesarios o simplemente te gusta mas la comunidad de GTA-SA? Únete ya a España RP. Un server de Roleplay con mapeos INCREIBLES y una buena comunidad de rol. Únete ya y empieza a rolear en la ciudad de Palomino. https://discord.gg/xvsskaa ;-; IP del servidor: mtasa://54.39.115.96:22023
  2. I started scripting with GUI / dxDraw and would like to do some panning or alpha animation. And the question is how this animate works, I know it is shown on the MTA wiki, but I don't quite understand how, If someone would explain it to me, I would be grateful. By the way, I am sending the function I am talking about ... https://wiki.multitheftauto.com/wiki/Animate
  3. My goal is simple, after using GetPedCollisionTarget, I want it to return 3 numbers that correspond to the coordinates of the target that has collision detection, but for this function to return something, you must first aim the weapon. And here is the problem because when the player is aiming, the crosshair is somewhere close but not in the center of the center, and I want to get the coordinates of the target in the center, not somewhere nearby. And here comes the question, is it possible to make GetPedCollisionTarget work but without aiming the weapon? PLEASE HELP
  4. ola pessoal, estou procurando um script que quando dou /melimpa ou tanto faz o cmd ele limpa as acl e grupos atribuidos a essa conta, não sei quais funções tenho que usar, pfv me ajudem.
  5. So if i using function "setCameraMatrix" then i can't rotation it. For example i want set camera in one point and turn it 90 degrees in left but i can't pls help! function DropCamera(player, command) local x, y, z = getElementPosition(player) setCameraMatrix(player, x, y, z+1.5, 0, 0, 90, 0, 0) end addCommandHandler("setcamera", DropCamera)
  6. Witam , Nazywam się Szymon w grach nazywam się Tib0 od pewnego czasu mam chęć stworzyć serwer Multi thef auto SA. Ppdchodzacy jak najbardziej pod realne życie. Staram się zebrać dobrą, dużą i mocną ekipe do zrobienia projektu. Oczywiscie kazdy znajdzie miejsce dla siebie. Osoby które będą chciały zostać przy projekcie serdecznie zapraszam. Ale nie widze serwera bez zamówień wiec osoby które znają się na mapowaniu, skryptowaniu w Lua, moddelingu pojazdów lub postaci. Jezeli praca zostanie solidnie wykonana na pewno te osoby zostaną nagrodzone. Nie przedłużając przejdę po prostu do listy osób ktore sa niezbedne w projekcie. Osoby których szukam: Administracji - osoby odpowiedzialne, pomyslowe, zaangażowane, umiejętność rozmowybi rozwiazywania konfliktów. Skrypterów - znajacych się na pisaniu skryptów oraz modyfikacji Maperów - pomysłowych znajacych sie na robcie Modelerów - znajacych się na modyfikacji pojazdów budowaniu ich od nowa ewentualnie do edycji postaci Oczywiscie zalezy mi na osobach które znają sie na rzeczy ! Liczba osób jest nienograniczona kazda jedna osoba która ma chęci ci współpracy jest mile widziana. Dziękuje za zwrócenie uwagi na ten post jeśli ktoś będzie chętny proszę pisać na e-mail [email protected] . W temacie jak będziesz pisać wiadomość wpisz o jaka posadę się starasz. Pozdrawiam i życzę miłego dnia. Tib0
  7. Hello MTA team i've expected an error while trying to run mta on linux . this is the screenshot of the error : https://cdn.discordapp.com/attachments/623268793803603999/757220417923448862/unknown.png and thank you in advance :)
  8. Bom Dia, Gostaria que alguém pudesse explicar como instalar o plugin MTA LUA, para o Notepad++, Estava lendo o Topico, mas não consegui entender muito bem e nem achar o Download!, Desde ja Obrigado!
  9. Ola pessoal, sou novo no blog mas estou fazendo um server freeroam e queria uma ajuda para colocar um limite de contas registradas por serial ja tentei algumas funções mas ate agora nada, pfv me ajudem preciso muito dessa função funcionando no painel de login codigo server: addEvent("onRequestLogin",true) addEventHandler("onRequestLogin",resourceRoot, function(username,password,checksave) if not (username == "") then if not (password == "") then local account = getAccount ( username, password ) if ( account ~= false ) then logIn(client,account,password) triggerClientEvent (client,"onClientPlayerLogin",resourceRoot) if checksave and checksave == "1" then triggerClientEvent(client,"useLoginFile",resourceRoot,"set",username,password) else triggerClientEvent(client,"useLoginFile",resourceRoot,"remove",username,password) end else triggerClientEvent(client,"setNotification",resourceRoot,"Errado Nome De Usuário Ou Senha!") end else triggerClientEvent(client,"setNotification",resourceRoot,"Por Favor, Digite Sua Senha!") end else triggerClientEvent(client,"setNotification",resourceRoot,"Digite Seu Nome De Usuário!") end end ) addEvent("onRequestRegister",true) addEventHandler("onRequestRegister",resourceRoot, function(username,password,repassword,serial) if #getAccountsBySerial(serial) == 2 then triggerClientEvent(client,"setNotification",resourceRoot,"Voce Ja Tem 2 Contas Registradas Nesse Serial!") else addAccount() if not (username == "") then if not (password == "") then if not (repassword == "") then if password == repassword then local account = getAccount (username) if (account == false) then local accountAdded = addAccount(tostring(username),tostring(password)) if (accountAdded) then logIn(client,accountAdded,password) triggerClientEvent(client,"onClientPlayerLogin",resourceRoot) triggerClientEvent(client,"useLoginFile",resourceRoot,"set",username,password) outputChatBox("*Logado Com Sucesso! ( Nome de Usuário: #ee8a11" .. username .. " #FFFFFF| Senha: #ee8a11" .. password .. "#FFFFFF )",client,255,255,255,true) else triggerClientEvent(client,"setNotification",resourceRoot,"Por Favor, Escolha Uma Conta E/Ou Senha Diferente") end else triggerClientEvent(client,"setNotification",resourceRoot,"Uma Conta Com Esse Nome De Usuario Ja Existe!") end else triggerClientEvent(client,"setNotification",resourceRoot,"As Senhas Não Coincidem!") end else triggerClientEvent(client,"setNotification",resourceRoot,"Por Favor, Confirme Sua Senha!") end else triggerClientEvent(client,"setNotification",resourceRoot,"Por Favor, Insira Uma Senha Para Criar Sua Nova Conta!") end else triggerClientEvent(client,"setNotification",resourceRoot,"Por Favor, Insira Um Nome De Usuario Para Criar Sua Conta!") end end end ) Erro dado no console: https://imgur.com/a/JlBwzt9 PFV ME AJUDEM ESTOU CRIANDO UM SERVER DE FREEROAM!
  10. Ola pessoal, então eu ativei um radar aki que tenho configurado para meu servidor, mas esta aparecendo o radar do mta nativo ( O do GTA:SA) e o Radar modificado que eu coloquei alguem me ajuda por favor pra deixar somente o modificado ligado. Link Erro: https://prnt.sc/udxm62
  11. A simple script of dressable characters and deformable faces. You can move every vertex of the head with a simple displacement shader. The script is in test state right now, I'll create a new editor later. Hope you like it.
  12. ola pessoal, andei pesquisando e tentando fazer um script que quando eu der /stats ele aparecera as mortes as kills e o KD(ratio) mais por algum motivo n sei pq esta dando errado olhem os codigos e pfv me ajudem com isso. Codigo server: function chat( sourcePlayer, commandName, targetPlayerName ) if ( thePlayer ) then local kills = getPlayerKills( getLocalPlayer() ) local deaths = getPlayerDeaths( getLocalPlayer() ) outputChatBox ( "O Player"..getPlayerName(player).."Tem"..kills.."/"..deaths"", root, 255, 255, 255, true ) end end addCommandHandler("stats", chat) Codigo Client: function kills() setElementData ( getLocalPlayer ( ), "kills", 0 ) end addEventHandler ( "onClientResourceStart", resourceRoot, kills ) o KD(ratio) n testei por enquanto mais se vcs quiserem ja colocar pra me ajudar eu ficaria muito grato OBS: Nao deu nenhum erro mais tambem n apareceu no chat quando eu digitava /stats
  13. Ola pessoal, estou procurando um script de que qundo eu der /stats tanto faz o cmd ele mostrar quantas pessoas matei e quantas morri e o "kd" que eu estou, pfv se alguem me ajudar
  14. Ola pessoal meu sistema de radar esta dando o aviso de função deprecated não sei oque é isso pois sou novo no .lua, mas se alguem conseguir me explicar e me ajudar a resolver fico grato:) Codigo Erro 1: local states={ ["radar_zoom_in"]=false, ["radar_zoom_out"]=false, ["radar_move_north"]=false, ["radar_move_south"]=false, ["radar_move_east"]=false, ["radar_move_west"]=false, } local mta_getControlState = getControlState function getControlState(control) local state=states[control] if state==nil then return mta_getControlState(control) else return state end end local function handleStateChange(key,state,control) states[control]=(state=="down") end for control,state in pairs(states) do for key,states in pairs(getBoundKeys(control)) do bindKey(key,"both",handleStateChange,control) end end Codigo Erro 2: function checkMovement() -- Zoom if getControlState("radar_zoom_in") and zoom<maxZoomLimit then zoom=zoom+zoomRate if zoom>maxZoomLimit then zoom=maxZoomLimit end elseif getControlState("radar_zoom_out") and zoom>minZoomLimit then zoom=zoom-zoomRate if zoom<minZoomLimit then zoom=minZoomLimit end zoomOutRecalculate() end -- Move if getControlState("radar_move_north") then local newY=y-yOffset*zoom+(yOffset+movementSpeed)*zoom if newY<0 then yOffset=yOffset+movementSpeed end end if getControlState("radar_move_south") then local newY=y-yOffset*zoom+(yOffset-movementSpeed)*zoom if newY>(-vSize+screenH) then yOffset=yOffset-movementSpeed end end if getControlState("radar_move_west") then local newXOff=(xOffset+movementSpeed) local newX=x-xOffset*zoom+newXOff*zoom if newX<0 then xOffset=xOffset+movementSpeed end end if getControlState("radar_move_east") then local newX=x-xOffset*zoom+(xOffset-movementSpeed)*zoom if newX>(-hSize+screenW) then xOffset=xOffset-movementSpeed end end end addEvent("onClientPlayerMapHide") addEvent("onClientPlayerMapShow") Erro: https://prnt.sc/uca2gd essas 2 funções esta dando deprecated pfv alguem me ajude.
  15. eu to dois anos parado e não lembro como eu deleto uma conta e o id dele, não sei se é pelo filezilla ou pelo tcadmin. queria saber mais meus '' amigos '' que pensei que era '' amigos '' que tem servidor não fala pra mim
  16. Hello dear community. I'm doing a Error Tooltip Resource, I created an Error Client File for all the Errors from my Main Register Resource, and I tried to call that resource by Functions on the same resource, How can I call a Function from the same resource and get The Object File that I want?... This is my code - Error File (InitTooltipMessage.lua) ---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•--- ---| |--- ---| Script by "Kyonax - Pilar Perfeccionista" Synchronous member |--- ---| Github: https://github.com/Kyonax • G-Mail: [email protected] |--- ---| Code Script from Montgomery Country RP |--- ---| Resource-Script: [init] |--- ---| Name-Script: [InitTooltipMessage] |--- ---| Function-Script: Save all the posible Script Errors |--- ---| |--- ---| DEV-DATE: 31/08/2020 |--- ---| Server Script |--- ---| number: 001 |--- ---| MIT License |--- ---| |--- ---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•--- local tooltip = { error = { notDataDigit = { name = 'notDataDigit', syntax = 'NULL LABEL', message = 'El campo actual debe ser completado', description = 'El campo en donde te encuentras, es un campo de entrada, es decir necesitas ingresar información para poder continuar.', type = 'ERROR', number = '1' }, notFoundAccount={ name = 'notFoundAccount', syntax = 'NULL QUERY LOGIN', message = 'No se ha podido encontrar la cuenta en la Base de Datos.', description='Se ha recibido valor NULL al realizar la búsqueda Query del Usuario en la Base de Datos, es decir que el valor Buscado no existe en la Base de Datos.', type = 'ERROR', number = '2' }, notEqual = { name = 'notEqual', syntax = 'NOT EQUAL LABEL', message = 'Los datos ingresados no son iguales.', description = 'Se ha obtenido un ERROR de similitud a la hora de comparar dos valores que deben ser exactamente iguales.', type = 'ERROR', number = '3' } incorrectInformation ={ name = 'incorrectInformation', syntax = 'NOT EQUAL QUERY', message = 'La información ingresada es incorrecta.', description = 'La comparación de el dato obtenido de la Base de Datos y el Ingresado ha devuelto un ERROR de similitud, es decir los datos ingresados no son iguales a los registrados en la base de datos.', type = 'ERROR', number = '4' }, notFoundVariables = { name = 'notFoundVariables', syntax = 'NULL INFORMATION', message = 'Las variables esenciales tienen como valor NULL.', description = 'Variables necesarias para le ejecución del código son de valor NULL, lo que indica que los valores no han sido digitadas o que han sido corrompidos.', type = 'ERROR', number = '5' }, existAccount = { name = 'existAccount', syntax = 'MULTIPLE VALUES QUERY', message = 'El usuario digitado no se encuentra disponible.', description = 'El nombre de usuario para crear la cuenta ya se encuentra registrado en la Base de Datos, lo que causa un error de multiples valores registrados.', type = 'ERROR', number = '6' }, existDiscordID = { name = 'existDiscordID', syntax = 'MULTIPLE VALUES QUERY', message = 'La ID de Discord digitada ya se encuentra en uso.', description = 'La ID de Discord se encontró en la base de datos, lo que quiere decir que otra cuenta está registrada con esta ID.', type = 'ERROR', number = '7' }, notValidPassword = { name = 'notValidPassword', syntax = 'LOW SECURITY ACCOUNT', message = 'La contraseña no es segura', description = 'Existen algunos requerimientos para acceder al Servidor, uno de ellos es tener una contraseña de más de 6 carácteres.', type = 'ERROR', number = '8' } } } local function getError(name) return tooltip.error[name] end local function getTooltip(name) return tooltip.error[name].syntax...' '...tooltip.error[name].message...' '...' ['...tooltip.error[name].type...' #' ...tooltip.error[name].number...']' end and I tried to call the getTooltip Function from another File called - RegisterBackend.lua - It's a Server Lua File local test = exports['[init]']:getTooltip('notFoundAccount').message local test2 = exports['[init]']:getError('notFoundAccount').type Both Files are on the same Resource call [Init] And this is my Meta.xml Code <!--ERROR--> <file src="src/error/InitTooltipMessage.lua" type='client'></file> <!--Exported Functions--> <export function='getError' type='client'></export> <export function='getTooltip' type='client'></export> The error that I get when I run the Code is this What I need to do? to call correctly Plss I'm Stuck in this
  17. Taksi Scripti Mta -- MTA SA Script Reappersz -- İyi oyunlar. local workMarker = createMarker(-520.324, 2582.393, 52.414, "cylinder", 1.5, 252,0,255,50)--marker createBlipAttachedTo(workMarker, 12, 2, 255,0,0, 255, 0, 1000) --blip local rightWheeledCars = { [543] = true, -- arac [558] = true, -- arac [560] = true, -- arac [562] = true, -- arac [566] = true, -- arac [587] = true, -- arac } -- ========== PANEL ========== local scx1920, scy1080 = guiGetScreenSize() local scx1920, scy1080 = guiGetScreenSize() local GUI = { window = {}, label = {}, button = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() -- BUTONLAR local screenW, screenH = guiGetScreenSize() GUI.window.start = guiCreateStaticImage((screenW - 1340)/0.5,(screenH - 768)/0.5,1250,900, "image/ui.png", false) GUI.button.startWork = guiCreateButton(680, 370, 275, 60, "İşe Başla", false, GUI.window.start) GUI.button.closeStart = guiCreateButton(680, 450, 275, 60, "İptal", false, GUI.window.start) -- BUTONLAR GUI.window.finish = guiCreateStaticImage((screenW - 1340)/0.5,(screenH - 768)/0.5,1250,900, "image/ui.png", false) GUI.button.finishWork = guiCreateButton(680, 370, 275, 60, "İşi Bitir", false, GUI.window.finish) GUI.button.closeFinish = guiCreateButton(680, 450, 275, 60, "İptal", false, GUI.window.finish) guiSetVisible(GUI.window.start, false) guiSetVisible(GUI.window.finish, false) end) --- Kanka şimdi bu scripti sparrow türkçe yapmış felan hani sitesine bakmak istersen bir çok TÜRKÇE script mevcut : https://sparrow-mta.blogspot.com addEventHandler("onClientMarkerHit", workMarker, function(player, matchingDimension) if (player == localPlayer) and (matchingDimension) then local vehicle = getPedOccupiedVehicle(localPlayer) if (not vehicle) or (getPedOccupiedVehicleSeat(localPlayer) == 0) then triggerServerEvent("openWorkWindow", resourceRoot) end end end) --[[ addEventHandler("onClientMarkerLeave", workMarker, function(player) if (player == localPlayer) then hideWorkGUI() end end) ]] local vehicleToUse = false addEvent("showStartWorkGUI", true) addEventHandler("showStartWorkGUI", resourceRoot, function(vehicle) if not isElementWithinMarker(localPlayer, workMarker) then return end if (vehicle) then if isResourceRunning("car_system") then guiSetText(GUI.label.vehicle, "Bu aracı kullana bilirsin ("..exports.car_system:getVehicleModName(vehicle)..").") else guiSetText(GUI.label.vehicle, "Bu araç taksi.") end else guiSetText(GUI.label.vehicle, "Kendi aracınız yok ise kiralık bir araç temin edilecek.") end vehicleToUse = vehicle guiSetVisible(GUI.window.start, true) showCursor(true) end) addEvent("showFinishWorkGUI",true) addEventHandler("showFinishWorkGUI", resourceRoot, function(money) if not isElementWithinMarker(localPlayer, workMarker) then return end guiSetText(GUI.label.finishText, "\n\n\n\nTaksi şöförlüğü işini bitirmeden önce, bu parayı ödemelisin "..tostring(money).." $.") guiSetVisible(GUI.window.finish, true) showCursor(true) end) addEventHandler("onClientGUIClick", resourceRoot, function() if (source == GUI.button.closeStart) or (source == GUI.button.closeFinish) then hideWorkGUI() elseif (source == GUI.button.startWork) then if (getElementDimension(localPlayer) ~= 0) or (getElementInterior(localPlayer) ~= 0) then return end if isResourceRunning("car_driving_school") and (not exports.car_driving_school:doesPlayerHaveLic(localPlayer, "car")) then exports.car_driving_school:outputNoLicenseClient("car") return end triggerServerEvent("startTaxiJob", resourceRoot, vehicleToUse) hideWorkGUI() elseif (source == GUI.button.finishWork) then triggerServerEvent("finishTaxiJob", resourceRoot) hideWorkGUI() end end) function hideWorkGUI() guiSetVisible(GUI.window.start, false) guiSetVisible(GUI.window.finish, false) showCursor(false) vehicleToUse = false end -- ========== Получение нового заказа и создание маркеров ========== addEventHandler("onClientPedDamage", resourceRoot, cancelEvent) local currentPed, currentPoint local sourceMarker, rotateMarker, jobBlip, destinationMarker addEvent("createSourceMarker", true) addEventHandler("createSourceMarker", resourceRoot, function(point, ped) removePedPickupElements() currentPoint = point currentPed = ped sourceMarker = createMarker(point[1], point[2], point[3], "cylinder", 2, 100,100,0,200) rotateMarker = createMarker(point[4], point[5], point[6], "cylinder", 30, 0,0,0,0) jobBlip = createBlipAttachedTo(sourceMarker, 56, 2, 255, 0, 0, 255, 32767, 65535) outputTaxiMessage("Yeni müşteri haritada sarı nokta ile gösterilir.") end) function removePedPickupElements() currentPed = false currentPoint = false if isElement(sourceMarker) then destroyElement(sourceMarker) end if isElement(rotateMarker) then destroyElement(rotateMarker) end if isElement(jobBlip) then destroyElement(jobBlip) end sourceMarker = false rotateMarker = false jobBlip = false end -- ========== Обновление поворота педа при подъезде машины ========== addEventHandler("onClientMarkerHit", resourceRoot, function(player, matchingDimension) if (player == localPlayer) and (source == rotateMarker) and (matchingDimension) then addEventHandlerNoWarnings("onClientRender", root, updatePedRotation) end end) addEventHandler("onClientMarkerLeave", resourceRoot, function(player, matchingDimension) if (player == localPlayer) and (source == rotateMarker) and (matchingDimension) then removeEventHandlerNoWarnings("onClientRender", root, updatePedRotation) end end) function updatePedRotation() if not isElement(currentPed) then removeEventHandlerNoWarnings("onClientRender", root, updatePedRotation) end local vehicle = getPedOccupiedVehicle(localPlayer) if (not vehicle) then return end local pedX, pedY, _ = getElementPosition(currentPed) local carX, carY, _ = getElementPosition(vehicle) setElementRotation(currentPed, 0, 0, getRotationFromVec2D(carX-pedX, carY-pedY), "default", true) end -- ========== Ожидание остановки машины при заезде на маркер ========== local pickupStopTimer, dropStopTimer addEventHandler("onClientMarkerHit", resourceRoot, function(player, matchingDimension) if (player == localPlayer) and (matchingDimension) and (source==sourceMarker or source==destinationMarker) then local _, _, mZ = getElementPosition(source) local _, _, pZ = getElementPosition(localPlayer) if (pZ-mZ < 5) and (pZ-mZ > -1) then if (source == sourceMarker) then if isTimer(pickupStopTimer) then killTimer(pickupStopTimer) end pickupStopTimer = setTimer(waitingForPickupStop, 100, 1) else if isTimer(dropStopTimer) then killTimer(dropStopTimer) end dropStopTimer = setTimer(waitingForDropStop, 100, 1) end end end end) addEventHandler("onClientMarkerLeave", resourceRoot, function(player, matchingDimension) if (player == localPlayer) and (matchingDimension) and (source==sourceMarker or source==destinationMarker) then if isTimer(pickupStopTimer) then killTimer(pickupStopTimer) end if isTimer(dropStopTimer) then killTimer(dropStopTimer) end if getPedOccupiedVehicle(localPlayer) then outputTaxiMessage("Aracı bölgede durdur.") end end end) function waitingForPickupStop() local vehicle = getPedOccupiedVehicle(localPlayer) if (not vehicle) then return end local spX, spY, spZ = getElementVelocity(vehicle) local speed = math.floor(math.sqrt(spX^2 + spY^2 + spZ^2)*180) if (speed < 5) then antiDOSsend("pedPickup", 1000, "startPedPickup", resourceRoot) else pickupStopTimer = setTimer(waitingForPickupStop, 100, 1) end end -- ========== Подход педа к машине и посадка ========== local pos = { [0] = {name = "door_lf_dummy"}, [1] = {name = "door_rf_dummy"}, [2] = {name = "door_lr_dummy"}, [3] = {name = "door_rr_dummy"}, } local animVehicle, animPed, animSeat local doorTimer, resettingDoorTimer addEvent("putPedInVehicle",true) addEventHandler("putPedInVehicle", resourceRoot, function(vehicle, ped) if not isElement(vehicle) or not isElement(ped) then return end removeEventHandlerNoWarnings("onClientRender", root, updatePedRotation) removePedPickupElements() local pedX, pedY, _ = getElementPosition(ped) animVehicle, animPed = vehicle, ped for i = 0, #pos do local offX, offY = getDoorOffset(i, getElementRotation(vehicle)) pos.x, pos.y, pos.z = getVehicleComponentPosition(vehicle, pos.name, "world") if (pos.x) then pos.x = pos.x + offX pos.y = pos.y + offY end end if pos[3].x and (getVehicleMaxPassengers(vehicle) > 1) then if getDistanceBetweenPoints2D(pedX, pedY, pos[3].x, pos[3].y) < getDistanceBetweenPoints2D(pedX, pedY, pos[2].x, pos[2].y) then animSeat = 3 else animSeat = 2 end else if (rightWheeledCars[getElementModel(vehicle)]) then animSeat = 0 else animSeat = 1 end end setPedAnalogControlState(ped, "forwards", 0.5) if isTimer(doorTimer) then killTimer(doorTimer) end doorTimer = setTimer(waitForDoor, 100, 1) if isTimer(resettingDoorTimer) then killTimer(resettingDoorTimer) end resettingDoorTimer = setTimer(resetWaitForDoor, 10000, 1) end) function waitForDoor() local pedX, pedY, pedZ = getElementPosition(animPed) local offX, offY = getDoorOffset(animSeat, getElementRotation(animVehicle)) pos[animSeat].x, pos[animSeat].y, _ = getVehicleComponentPosition(animVehicle, pos[animSeat].name, "world") pos[animSeat].x = pos[animSeat].x + offX pos[animSeat].y = pos[animSeat].y + offY if (getDistanceBetweenPoints2D(pos[animSeat].x, pos[animSeat].y, pedX, pedY) > 0.5) then setElementRotation(animPed, 0, 0, getRotationFromVec2D(pos[animSeat].x-pedX, pos[animSeat].y-pedY), "default", true) doorTimer = setTimer(waitForDoor, 100, 1) else if isTimer(resettingDoorTimer) then killTimer(resettingDoorTimer) end setPedAnalogControlState(animPed, "forwards", 0) attachAndAnimate1() end end function resetWaitForDoor() if isTimer(doorTimer) then killTimer(doorTimer) end setPedAnalogControlState(animPed, "forwards", 0) attachAndAnimate1() end local animPedZShift function attachAndAnimate1() local vehRotX, vehRotY, vehRotZ = getElementRotation(animVehicle, "default") local offX, offY = getDoorOffset(animSeat) local _, _, worldZ = getVehicleComponentPosition(animVehicle, pos[animSeat].name, "world") local _, _, pedZ = getElementPosition(animPed) animPedZShift = pedZ - worldZ pos[animSeat].x, pos[animSeat].y, pos[animSeat].z = getVehicleComponentPosition(animVehicle, pos[animSeat].name, "root") pos[animSeat].x = pos[animSeat].x + offX pos[animSeat].y = pos[animSeat].y + offY pos[animSeat].z = pos[animSeat].z + animPedZShift setElementCollidableWith(animPed, animVehicle, false) attachElements(animPed, animVehicle, pos[animSeat].x, pos[animSeat].y, pos[animSeat].z, vehRotX, vehRotY, vehRotZ) setElementRotation(animPed, vehRotX, vehRotY, vehRotZ) local animation = (animSeat%2 == 1) and "CAR_open_RHS" or "CAR_open_LHS" setPedAnimation(animPed, "ped", animation, -1, false, false, false, true) setTimer(function(v,s) setVehicleDoorOpenRatio(v, s, 1, 300) end, 500, 1, animVehicle, animSeat+2) setTimer(animate2, 1000, 1) end function animate2() local animation = (animSeat%2 == 1) and "CAR_getin_RHS" or "CAR_getin_LHS" setPedAnimation(animPed, "ped", animation, -1, false, false, false, true) setTimer(animate3, 1000, 1) end function animate3() local animation = (animSeat%2 == 1) and "CAR_closedoor_RHS" or "CAR_closedoor_LHS" setPedAnimation(animPed, "ped", animation, -1, false, false, false, true) setTimer(function(v,s) setVehicleDoorOpenRatio(v, s, 0, 200) end, 300, 1, animVehicle, animSeat+2) setTimer(function(event, rootElement, vehicle, seat) triggerServerEvent(event, rootElement, vehicle, seat) end, 500, 1, "pedPutIntoVehicle", resourceRoot, animVehicle, animSeat) end -- ========== Создание точки назначения ========== addEvent("createDestinationMarker", true) addEventHandler("createDestinationMarker", resourceRoot, function(point) removePedDropElements() currentPoint = point destinationMarker = createMarker(point[1], point[2], point[3], "cylinder", 2, 100,100,0,200) jobBlip = createBlipAttachedTo(destinationMarker, 56, 2, 255, 0, 0, 255, 32767, 65535) end) function removePedDropElements() currentPoint = false if isElement(destinationMarker) then destroyElement(destinationMarker) end if isElement(jobBlip) then destroyElement(jobBlip) end destinationMarker = false jobBlip = false end -- ========== Ожидание остановки машины при заезде на маркер окончания ========== function waitingForDropStop() local vehicle = getPedOccupiedVehicle(localPlayer) if (not vehicle) then return end local spX, spY, spZ = getElementVelocity(vehicle) local speed = math.floor(math.sqrt(spX^2 + spY^2 + spZ^2)*180) if (speed < 5) then antiDOSsend("pedDrop", 1000, "startPedDrop", resourceRoot) else dropStopTimer = setTimer(waitingForDropStop, 100, 1) end end -- ========== Выход педа из машины и исчезновение ========== addEvent("extractPedFromVehicle",true) addEventHandler("extractPedFromVehicle", resourceRoot, function(vehicle, ped, seat) removePedDropElements() if (seat == 1) and (rightWheeledCars[getElementModel(vehicle)]) then seat = 0 end animVehicle, animPed, animSeat = vehicle, ped, seat local vehRotX, vehRotY, vehRotZ = getElementRotation(vehicle, "default") local offX, offY = getDoorOffset(seat) pos[seat].x, pos[seat].y, pos[seat].z = getVehicleComponentPosition(vehicle, pos[seat].name, "root") pos[seat].x = pos[seat].x + offX pos[seat].y = pos[seat].y + offY pos[seat].z = pos[seat].z + animPedZShift setElementCollidableWith(ped, vehicle, false) attachElements(ped, vehicle, pos[seat].x, pos[seat].y, pos[seat].z-10, vehRotX, vehRotY, vehRotZ) setElementRotation(ped, vehRotX, vehRotY, vehRotZ) local animation = (seat%2 == 1) and "CAR_getout_RHS" or "CAR_getout_LHS" setPedAnimation(ped, "ped", animation, -1, false, false, false, true) setTimer(function(v,s) setVehicleDoorOpenRatio(v, s, 1, 300) end, 150, 1, vehicle, seat+2) setTimer(function(p, v, x, y, z, rX, rY, rZ) attachElements(p, v, x, y, z, rX, rY, rZ) end, 200, 1, ped, vehicle, pos[seat].x, pos[seat].y, pos[seat].z, vehRotX, vehRotY, vehRotZ) setTimer(closeDoor, 900, 1) end) function closeDoor() local animation = (animSeat%2 == 1) and "CAR_close_RHS" or "CAR_close_LHS" setPedAnimation(animPed, "ped", animation, -1, false, false, false, true) setTimer(function(v,s) setVehicleDoorOpenRatio(v, s, 0, 300 ) end, 150, 1, animVehicle, animSeat+2) setTimer(startWalkOut, 900, 1) end local pedAlpha function startWalkOut() local _, _, vehRotZ = getElementRotation(animVehicle, "default") detachElements(animPed) setPedAnimation(animPed) setElementCollidableWith(animPed, animVehicle, true) setPedAnalogControlState(animPed, "forwards", 0.5) setElementRotation(animPed, 0, 0, (animSeat%2 == 1) and (vehRotZ-90) or (vehRotZ+90), "default", true) pedAlpha = 255 addEventHandler("onClientRender", root, vanishPed) triggerServerEvent("pedDropped", resourceRoot, animVehicle) end function vanishPed() pedAlpha = pedAlpha-1 if isElement(animPed) then setElementAlpha(animPed, pedAlpha) end if (pedAlpha == 0) or (not isElement(animPed)) then removeEventHandler("onClientRender", root, vanishPed) triggerServerEvent("killVanishedPed", resourceRoot) end end -- ========== Очистка всей инфы о работе ========== addEvent("deleteAllObjects", true) addEventHandler("deleteAllObjects", resourceRoot, function() currentPed = false currentPoint = false if isElement(sourceMarker) then destroyElement(sourceMarker) end if isElement(rotateMarker) then destroyElement(rotateMarker) end if isElement(jobBlip) then destroyElement(jobBlip) end if isElement(destinationMarker) then destroyElement(destinationMarker) end if isTimer(pickupStopTimer) then killTimer(pickupStopTimer) end if isTimer(dropStopTimer) then killTimer(dropStopTimer) end animVehicle = false animPed = false animSeat = false if isTimer(doorTimer) then killTimer(doorTimer) end if isTimer(resettingDoorTimer) then killTimer(resettingDoorTimer) end end) -- ========== Мелкие вспомогательные функции ========== -- Получить смещение педа относительно дверной петли function getDoorOffset(seat, _, _, rotZ) local Xshift, Yshift = 0.5, -1.25 if (tonumber(seat)%2 == 0) then Xshift = -Xshift end if (rotZ) then rotZ = math.rad(rotZ) return Xshift*math.cos(rotZ)-Yshift*math.sin(rotZ), Xshift*math.sin(rotZ)+Yshift*math.cos(rotZ) else return Xshift, Yshift end end -- Получить угол наклона вектора function getRotationFromVec2D(x, y) local a = math.deg(math.acos(y/((x^2+y^2)^0.5))) return (x < 0) and (a) or (-a) end -- Сообщения от имени такси function outputTaxiMessage(text) outputChatBox("[TAKSİ] #FFFFFF"..text, 227, 173, 0, true) end -- Убирание ошибки при добавлении/убирании эвента function addEventHandlerNoWarnings(eventName, element, func) for _, attachedFunc in ipairs(getEventHandlers(eventName, element)) do if (attachedFunc == func) then return end end addEventHandler(eventName, element, func) end function removeEventHandlerNoWarnings(eventName, element, func) for _, attachedFunc in ipairs(getEventHandlers(eventName, element)) do if (attachedFunc == func) then removeEventHandler(eventName, element, func) end end end -- Проверка, что ресурс запущен function isResourceRunning(resName) local res = getResourceFromName(resName) return (res) and (getResourceState(res) == "running") end -- ========== Слоумод на кнопку/действие ========== local sendData = {} local sendTimers = {} function antiDOSsend(actionGroup, pause, ...) local args = {...} if isTimer(sendTimers[actionGroup]) then sendData[actionGroup] = args[1] and args else if (args[1]) then triggerServerEvent(...) sendData[actionGroup] = false sendTimers[actionGroup] = setTimer(slowSend, pause, 1, actionGroup) end end end function slowSend(actionGroup) if (sendData[actionGroup]) then triggerServerEvent(unpack(sendData[actionGroup])) sendData[actionGroup] = nil end end --[[ addEventHandler("onClientPreRender",root, function () if animPed and isElement(animPed) then local block, animation = getPedAnimation(animPed) dxDrawText ( "CURRENT ANIMATION INFO...", 500, 300 ) if not block then block = "N/A" end if not animation then animation = "N/A" end dxDrawText ( "Block = "..block.." Animation = "..animation, 500, 315 ) end end ) ]] --[[ addEventHandler ( "onClientRender", root, function() if isPedInVehicle ( localPlayer ) and getPedOccupiedVehicle ( localPlayer ) then local veh = getPedOccupiedVehicle ( localPlayer ) for v in pairs ( getVehicleComponents(veh) ) do local x,y,z = getVehicleComponentPosition ( veh, v, "world" ) if x then local wx,wy,wz = getScreenFromWorldPosition ( x, y, z ) if wx and wy then dxDrawText ( v, wx -1, wy -1, 0 -1, 0 -1, tocolor(0,0,0), 1, "default-bold" ) dxDrawText ( v, wx +1, wy -1, 0 +1, 0 -1, tocolor(0,0,0), 1, "default-bold" ) dxDrawText ( v, wx -1, wy +1, 0 -1, 0 +1, tocolor(0,0,0), 1, "default-bold" ) dxDrawText ( v, wx +1, wy +1, 0 +1, 0 +1, tocolor(0,0,0), 1, "default-bold" ) dxDrawText ( v, wx, wy, 0, 0, tocolor(0,255,255), 1, "default-bold" ) end end end end end) ]]
  18. Alguem sabe arrumar? Tenho uma GPU AMD R7 260 e o MTA não utiliza 1% dela https://imgur.com/a/SFUi3jY
  19. Hey, someone knows where can i find a host company to my mta:sa server? I do not want to buy from a reseller, I want to be the reseller but only do it for my server
  20. Welcome to Zombie Mode Roleplay or ZMRP. In December we will be 10 years old online and we are going to celebrate it. You can make a roleplay with your friends or play alone and advance in our story mode. We have five bases (safe zones) around San Andreas. In these places you can buy weapons and find the story mode missions. Also we have three shelters where you will find daily missions. By the way, you can also kill zombies to gain respect and money. Very important to unlock missions, achievements and weapons! But be careful, some zombies have special abilities These are the most important things, but we have many more things! Events, daily bosses, tsunamis, etc. Our IP: 185.249.196.68:22145/ Our Facebook Fanpage: https://www.facebook.com/ZombieModeRoleplay Languages: English, Spanish and Portuguese Screenshots taken from server: Videos from our youtube channel:
  21. Guys , did someone know how to turn off the auto UPDATE of MTA ?? When I play in MTA with the previous versions of MTA , everything is fine and everything works done , but when I reenter in the game , the game is updating so after that all cars are invisible ....How can i fix this ? (I play on most popular russian MTA servers , CCD PLANET and others)
  22. local SCREEN_X, SCREEN_Y = guiGetScreenSize() local resourceName = getResourceName( getThisResource( ) ) local ONE_HOUR = 3600 local SERVICES_SECTION = 1 --Places to offer services such as house cleaning or mechanics and whatnot local CARS_VEHICLES_SECTION = 2 --Offer to buy or sell a vehicle in this section local REAL_ESTATE_SECTION = 3 --Houses for sale go in this section local COMMUNITY_SECTION = 4 --Advertisements about communities can go here, for example, palomino creek. local JOBS_SECTION = 5 --Advertisements about hiring people or looking for work will go in this section local PERSONALS_SECTION = 6 --People looking for other people go in this section local sections = { "Servicii", "Vehicule", "Proprietăți", "Communitate", "Slujbe", "Personal" } local deleteAny = false local window = { } local viewad = {} local postad = {} function getTime( day, month, timestamp ) local months = { "Ianuarie", "Februarie", "Martie", "Aprile", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octobrie", "Niembrie", "Decembrie" } local days = { "Sâmbătă", "Luni", "Marți", "Miercuri", "Joi", "Vineri", "Duminică" } local time = nil local ts = nil if timestamp then time = getRealTime( timestamp ) else time = getRealTime( ) end ts = ( tonumber( time.hour ) >= 12 and tostring( tonumber( time.hour ) - 12 ) or time.hour ) .. ":"..("%02d"):format(time.minute)..( tonumber( time.hour ) >= 12 and " PM" or " AM" ) if month then ts = months[ time.month + 1 ] .. " ".. time.monthday .. ", " .. ts end if day then ts = days[ time.weekday + 1 ].. ", " .. ts end return ts end addEvent( resourceName .. ":ad_create_fail", true ) addEventHandler( resourceName .. ":ad_create_fail", root, function() local window = { } --Store all of our window elements local width = 230 -- The width of our window local height = 110 -- The height of our window local x = SCREEN_X / 2 - width / 2 --Where on the screen our window will be located local y = SCREEN_Y / 2 - height / 2 window.window = guiCreateWindow( x, y, width, height, "Eroare de creatie", false ) --Create the window. window.errorLabel = guiCreateLabel( 10, 30, width - 20, 20, "A fost o eroare la introducere.", false, window.window ) window.closeButton = guiCreateButton( 10, 60, width - 20, 40, "Ieși", false, window.window ) addEventHandler( "onClientGUIClick", window.closeButton, function () guiSetVisible( window.window, false ) destroyElement( window.window ) window = { } end ) end ) function createAdvertisement( ) closePostAd() if window and window.window and isElement(window.window) then guiSetEnabled(window.window, false) end guiSetInputEnabled ( true ) local window = { } -- Store all of our window elements local width = 400 -- The width of our window local height = 440 -- The height of our window local x = SCREEN_X / 2 - width / 2 --Where on the screen our window will be located local y = SCREEN_Y / 2 - height / 2 postad.window = guiCreateWindow( x, y, width, height, "Crează Reclamă", false ) --Create the postad. postad.label = { } --This will hold our label elements local labels = { "Telefon", "Nume", "Adresă", "Expiră", "Secțiune", "Reclamă" } --This holds all of the labels we will create here local y = 35 --We'll set y to 30, which is the y coordinate of where our first label will go. for label = 1, #labels do postad.label[ label ] = guiCreateLabel( 10, y * label, 100, 30, labels[ label ], false, postad.window ) end postad.input = { } -- Will hold all of our input elements. y = 30 -- We'll start y off at 25 here to stay even with the inputs. postad.input[ 1 ] = guiCreateEdit( 100, y, width - 120, 30, "", false, postad.window ) --Phone input y = y + 35 postad.input[ 2 ] = guiCreateEdit( 100, y, width - 120, 30, "", false, postad.window ) --Name Input y = y + 35 postad.input[ 3 ] = guiCreateEdit( 100, y, width - 120, 30, "", false, postad.window ) --Address input y = y + 40 postad.input[ 4 ] = guiCreateComboBox( 100, y, width - 120, 95, "", false, postad.window ) --Expiry guiComboBoxAddItem( postad.input[ 4 ], "1 oră" ) guiComboBoxAddItem( postad.input[ 4 ], "2 ore" ) guiComboBoxAddItem( postad.input[ 4 ], "6 ore" ) guiComboBoxAddItem( postad.input[ 4 ], "O zi" ) y = y + 34 postad.input[ 5 ] = guiCreateComboBox( 100, y, width - 120, 125, "", false, postad.window ) --Section for i = 1, #sections do --Loop through each of the 6 advertisement sections. guiComboBoxAddItem( postad.input[ 5 ], sections[ i ] ) end postad.input[ 6 ] = guiCreateMemo( 10, y + 60, width - 20, 90, "", false, postad.window ) --Advertisement for i = 1, 6 do addEventHandler(getElementType( postad.input[i] ) == 'gui-combobox' and 'onClientGUIComboBoxAccepted' or 'onClientGUIChanged', postad.input[i], function( ) for i = 1, 6 do if getElementType( postad.input[i] ) == 'gui-combobox' then if guiComboBoxGetSelected( postad.input[i] ) == -1 then guiSetEnabled( postad.postButton, false ) return end else local text = ( guiGetText( postad.input[i] ) or '' ):gsub("\n", ''):gsub("\r", '') if #text == 0 then guiSetEnabled( postad.postButton, false ) return end end end guiSetEnabled( postad.postButton, true ) end, false ) end postad.postButton = guiCreateButton( 10, height - 100, width - 20, 40, "Postează Reclamă", false, postad.window ) guiSetEnabled( postad.postButton, false ) addEventHandler( "onClientGUIClick", postad.postButton, function () local phone = guiGetText( postad.input[ 1 ] ) or "" local name = guiGetText( postad.input[ 2 ] ) or "" local address = guiGetText( postad.input[ 3 ] ) or "" local advertisement = guiGetText( postad.input[ 6 ] ) local expirySelected = guiComboBoxGetSelected( postad.input[ 4 ] ) local expires = nil if expirySelected == -1 or expirySelected == 0 then expires = ONE_HOUR elseif expirySelected == 1 then expires = ONE_HOUR * 2 elseif expirySelected == 2 then expires = ONE_HOUR * 6 else expires = ONE_HOUR * 24 end local section = tostring( guiComboBoxGetSelected( postad.input[ 5 ] ) + 1 ) closePostAd() triggerServerEvent( resourceName .. ":create_advertisement", getLocalPlayer(), phone, name, address, advertisement, expires, section ) end , false ) postad.closeButton = guiCreateButton( 10, height - 50, width - 20, 40, "Ieși", false, postad.window ) addEventHandler( "onClientGUIClick", postad.closeButton, function () if source == postad.closeButton then closePostAd() end end , false ) end addCommandHandler( "postad", createAdvertisement, false, false ) function closePostAd() if postad and postad.window and isElement(postad.window) then guiSetInputEnabled ( false ) destroyElement( postad.window ) postad = { } if window and window.window and isElement(window.window) then guiSetEnabled(window.window, true) else showCursor( false, false ) end end end function viewAdvertisement( advertisement ) closeViewAd() if window and window.window and isElement(window.window) then guiSetEnabled(window.window, false) end guiSetInputEnabled ( false ) local window = { } local width = 400 local height = 530 local x = SCREEN_X / 2 - width / 2 local y = SCREEN_Y / 2 - height / 2 viewad.window = guiCreateWindow( x, y, width, height, "Vezi reclamă", false ) viewad.label = { } local labels = { "Telefon", "Nume", "Adresă", "Start", "Expiră", "Secțiune", "Reclamă" } local y = 35 for label = 1, #labels do viewad.label[ label ] = guiCreateLabel( 10, y * label, 100, 30, labels[ label ], false, viewad.window ) end viewad.input = { } y = 30 viewad.input[ 1 ] = guiCreateEdit( 100, y, width - 120, 30, advertisement.phone, false, viewad.window ) guiEditSetReadOnly( viewad.input[ 1 ], true ) y = y + 35 viewad.input[ 2 ] = guiCreateEdit( 100, y, width - 120, 30, advertisement.name, false, viewad.window ) guiEditSetReadOnly( viewad.input[ 2 ], true ) y = y + 35 viewad.input[ 3 ] = guiCreateEdit( 100, y, width - 120, 30, advertisement.address, false, viewad.window ) guiEditSetReadOnly( viewad.input[ 3 ], true ) y = y + 35 viewad.input[ 4 ] = guiCreateEdit( 100, y, width - 120, 30, getTime( true, true, advertisement.start ), false, viewad.window ) guiEditSetReadOnly( viewad.input[ 4 ], true ) y = y + 35 viewad.input[ 5 ] = guiCreateEdit( 100, y, width - 120, 30, getTime( true, true, advertisement.expiry ), false, viewad.window ) guiEditSetReadOnly( viewad.input[ 5 ], true ) y = y + 35 viewad.input[ 6 ] = guiCreateEdit( 100, y, width - 120, 30, sections[ tonumber( advertisement.section ) ], false, viewad.window ) guiEditSetReadOnly( viewad.input[ 6 ], true ) viewad.input[ 7 ] = guiCreateMemo( 10, y + 60, width - 20, 90, advertisement.advertisement, false, viewad.window ) guiMemoSetReadOnly( viewad.input[ 7 ], true ) if tonumber( getElementData( localPlayer, "dbid" ) ) == tonumber( advertisement.created_by ) or deleteAny then guiCreateLabel( 100, 245, 200, 25, "Creat de: " .. advertisement.author:gsub("_", " "), false, viewad.window ) viewad.pushButton = guiCreateButton( 10, height - 150, width - 20, 40, "Trimite reclama ($100)", false, viewad.window ) if tonumber( getElementData( localPlayer, "dbid" ) ) ~= tonumber( advertisement.created_by ) then guiSetProperty( viewad.pushButton, 'NormalTextColour', 'FFFF0000' ) end addEventHandler( "onClientGUIClick", viewad.pushButton, function () triggerServerEvent( resourceName .. ":push_advertisement", localPlayer, advertisement.id ) end , false ) end if tonumber( getElementData( localPlayer, "dbid" ) ) == tonumber( advertisement.created_by ) or deleteAny then viewad.deleteButton = guiCreateButton( 10, height - 100, width - 20, 40, "Șterge Reclamă", false, viewad.window ) if tonumber( getElementData( localPlayer, "dbid" ) ) ~= tonumber( advertisement.created_by ) then guiSetProperty( viewad.deleteButton, 'NormalTextColour', 'FFFF0000' ) end addEventHandler( "onClientGUIClick", viewad.deleteButton, function () closeViewAd() triggerServerEvent( resourceName .. ":delete_advertisement", localPlayer, advertisement.id ) end , false ) end viewad.closeButton = guiCreateButton( 10, height - 50, width - 20, 40, "Ieși", false, viewad.window ) addEventHandler( "onClientGUIClick", viewad.closeButton, function () if source == viewad.closeButton then closeViewAd() end end , false ) end function closeViewAd() if viewad and viewad.window and isElement(viewad.window) then guiSetInputEnabled ( false ) guiSetVisible( viewad.window, false ) destroyElement( viewad.window ) viewad = { } if window and window.window and isElement(window.window) then guiSetEnabled(window.window, true) else showCursor( false, false ) end end end addEvent( resourceName .. ":display_all", true ) addEventHandler( resourceName .. ":display_all", root, function( advertisements, canDeleteAnyAd ) closeAds() deleteAny = canDeleteAnyAd showCursor( true, true ) local width = 500 local height = 500 local x = SCREEN_X / 2 - width / 2 local y = SCREEN_Y / 2 - height / 2 window.window = guiCreateWindow( x, y, width, height, "Reclame", false ) window.closeButton = guiCreateButton( 10, 30, width - 20, 40, "Creează Reclamă", false, window.window ) addEventHandler( "onClientGUIClick", window.closeButton, function () createAdvertisement( ) end , false ) window.mainPanel = guiCreateTabPanel ( 10, 90, width - 15, height - 150, false, window.window ) window.tab = { } window.table = { } window.colPhone = { } window.colName = { } window.colAd = { } for i = 1, #sections do window.tab[ i ] = guiCreateTab( sections[ i ], window.mainPanel ) window.table[ i ] = guiCreateGridList ( 10, 10, width - 35, height - 190, false, window.tab[ i ] ) window.colPhone[ i ]= guiGridListAddColumn( window.table[ i ], "Telefon", 0.2 ) window.colName[ i ] = guiGridListAddColumn( window.table[ i ], "Nume", 0.2 ) window.colAd[ i ] = guiGridListAddColumn( window.table[ i ], "Reclamă", 0.5 ) for ad = 1, #advertisements do if tonumber( advertisements[ ad ].section ) == i then local row = guiGridListAddRow ( window.table[ i ] ) guiGridListSetItemText( window.table[ i ], row, window.colPhone[ i ], advertisements[ ad ].phone, false, false ) guiGridListSetItemText( window.table[ i ], row, window.colName[ i ], advertisements[ ad ].name, false, false ) guiGridListSetItemText( window.table[ i ], row, window.colAd[ i ], advertisements[ ad ].advertisement, false, false ) guiGridListSetItemData( window.table[ i ], row, window.colPhone[ i ], ad ) addEventHandler( "onClientGUIDoubleClick", window.table[ i ], function ( button, state ) if button == 'left' and state == 'up' and window and window.table then local selectedRow, selectedCol = guiGridListGetSelectedItem( window.table[ i ] ) local key = guiGridListGetItemData( window.table[ i ], selectedRow, window.colPhone[ i ] ) if advertisements[ key ] then viewAdvertisement( advertisements[ key ] ) end end end , false ) end end if guiGridListGetRowCount( window.table[ i ] ) == 0 then local row = guiGridListAddRow ( window.table[ i ] ) guiGridListSetItemText ( window.table[ i ], row, window.colPhone[ i ], "Nici-o reclamă", false, false ) end end window.closeButton = guiCreateButton( 10, height - 50, width - 20, 40, "Ieși", false, window.window ) addEventHandler( "onClientGUIClick", window.closeButton, function () if source == window.closeButton then closeAds() end end , false ) end ) function closeAds() if window and window.window and isElement(window.window) then showCursor( false, false ) destroyElement( window.window ) window = { } closePostAd() end end local SERVICES_SECTION = 1 --Places to offer services such as house cleaning or mechanics and whatnot local CARS_VEHICLES_SECTION = 2 --Offer to buy or sell a vehicle in this section local REAL_ESTATE_SECTION = 3 --Houses for sale go in this section local COMMUNITY_SECTION = 4 --Advertisements about communities can go here, for example, palomino creek. local JOBS_SECTION = 5 --Advertisements about hiring people or looking for work will go in this section local PERSONALS_SECTION = 6 --People looking for other people go in this section local COOLDOWN_MINUTES = 5 --Number of minutes between push alerts being sent by players local resourceName = getResourceName( getThisResource( ) ) local sections = { "Servicii", "Vehicule", "Proprietăți", "Communitate", "Slujbe", "Personal" } function escape( value ) return exports.mysql:escape_string( value ) end function now( ) return tonumber( getRealTime().timestamp ) end addEvent( resourceName .. ":create_advertisement", true ) addEventHandler( resourceName .. ":create_advertisement", root, function( phone, name, address, advertisement, expires, section ) --Check if all fields have been entered by the user. if not ( phone == nil or name == nil or address == nil or advertisement == nil ) then --Fetch the created by local createdBy = tostring( getElementData( source, "dbid" ) ) --Get the current server time to store as our start time local start = getRealTime().timestamp --Add the time until expiry to the start time to get the actual time it will expire. local expiry = start + expires --Check if our query went into the database successfully. if exports.mysql:insert( 'advertisements', { phone = phone, name = name, address = address, advertisement = advertisement, start = start, expiry = expiry, section = section, created_by = createdBy } ) then --We'll send something to the client side so they can close the add form and reopen the main advertisements form. --openAdvertisements( source, nil ) else --If the database query was unsucessful, alert the end user. outputChatBox( "SQL Error.", source ) triggerClientEvent( source, resourceName .. ":ad_create_fail", root ) end else --If all fields were not entered, alert the user. outputChatBox( "Field Error.", source ) triggerClientEvent( source, resourceName .. ":ad_create_fail", root ) end end ) local coolDown = {} addEvent( resourceName .. ":push_advertisement", true ) addEventHandler( resourceName .. ":push_advertisement", root, function( id ) local advertisement = exports.mysql:select_one( "advertisements", { id = id } ) advertisement.author = exports.mysql:select_one( "characters", { id = advertisement.created_by } ).charactername if not coolDown[ id ] or ( coolDown[ id ] < now() - ( 60 * COOLDOWN_MINUTES ) ) then if exports.bank:takeBankMoney( client, 100 ) then coolDown[ id ] = now() for i, k in pairs( getElementsByType( 'player' ) ) do if exports.integration:isPlayerTrialAdmin( k ) then outputChatBox( "ADVERT: " .. advertisement.advertisement .. " | Ph: " .. advertisement.phone .. " | Cat: " .. sections[ tonumber( advertisement.section ) ] .. " (( " .. advertisement.author:gsub("_", " ") .." )) .", k, 0, 255, 0 ) else outputChatBox( "ADVERT: " .. advertisement.advertisement .. " | Ph: " .. advertisement.phone .. " | Cat: " .. sections[ tonumber( advertisement.section ) ] .. ".", k, 0, 255, 0 ) end end else outputChatBox( "Nu ai destui bani în bancă să trimiți această reclamă.", client, 255, 155, 155 ) end else outputChatBox( "Poți trimite o reclamă o dată la " .. COOLDOWN_MINUTES .. " minute.", client, 255, 155, 155 ) end end ) function deleteAdvertisement( id ) return exports.mysql:delete('advertisements', {id = id}) end addEvent( "advertisements:delete_advertisement", true ) addEventHandler( "advertisements:delete_advertisement", getRootElement(), function( id ) if deleteAdvertisement( id ) then --openAdvertisements( source ) else outputChatBox( "An error occured with deleting that ad.", source, 255, 100, 100 ) end end ) function openAdvertisements( player, command ) local advertisements = { } --These will hold our advertisements to send to the client and populate our advertisement tables. if not player then player = source end for _, ad in ipairs( exports.mysql:select('advertisements') ) do if tonumber( ad.expiry ) >= tonumber( getRealTime().timestamp ) then --Check if the advertisement has expired, delete it if so. ad.author = exports.mysql:select_one( "characters", { id = ad.created_by } ).charactername table.insert( advertisements, ad ) else deleteAdvertisement( ad.id ) end end triggerClientEvent( player, resourceName .. ":display_all", root, advertisements, exports.integration:isPlayerAdmin( player ) ) --Send the advertisements to the client to create the GUI. end addCommandHandler( "advertisements", openAdvertisements, false, false ) addCommandHandler( "ads", openAdvertisements, false, false ) addCommandHandler( "classifieds", openAdvertisements, false, false ) addEvent( resourceName .. ":open_ads", true ) addEventHandler( resourceName .. ":open_ads", root, openAdvertisements ) Hello guys I just wanna know what I messed up in my script I'm facing this error for hours!! ERROR: advertisements\advertisements.Lua:187: call: failed to call 'mysql:select' [string "?"] ERROR: advertisements\advertisements.Lua:187: bad argument #1 to 'ipairs' (table expected, got boolean)
  23. Hi, Because we have an atmosphere called winter, why is it only in reality? Abo, because you do not have this script that will add a winter climate to your server and its players. Together with the team, we have created another project! F7 - turning off the snow on the screen Download: https://www55.zippyshare.com/v/cwmhgfTo/file.html Video:
  24. Tusky

    AUTO UPDATE

    HOW TO DISABLE THE AUTOUPDATE OF THE MTA VERSION ? Please , need help!
×
×
  • Create New...