Search the Community

Showing results for tags 'tutorial'.



More search options

  • 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
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 16 results

  1. Have you ever experienced some lag while gaming ? We have some common issues between us ... like someone else is using your internet 😣, or you might be downloading some files ( like games 🕹️ or movies 🎥 ), or you might be streaming some music 🎶 or videos 📹 while playing or using another device like PS4 🎮 or your mobile phone 📱. Well .. those issues can be resolved since that person can leave your network ❌, or you can stop your downloading progress ❌, or stop using your browser to get the best ping and loss in your gaming 🤷🏾‍♂️. However, your permanent ping and loss cannot change easily because it depends on how far your location is from the server 📍, and the speed of your internet connection 📶, yet ... i discovered a software which can MINIMIZE and not entirely stop this lagging and i think its kinda effective 🤔. Its called WTFast , and i think it can somehow help in lowering your ping or at least disabling the effect of loss. You have to pay in order to have a subscription💸to this software, but there is a trial to see if this software is useful for you or not and its important to know how to use it because its different in every game ( according to the location of the server ), and for MTASA you MUST follow this tutorial in order to know how to use it in the game. so if you're interested .. go on and download the trial of this software https://www.wtfast.com/ How to use it in MTASA ? For other games, you can search Google or YouTube 🔍for tutorials on how to use it on those games. For MTASA ( idk if it works for SAMP ) you just have to follow this tutorial and i hope it will help 🤓 1. You have to download it from https://www.wtfast.com/ 2. install the software and then launch it 3. login to your trial account ( might be already logged in ) 4. In the picture below, when this screen appears for you ( my version is 4.12, you have to search for a way in order to reach custom games if you have a TOTALLY different version ) the box in red that i drew shows the listed games, this is direct as the popular games can be directly accessed from this box, but MTASA is not a listed game now, for this step you have to press Manage Settings in the green box i drew and go to step 5. 5. Now that you reached the settings, press the checkbox Enable custom games and then press save 6. Now you should be back to the main panel, press Custom games 7. Press ADD 8. Now for the most important step i will just insert a photo to explain everything for it to be easier Only for those who don't know how to copy MTASA server address 9. After you clicked OKAY, follow this picture to know everything next 10. If you want to know the location of your MTA:SA server, just type the name of the server in https://www.game-state.com/ and you will find the location of the server, then choose the nearest location of the server to your MTASA server " and this if the auto detection does not work " At the end I wish this tutorial helped you guys and feel free to ask any question in the replies 🎆 Good Luck 🍀
  2. [TUT] Scaling DX The reason why I am creating this topic, is because there are a lot of people asking this question: And to be honest there is no best practice for. But here you have my recommendation as guidance for display them the ~s~a~m~e~ for all screen formats. There are two important factors while dealing with screen formats 1. Pixel density Indication: PPI(Pixels Per Inch) and some also use the term DPI(Dots Per Inch) They do not have to be the same while talking about printing stuff. This indication tells us about how many pixels are used per inch. Which more or less tells us how sharp/smooth things like text can be looking. PPI doesn't really play a big role, but to display something nicely you need enough pixels to display it. Else it will be either too small or too crispy. So be careful to not scale things (especially text) too small. 2. Display aspect ratio Wiki The difference between resolution X and resolution Y as a ratio. A list of common ratios: 4:3 5:4 3:2 16:10 16:9 So for example if we take: fHD: 1920x1080 Which has the ratio 16:9 that is calculated like this: 1920 / 16 = 120 120 * 9 = 1080 Scaling without ratio Before I am going to explain any of this, I am going to ask you an important question: Like this: (vertical) ▮ Or horizontal? ▅ I assume most people would agree to play MTA horizontal, else you are probably reading a book or document. p.s If you play MTA on a vertical screen, then we developers do not like you at all, sorry. So what does this tell us? You can assume that the X-resolution is never going to be smaller than the Y-resolution. Useful? You will figure it out. Doing the scaling Note: This part is ABOUT SCALING and not positioning. So what we are going to do is: Calculating a scale which can display the same DX on multiple screen formats > without messing with the ratio. Example: A computer runs MTA at a resolution of 1920 x 1080. Lets define that! local devScreenX = 1920 local devScreenY = 1080 If this code is used by a different pc, we also need to know on which resolution it is running: local screenX, screenY = guiGetScreenSize() For the next step we have to look at this screenshot: I have cut out of the wide-screen format a square. Squares have the ratio 1:1, which means that we have removed our ratio difference from this screen resolution. It is very easy to do, as our Y * Y resolution makes exactly that beautiful square! The next thing we have to do is creating our scaling value. This value is required for adjust our resolution values so that they match to every screen format. So to use our ratio 1:1, we use the Y resolution to achieve that: local scaleValue = screenY / devScreenY And as last we can create a rectangle shape that is displayed at the center of every screen format, perfectly! local devScreenX = 1920 local devScreenY = 1080 local screenX, screenY = guiGetScreenSize() local scaleValue = screenY / devScreenY addEventHandler("onClientRender", root, function () -- create a scaled size local sizeX = scaleValue * 300 -- 300px local sizeY = scaleValue * 50 -- 50px -- get the center of the screen local centerX = screenX / 2 local centerY = screenY / 2 -- calculate the starting point of the rectangle local startRectangleX = centerX - (sizeX / 2) local startRectangleY = centerY - (sizeY / 2) dxDrawRectangle ( startRectangleX, startRectangleY, sizeX, sizeY, tocolor ( 255, 255, 255, 255 ) ) end) Lower limit What if we have a resolution of 800x600? And the text is getting too small? Making sure that the pixel density is OK, is very important. So to counter that we have to make sure that the text is not getting too small. Our development Y resolution is 1080 pixels. And we are dealing with an Y resolution 600 pixels. The first thing we are going to look at, is what the scale is going to be at that point. 600 / 1080 = 0.55555555555555555555555555555556 It is not very nice to have your text scaled to 55.5% of the original size, when having low resolution already. But without scaling, the DX stuff might fill up the entire screen and that is just as bad. So what we now need is a limit, in this case a lower limit. scaleValue = math.max(scaleValue, 0.65) The math.max function returns the highest value of all the arguments you put in to it. In this case it contains the: scaleValue: 0.555 And the lower limit of: 0.65 This will make sure that the DX stuff is not getting smaller than 65%. This might make text read able for a 800x600 resolution.
  3. Hello guys! In this video, I'll show you how to make a quick userpanel(also tabs,gridList,buttons and etc). Video Discord: NaGaFo #8298 FB: www.facebook.com/yan.nagafo if u want help me - Donate: https://www.donationalerts.com/r/nagafo
  4. I have launched a new, entirely free service that offers personal tutoring to anybody who wants to learn new MTA skills, including: Setting up an MTA Server Resources / scripts / meta.xml Writing Lua code MTA concepts such as events, timers, client-side interfaces, etc. SQL and other data storage methods I've been in the MTA community for coming up to 11 years now, and have worked with many of the 'big servers' that exist today, so the information will be delivered by people (including myself) with plenty of experience. The few students I'm already tutoring are well on their way to writing some basic MTA scripts already, after only a few days (totaling 4-5 hours). If you want to get involved, be sure to join the Discord server. You can also click here to see the recommended syllabus. If you know of anybody else who wants to learn to script, be sure to let them know of this great offer!
  5. O que é? Pra que serve? Um banco de dados é onde ficam salvos diversos tipos de dados que são usados entre as sessões dos jogadores e do servidor, isto significa que mesmo se o jogador relogar no servidor ou até mesmo o servidor reiniciar, os dados salvos no banco de dados não são perdidos. (se o script que salvou lá foi feito corretamente). O que posso salvar neles? O MTA já cria 2 bancos de dados padrão quando vc cria seu servidor, são eles: internal.db - Onde são salvos todos os dados das contas dos jogadores, login, senha, grana do bolso, posição do jogador quando deslogou, vida, colete, skin, armas, munição, etc. registry.db - Onde são salvos todos os dados que são utilizados pelos resources, como por exemplo melhores pontuações das corridas (race gamemode), proprietários das casas, dados bancários dos jogadores, saldo bancário dos jogadores, carros comprados pelos jogadores, roupas compradas pelos jogadores, empresas adquiridas pelos jogadores, etc. Onde eles estão? Estes dois bancos de dados estão na pasta deathmatch do seu servidor, estão na linguagem SQLite. Você ainda pode criar outros bancos de dados externos, para serem usados pelos resources, mas na minha opinião isso não é recomendável, uma vez que vc usaria MySQL, que é mais complexo e exige certos cuidados de acesso e domínio, mas alguns servidores profissionais precisam fazer assim pois fizeram os bancos de dados ficarem fora do servidor em outro IP por segurança, dai é necessário ter bancos de dados externos. Nesse tutorial vamos tratar somente dos bancos de dados nativos do MTA, por serem mais fáceis de entender. Como mexo neles? Para salvar alguma coisa na conta do jogador, isto é, no internal.db, você usa setAccountData, e para obter esses dados depois, use getAccountData. É extremamente simples, funciona da mesma forma que um setElementData, mas em vez de salvar uma data temporária em um elemento, salva uma data permanente numa conta. Porém, para salvar alguma coisa no registry.db, é um pouco mais complicado, uma vez que vc vai precisar criar uma tabela nova para cada resource. Por exemplo, vc acabou de criar um resource de ranking por kills/deaths e você deseja salvar esse ranking no banco de dados para que ao reiniciar o resource ou o servidor, o ranking não seja perdido. Para isso vc vai precisar primeiramente criar uma tabela no banco de dados registry.db, essa tabela será acessada pelo resource, que irá salvar os dados dele lá. Para fazer qualquer coisa neste banco de dados (criar tabelas, inserir, alterar, remover, deletar, inserir colunas em determinada tabela, etc) vc vai precisar usar isso: executeSQLQuery. Aqui, será necessário conhecimento em SQL para fazer isso, mas é mais fácil do que aprender uma linguagem de programação nova, pois suas opções e sintaxes são menores do que uma linguagem inteira de programação, você não vai inventar nenhum sistema novo aqui, apenas criar e gerenciar tabelas e dados. Criar tabela nova no banco de dados: (o Caps Lock não é uma regra, mas é melhor para entender o que é código e o que é nome) [Os seguintes códigos só funcionam server-side] executeSQLQuery ("CREATE TABLE IF NOT EXISTS nomedatabela (nomecoluna1 TEXT, nomecoluna2 REAL, nomecoluna3 INTEGER)") TEXT = Valores desta coluna serão textos. Podem ter símbolos, números e espaços. REAL = Valores desta coluna serão numéricos reais. (números decimais, positivos, negativos e 0.0) INTEGER = Valores desta coluna serão numéricos inteiros. (positivos, negativos e 0) (não existe tipo BOOLEAN, use TEXT e insira valor "false" ou "true") (existe valor NULL, é diferente de vazio e diferente de 0. NULL significa ausência de dados. O NULL aparece quando você cria uma linha ou coluna nova sem atribuir valores a elas.) Deletar tabela do banco de dados: executeSQLQuery ("DROP TABLE nomedatabela") Todas as linhas, colunas, células e valores desta tabela são deletados junto. Deletar linhas da tabela: (as células não ficarão NULL) executeSQLQuery ("DELETE FROM nomedatabela WHERE colunaespecífica=?", valorDaCelulaEspecifica) O ? indica que o valor está após a declaração do SQL. Você poderia colocar o valor direto no lugar do ?. Mas por alguma razão, as vezes isso gera erro. Além disso, se o valor da célula estiver em uma variável no seu script, você não pode declarar a variável no lugar do ?. Ali só pode ser o valor direto, pois a declaração SQL inteira se trata de uma string. Por isso o uso do ?, que está recebendo o valor da variável que está depois da vírgula. Obs: Para verificar se uma célula tem valor nulo, não se usa os operadores lógicos de ==, <= >=. Para isso, usa-se IS NULL ou IS NOT NULL. Ex: executeSQLQuery ("DELETE nomecoluna1,nomecoluna2 FROM nomedatabela WHERE nomecoluna3 IS NULL") Isso vai deletar todas as células da coluna 1 e coluna 2 onde a coluna 3 tem uma célula de valor NULL. Se a coluna 3 não tiver nenhuma célula de valor NULL, nada acontece. Inserir nova linha de valores: (ele vai criar automaticamente uma nova linha com novas células) executeSQLQuery ("INSERT INTO nomedatabela(nomecoluna1,nomecoluna2,nomecoluna3) VALUES(?,?,?)", valorCelulaColuna1, valorCelulaColuna2, valorCelulaColuna3) Neste caso, ele está inserindo 3 novos valores, cada valor em uma coluna. Se você não declarar os nomes das colunas, ele vai preencher na ordem das colunas automaticamente. Você pode deixar de declarar uma coluna se não quiser atribuir valor na célula daquela coluna. Se o tipo de valor da variável não for do tipo de dado daquela coluna, dará erro. Atualizar valores de células que já existem em uma tabela: (não é possível alterar os tipos de valores, é necessário editar o tipo da coluna se quiser fazer isso) executeSQLQuery ("UPDATE nomedatabela SET nomecoluna2=?,nomecoluna3=? WHERE nomecoluna1=?", valorCelulaColuna2, valorCelulaColuna3, valorCelulaColuna1) No caso acima, ele vai atualizar as células das colunas 2 e 3 onde o valor da célula da coluna 1 for igual ao valor de valorColunaCelula1. OBS: Nada impede que você coloque as primeiras variáveis junto à declaração SQL, mas para fazer isso você deve "cortar" a string, inserir as variáveis e depois continuar a string, Ex: executeSQLQuery ("UPDATE nomedatabela SET nomecoluna2= '".. valorCelulaColuna2 .."',nomecoluna3='".. valorCelulaColuna2 .."' WHERE nomecoluna1=?", valorCelulaColuna1) Lembrando que o valor destas variáveis também são strings na declaração, portanto use aspas simples antes e depois de cada corte para transformar os valores em string. Os dois pontos (..) significam que estes valores fazem parte do argumento SQL. Da mesma forma, se vc usar "1" .. "1", será igual a "11". (Por isso acho muito mais fácil deixar tudo ? na declaração SQL e colocar as variáveis todas após a string.) Selecionar determinadas células da tabela: (usado geralmente para obter os valores destas células para usar no script, você pode selecionar somente 1 célula ou várias) executeSQLQuery ("SELECT nomecoluna1,nomecoluna2 FROM nomedatabela WHERE nomecoluna3=?", valorCelulaColuna3) Neste exemplo, ele vai selecionar a célula da coluna 1 e a célula da coluna 2, na linha onde a célula da coluna 3 for igual a valorCelulaColuna3. Alterar a tabela (adicionar coluna nova) [SQLite não suporta deletar coluna nem editar tipo de coluna] executeSQLQuery ("ALTER TABLE nomedatabela ADD nomecoluna4 REAL") Devido a limitações do SQLite, ALTER TABLE não pode ser usado para deletar uma coluna nem para editar seu tipo. Para fazer isso é necessário recriar a tabela inteira com as novas alterações. No exemplo acima, ele vai adicionar uma nova coluna chamada "nomecoluna4". Tá, mas como ficaria tudo isso dentro de um script? Fiz um código com vários testes de banco de dados. Cada comando faz alguma coisa. É possível mexer em um banco de dados manualmente sem usar scripts? Sim, é possível. Eu mesmo costumo fazer isso para corrigir algumas coisas rápidas sem precisar programar mais nada. Para poder abrir os bancos de dados (internal.db e registry.db) você deve usar um programa chamado DB Browser for SQLite. Um programa gratuito, leve e bem fácil de entender. Nele você consegue acessar todas as tabelas do banco de dados e editar os valores como se fosse em uma planilha do Excel. Basta ir na aba Navegar dados, selecionar a tabela que deseja modificar, clicar em cima da célula cujo valor deseja atualizar, digitar o novo valor, clicar em Aplicar e depois clicar em Escrever modificações (salvar banco de dados). Pronto! E tem mais! Se você já tiver conhecimento avançado com a linguagem SQL, você também pode fazer alterações avançadas via código dentro do programa. Basta acessar a aba Executar SQL, escrever o comando SQL corretamente e depois clicar no botão de Play. Espero ter ajudado.
  6. Olá pessoal. Fiz um vídeo bem detalhado sobre os painéis CEGUI, abordando algumas das principais dúvidas e também algumas propriedades que podem ajudar muito na hora de criar um painel GUI. Recomendo que assistam com fones de ouvido, ou então que ativem as legendas no YouTube. Críticas, sugestões, opiniões, perguntas relacionadas ao vídeo, podem fazer por aqui ou então deixar nos comentários do vídeo. (Deu muitíssimo trabalho de produzir o vídeo, deixe seu like neste post e no vídeo. Se puder, se inscreva no canal e acompanhe a página Lord Henry Entertainment no facebook.) Links e funções que aparecem no vídeo em ordem de aparição: http://static.cegui.org.uk/docs/0.8.7/ guiGetScreenSize guiCreateWindow guiCreateButton http://static.cegui.org.uk/static/WindowsLookProperties.html guiSetProperty http://static.cegui.org.uk/static/WindowsLookProperties.html#FrameWindow http://static.cegui.org.uk/static/WindowsLookProperties.html#Button isMouseOnGUICloseButton Standard_GUI_Font_Names guiSetEnabled guiSetAlpha guiEditSetReadOnly guiEditSetMasked Tenham todos uma boa semana.
  7. Yesterday evening, I started my apprenticeship with db, I always wanted to learn, because with it, I can do mods, which I could not do without. My introduction with Database was done by adapting a System ID to the DB in the login panel. I did this using the server-side of my login panel. The first thing we do, is to use dbConnect (Wiki), which will make the connection to the db file. local db = dbConnect("sqlite", "db/royalusers.db") It will create the "db" folder, in the resource files, and inside the folder, the "royalusers.db" file. After that, we create a table using the SQL functions. local newTable = dbExec(db, "CREATE TABLE IF NOT EXISTS RoyalUsers (id INT, name TEXT, login TEXT, pass TEXT, serial TEXT)") RoyalUsers - Table-name id INT, name TEXT, login TEXT, pass TEXT, serial TEXT - columns of the table. INT - INTERNAL NUMBER Now the part of using the table defined in the database. function registerPlayer(user, pass, conf) if user == "" then outputLoginMsg(source, "Preencha todos os campos!", "error") else if pass == "" then outputLoginMsg(source, "Preencha todos os campos!", "error") else if conf == "" then outputLoginMsg(source, "Preencha todos os campos!", "error") else if conf == pass then addAccount(tostring(user),tostring(pass)) triggerClientEvent(source, "onRoyalRegister", source) local query = dbPoll(dbQuery(db, "SELECT * FROM RoyalUsers WHERE login=?", user),-1) if #query == 0 then dbExec(db, "INSERT INTO RoyalUsers VALUES (?, ?, ?, ?, ?)", countIDs(), getPlayerName(source), user, pass, getPlayerSerial(source)) end outputLoginMsg(source, "Conta criada com sucesso! Aguarde...", "success") if not getAccount(user, pass) then outputLoginMsg(source, "Esta conta já está sendo utilizada!", "error") end else outputLoginMsg(source, "As senhas não estão iguais.", "error") end end end end end addEvent("onPlayerRequestRegister", true) addEventHandler("onPlayerRequestRegister", root, registerPlayer) function countIDs() local table = dbPoll(dbQuery(db, "SELECT * FROM RoyalUsers"), -1) local count = 1 for i, result in pairs(table) do count = count + 1 end return count end The login variable returns a table, it selects (SELECT) all the columns of the table, and checks if the login defined in the function does not exist in it, if it does not exist, it will add those information, the columns of the table RoyalUsers (INSERT INTO). VALUES (?, ?, ?, ?, ?) - "?" It is the amount of arguments that will be used to insert into the column. countIDs() - Function that returns the number of IDs in the table, and adds one more. getPlayerName(source) - Gets the player's name, and adds the "name" column of the table. user - Adds the user defined in the function, the column "login". pass - Adds the password set in the function, the "pass" column. getPlayerSerial(source) - Gets the player's serial, and adds the "serial" column of the table. Having the part in which the data that the player registers, are saved in the database, this part is ready. Now, just set the ID added to the database login, when the player logs in. function loginPlayer(source, user, pass) if user == "" then outputLoginMsg(source, "Preencha todos os campos!", "error") else if pass == "" then outputLoginMsg(source, "Preencha todos os campos!", "error") else local account = getAccount(user, pass) if account then logIn(source, account, pass) local queryTable = dbPoll(dbQuery(db, "SELECT * FROM RoyalUsers WHERE login='"..getAccountName(getPlayerAccount(source)).."'"), -1) for i, id in pairs(queryTable) do setElementData(source, "ID", id["id"]) end setTimer(setCameraTarget, 3000, 1, source, source) setTimer(triggerClientEvent, 14000, 1, source, "renderRoyalID", source) triggerClientEvent(source, "onRoyalLogin", source) outputLoginMsg(source, "Logado com sucesso! Aguarde...", "success") else outputLoginMsg(source, "Usuário ou senha incorretos!", "error") end end end end addEvent("onPlayerRequestLogin", true) The queryTable gets all the columns of the table, where the login = login of the player. After that, we loop the tables returned by the queryTable, and set the date "ID" to the player, according to the ID returned from the table defined in the loop. I want to make it clear that the tutorial did not go well explained, I just want to share, what I learned yesterday, and if I did something wrong, please let me know. ❤️
  8. Hello, in this video i'll show you guys the easiest way of UVW Mapping. You can use this method on skins or objects. Make sure that the textures that you'll use are 64 * 64, 128 * 128, 64 * 128 etc. Let me know in the comments if you want more 3DS Max tutorials like this in the near future. I hope I could help!
  9. É um script de proteção de bases! Tipo, apenas quem está na acl ''MARINHA'' pode ir para a base da marinha brasileira, como faço pra mais de uma acl poder ir para essa base? SCRIPT: RestricLocation = {} TeleportLocation = {} EnabledAlarm = true ColCuboid = false --------------------------------------- CONFIGS -------------------------------------------- RestricLocation["location1"] = {-264.21362304688,3335.7004394531,1.1062507629395} -- Local 1 RestricLocation["location2"] = {775.92932128906,2741.86544785156,150.10624694824} -- Local 2 TeleportLocation = {1976.0953369141,-1924.1055908203,13.546875} -- Local de TP GroupName = "MARINHA" -- Nome da Gang ou Grupo ACL GroupNameBy = 2 -- 1 para Gang, e 2 para ACL MsgInvasao = "Base da MARINHA! Você não pode entrar aqui!" EnableVehicleGodMode = true -- Habilitar HabilitarAdmin = false -- Todos admins vao poder entrar na base GodMode = false -- Ao entrar na área protegida, habilita GodMode NaoAtirar = false -- Ao entrar na área protegida, não podera atirar --------------------------------------- CONFIGS -------------------------------------------- function sendMsg(iplayer,msg) outputChatBox ( msg, iplayer, 255, 0, 0, true ) end function EnterPlace ( theElement ) local veh = getPedOccupiedVehicle(theElement) local accName = getAccountName(getPlayerAccount(theElement)) if HabilitarAdmin == true then if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) ) then return end end if (getElementType ( theElement ) == "player") and (PlayerHaveLevel (theElement) == false) then sendMsg(theElement,MsgInvasao) if veh then setElementPosition( veh, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) else setElementPosition( theElement, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) end sendMsgOwners(theElement) elseif getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,true) end end function ExitPlace ( theElement ) if GodMode == true then setElementData(theElement,"blood",12000) end if NaoAtirar == true then toggleControl(theElement, "fire", true) toggleControl(theElement, "vehicle_fire", true) toggleControl(theElement, "vehicle_secondary_fire", true) toggleControl(theElement, "aim_weapon", true) end if getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,false) end end function PlayerHaveLevel( PlayerID ) if GroupNameBy == 1 then if ( getElementData ( PlayerID , "gang" ) == GroupName ) then if GodMode == true then setElementData(PlayerID,"blood",999999999999999) end if NaoAtirar == true then toggleControl (PlayerID, "fire", false) toggleControl (PlayerID, "vehicle_fire", false) toggleControl (PlayerID, "vehicle_secondary_fire", false) toggleControl (PlayerID, "aim_weapon", false) end return true else return false end else local accName = getAccountName ( getPlayerAccount ( PlayerID ) ) if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName ) ) ) then if GodMode == true then setElementData(PlayerID,"blood",999999999999999) end if NaoAtirar == true then toggleControl (PlayerID, "fire", false) toggleControl (PlayerID, "vehicle_fire", false) toggleControl (PlayerID, "vehicle_secondary_fire", false) toggleControl (PlayerID, "aim_weapon", false) end return true else return false end end end function ResourceStart( ) LoadLocations() CreateCollision() end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ),ResourceStart) function LoadLocations() local RX, RY, RZ, WRX, WRX, WRX if(RestricLocation["location1"][1] > RestricLocation["location2"][1]) then RestricLocation["maxx"] = RestricLocation["location1"][1] RestricLocation["minx"] = RestricLocation["location2"][1] else RestricLocation["maxx"] = RestricLocation["location2"][1] RestricLocation["minx"] = RestricLocation["location1"][1] end if(RestricLocation["location1"][2] > RestricLocation["location2"][2]) then RestricLocation["maxy"] = RestricLocation["location1"][2] RestricLocation["miny"] = RestricLocation["location2"][2] else RestricLocation["maxy"] = RestricLocation["location2"][2] RestricLocation["miny"] = RestricLocation["location1"][2] end if(RestricLocation["location1"][3] > RestricLocation["location2"][3]) then RestricLocation["maxz"] = RestricLocation["location1"][3] RestricLocation["minz"] = RestricLocation["location2"][3] else RestricLocation["maxz"] = RestricLocation["location2"][3] RestricLocation["minz"] = RestricLocation["location1"][3] end end function CreateCollision() RX = RestricLocation["minx"] WRX = RestricLocation["maxx"] - RestricLocation["minx"] RY = RestricLocation["miny"] WRY = RestricLocation["maxy"] - RestricLocation["miny"] RZ = RestricLocation["minz"] WRZ = RestricLocation["maxz"] - RestricLocation["minz"] ColCuboid = createColCuboid ( RX, RY, RZ, WRX, WRY, WRZ ) if ColCuboid then addEventHandler ( "onColShapeHit", ColCuboid, EnterPlace ) addEventHandler ( "onColShapeLeave", ColCuboid, ExitPlace ) else outputDebugString("Erro, verifique: location1 e location2") end end function ResourceStop( ) destroyElement ( ColCuboid ) end addEventHandler( "onResourceStop", getResourceRootElement( getThisResource() ),ResourceStop) function sendMsgOwners( PlayerID ) local connectedPlayers = getElementsByType ( "player" ) for i, aPlayer in ipairs(connectedPlayers) do if(PlayerHaveLevel (aPlayer) == true) then sendMsg(aPlayer," O Jogador " ..getPlayerName ( PlayerID ) .." esta tentando invadir a sua BASE !") end end end function SetVehicleGodMode( VehicleID, godEoD ) if EnableVehicleGodMode == true then setElementData(VehicleID, "godmode", godEoD) setVehicleDamageProof (VehicleID, godEoD ) end end
  10. Hola! Desde hace un tiempo, he comenzado a subir vídeo tutoriales de manera esporádica en mi canal de YouTube, en respuesta a consultas que me hacen algunos usuarios tanto por aquí como por mi pagina de facebook. El dia de hoy, traigo un tutorial de "Nivel Medio". Que trata sobre, Como obtener una imagen de una URL y usarla en MTA. Espero les guste y les ayude un poco ¡Un saludo! Cualquier otro tutorial que deseen que haga, me dicen ya sea por este foro (mensaje privado) o por mi pagina de facebook. O directamente en los vídeos de YouTube.
  11. Hola, el dia de hoy traigo un aporte algo sencillo, trata de un tutorial de como proteger tus recursos de una forma básica, para evitar robos de tus scripts. Espero os ayude mucho! Subo este vídeo, en respuesta a varias personas que han pedido agregar un medio de seguridad para que el recurso no funcione fuera de su servidor.
  12. olá pessoal tudo bem? então hoje estou aqui para ensinar para novatos(como eu) como fazer um teleporte simples apenas usando funções básicas,é bem fácil de aprender. Antes de começar quero especificar e mostrar algumas funções que vou usar nesse script; setElementInterior coloca o elemento especificado em um interior. setElementDimension coloca o elemento especificado em uma dimenção. setElemenPosition coloca o elemento especificado em uma posição. Primeiro script,ele vai te colocar na posição quando digitar /tp. function tele (source) setElementPosition(source, 2434.6015625, -1670.6728515625, 13.574823379517) --cordenadas da posição pra onde você vai ser teletransportado. end addCommandHandler("tp",tele) Esse vai te colocar em uma dimenção e uma posição quando digitar /tp. function tele (source) setElementDimension(source, 69) --dimenção pra onde você vai ser teletransportado. setElementPosition(source, 2434.6015625, -1670.6728515625, 13.574823379517) --cordenadas da posição pra onde você vai ser teletransportado. end addCommandHandler("tp",tele) E esse vai te colocar em uma dimenção,interior e uma posição no mesmo. function tele (source) setElementDimension(source, 54) --dimenção pra onde vai. setElementInterior(source, 5) --interior pra onde vai. setElementPosition(source, 220.7998046875, 150.158203125, 1003.0234375) --posição pra onde vai dentro do interior. end addCommandHandler("tp",tele) para mais tutoriais como esse pode encontrar nesse canal do youtube(que não é meu): https://www.youtube.com/channel/UCSUVTVl3JRWwltBraVV34ow/videos
  13. Hello MTA Community! I'm happy to announce the start of 'Writing a Roleplay Gamemode From Scratch' chapters in my youtube channel. The first chapter is already released, check it out below! Don't forget to subscribe in order to be notified when new content is uploaded and also let a comment with your opinion and aspects that should be improved!
  14. Hello any1 knows how to add more guns on server? I have dayz server and i would like to get some help. Just tell me here or contact me if you know how to script.
  15. Hello guys, i recently setuped up my own dayz server, but i need to add like more vehicles i have some vehicles.lua and there are cars adn ther x,y,z i guess its spawn how can i add more? or can some1 just give me some pre-scripted vehicles.lua so i dont have to type it or something? i want more cars on my server basicaly , which players can find and get
  16. بسم الله الرحمن الرحيم السلام عليكم ورحمة الله وبركاته اليوم سأشرح لكم الأحداث ماهي الأحداث؟ الأحداث هي نظام تم برمجة لتشغيل الوظائف عندما يحدث شيء مثل دخول الاعب الماركر او دخول الاعب السيرفر والخ... يتم ربط هذا النظام في نظام الالمنت كيفية استخدام هذا النظام؟ addEventHandler لكي تقوم باستخدام هذا النظام عليك اولا ربط الوظيفة في الاعب عند طريق وعند القيام بذلك سوف تقوم الوظيفة بعملها على الالمنت المربوط بالوظيفة children, parent لكن عندما يكون الالمنت لديه صلة بالمنت اخر سواء كان سوف اشرح هذه الصلة في درس اخر عند استقبال حدث ما يتم تعريف متغيرات مخفية وهذه هي قائمة المتغيرات source : مصدر الحدث وهو الالمنت الذي تم ربط الحدث به eventName : (onPlayerQuit)اسم الحدث مثل this : الالمنت الذي تم ربطه بالوظيفة المستقبلة للحدث جميع الوظائف أعلاه بجانب السيرفر والكلنت وهناك ايضا متغير مخفي فقط في السيرفر client : هو الاعب الذي تم ارسال الحدث من جهته انتهينا من المتغيرات المخفية الآن ننتقل الى العوامل في الوظيفة المستقبلة ليس هناك نوع محدد من العوامل لكن لكل وظيفة عوامله الخاصة إذا كيف اقوم بمعرفة العوامل في الحدث paramaters اذهب إلى صفحة الويكي الخاصة بالحدث وقم بإيجاد قسم كما بالصورة التالية بالصورة تجد العوامل محددة بالمربع الأحمر ملاحظة : قد لا يوجد عوامل في بعض الاحداث لذا راجع الويكي لكي تعرف الوظيفة إذا لننتقل إلى المرحلة التالية هناك نوعين من الأحداث نوع مخصص مسبقا اي انه لا داعي لتشغيله - نوع يتم تخصيصه برمجياً اي أنه يتم تشغيه - كيفية استخدام النوع الأول أولا عليك معرفة الحدث اللي تريد استخدامه والذي خصصه فريق ام تي اي للاستخدام تجدها هنا https://wiki.multitheftauto.com/wiki/Client_Scripting_Events https://wiki.multitheftauto.com/wiki/Server_Scripting_Events النوع الأول مخصص للكلنت والنوع الثاني مخصص للسيرفر الآن سنشرح كيف تقوم باستقبال حدث addEventHandlerلكي نقوم بإستقبال حدث ما علينا استخدام علينا ان نشرح كيف نقوم بتركيب الجملة لدى هذه الوظيفة bool addEventHandler ( string eventName, element attachedTo, function handlerFunction, [ bool getPropagated = true, string priority = "normal" ] ) الارقمنات المطلوبة eventName: اسم الحدث المراد استقباله attachedTo: الالمنت المراد ربطه باستقبال هذا الحدث مثلا اذا كنت تريد للاعب محدد دخول ماركر يجب عليك وضعه هنا لكي يقوم باستقبال (root)الحدث لدى هذا الاعب فقط واذا كنت تريد لجميع الاعب استخدم الالمنت العام handlerFunction: الوظيفة المراد تشغيلها عند استقبال هذا الحدث الارقمنات الاختيارية getPropagated: اذا كنت تريد تشغيل هذا الحدث لدى جميع فروع هذا الالمنت ضعها قيمة صحيحة واذا كنت تريد ضعها خاطئة سأشرحها في درس أخر priority : أولية استقبال هذا الحدث اذا كان هناك حدث تريد استقباله بنفس الطريقة وتريد ان يبدا مثلا باستقبال هذا اولاً وهكذا هناك قيم عليك وضعها ولكل منها عمل خاص "high" "normal" "low" ويمكن وضعها بارقام مثلا low-999 high-999 low+999 اي قيمة رقم لكن يجب ان تكون ال- او + لاغير والآن شرحنا كيفية تركيب الجملة وهكذا onPlayerQuitلنختار حدث (هذا الحدث يقوم بالعمل اذا الاعب خرج من السيرفر(اي لاعب لكي نقوم باستقبال هذا الحدث ومعرفة من خرج من السيرفر يجب استخدام وظيفة addEventHandler("onPlayerQuit", root, function(quitType, reason, responsibleElement) outputChatBox(getPlayerName(source)) -- نقوم بكتابة اسم الاعب اللي خرج -- outputChatBox : اخراج نص بالشات -- getPlayerName : احضار اسم لاعب ما -- source : مصدر الحدث وهو الاعب الذي خرج من السيرفر outputChatBox(quitType) -- كتابة سبب الخروج بالشات if reason then -- نقوم بالتحقق ان هناك سبب outputChatBox(reason) -- كتابة سبب الخروج بالشات -- reason : هو سبب اعطاء الكيك او الباند، سوف يعطيك قيمة فولس اذا كان نوع الخروج ليس باند او كيك end if isElement(responsibleElement) and getElementType(responsibleElement) == "player" then -- نتحقق ان الالمنت اللذي قام بإعطاء كيك او باند لاعب ان نوعه هو لاعب outputChatBox(responsibleElement) --(الشاشة السوداء او اف 8) كتابة الاعب الذي قام بإعطاء الاعب كيك او باند قد يكون كونسل -- لكن نحن تحققنا مسبقاً انه لاعب end end) الآن شرحنا كيفية استخدام النوع الأول الآن النوع الثاني مالفائدة من النوع الأول؟ الفائدة تكمن اذا كنت تريد ارسال حدث خاص بك الى السيرفر او الكلنت او الجهة نفسها اللي تم ارسالها منها ولك مثال مشهور جدا وهو لوحة التسجيل لكي تقوم بعمل لوحة تسجيل عليك استخدام لوحة بالكلنت وتسجيل الدخول بالسيرفركيف اقوم بالربط؟ نعم نعم هذه هي الفائدة منها كيف الاستخدام؟ لكي تقوم بارسال حدث يجب عليك استخدام الوظائف الثانية triggerServerEvent : وظيفة تقوم بتشغيل الحدث من جهة الكلنت الى السيرفر اي لايمكن استخدامها الا بالكلنت bool triggerServerEvent ( string event, element theElement, [arguments...] ) الارقمنات المطلوبة event : اسم الحدث المراد تشغيله theElement : الالمنت هو مصدر الحدث(السورس) الارقمنات الاختيارية arguments : العوامل المراد ارفاقه مع الحدث انظر الشرح فوق لتفهم triggerClientEvent : وظيفة تقوم بتشغيل الحدث من السيرفر الى الكلنت وايضا هي وظيفة سيرفر اي لايمكن تشغيلها الا بالسيرفر bool triggerClientEvent ( [table/element sendTo=getRootElement()], string name, element sourceElement, [arguments...] ) sendTo: القيمة الافتراضية لهذا الارقمنت هو الروت واذا كنت تريد لاعب محدد ترسل اليه الترايقر ضع هذا الاعب وهكذا واذا كنت تريد وضع لاعبين محددين ضع جدول به الاعب وضعه بهذا الارقمنت (ارقمنت اختياري طبعاً) name : اسم الحدث المراد تشغيله بالكلنت sourceElement : مصدر او سورس هذا الحدث arguments : العوامل المراد ارفاقه مع الحدث انظر الشرح فوق لتفهم اختيارية طبعاً triggerEvent : تقوم هذه الوظيفة بتشغيل حدث من الجهة نفسها اي انه اذا تم تشغيلها ممن السيرفر يتم استقبالها بالسيرفر وههكذا ويعني انها وظيفة بكلها الجانبين سيرفر والكلنت لكن الاستقبال بنفس الجهة bool triggerEvent ( string eventName, element baseElement, [ var argument1, ... ] ) eventName : اسم الحدث المراد تشغيله baseElement : مصدر او سورس هذا الحدث , [ var argument1, ... ] : العوامل المراد ارفاقه مع الحدث انظر الشرح فوق لتفهم اختيارية طبعاً الآن نريد ان نعطيك مثال مثلا نريد ان نرسل حدث يقوم بالتأكد أن اي مود انتهى تحميله او لا اولا يجب وضع الكود الذي يقوم بارسال هذا الحدث الى السيرفر addEventHandler("onClientResourceStart", root, function(res) -- استقبال حدث اذا المود اشتغل triggerServerEvent("onPlayerClientResourceLoaded", localPlayer, res) -- ارسال حدث حدث ليتم استقباله بالسيرفر end) الآن نستقبله جانب السيرفر لكن لم اشرح كيف اقوم بتسجيل هذا الحدث بقائمة الأحداث طبعا سنحتاج وظيفة addEvent يتبع...