Leaderboard
Popular Content
Showing content with the highest reputation on 29/01/22 in all areas
-
I often see how people are trying to start server using really strange solutions. So I thought "I need to make a good tutorial", let's get it! You need a Linux server (I use Debian 10) and installed the server. Usually I put the server in /opt directory, in this tutorial we do it same. Part One: Installing the server Let's start to install pure Multi Theft Auto linux server. As a joke from bashorg said: "it only takes three commands to install Gentoo", you have to put only two commands apt install unzip wget https://linux.multitheftauto.com/dl/multitheftauto_linux_x64.tar.gz && \ tar xvf multitheftauto_linux_x64.tar.gz && \ rm multitheftauto_linux_x64.tar.gz &&\ cd multitheftauto_linux_x64/mods/deathmatch/ && \ wget https://linux.multitheftauto.com/dl/baseconfig.tar.gz && \ tar xvf baseconfig.tar.gz && \ mv baseconfig/* . && \ rm -rf ./baseconfig/ && \ mkdir resources && cd resources && \ wget https://mirror.multitheftauto.com/mtasa/resources/mtasa-resources-latest.zip && \ unzip mtasa-resources-latest.zip && \ rm mtasa-resources-latest.zip && \ cd ../../../ && chmod +x ./mta-server64 putty_xjovvhDRiG.mp4 What are about these commands? Downloading and unpacking mta server binaries Downloading and unpacking default configs Downloading and unpacking resources Part 2: Daemonization Many of tutorials was written when systemd isn't exists. But not today. Let's make a systemd unit. Before we're starting to do it, we need to check one thing. Basically MTA Server has ncurses UI, that's can be inconvenient for daemons, so we have to check flags. Okkay! We take them all! There are a lot of guides how to make different systemd units, but I've made the config for you. You only need to put the file into /etc/systemd/system/multitheftauto.service [Unit] Description=Multi Theft Auto Dedicated server After=network.target StartLimitIntervalSec=0 [Service] Type=simple Restart=always RestartSec=1 User=root WorkingDirectory=/opt/multitheftauto_linux_x64 ExecStart=/opt/multitheftauto_linux_x64/mta-server64 -t -n -u [Install] WantedBy=multi-user.target And make systemd reload the configs Need video? putty_QR8ebBKoVy.mp4 Seems like you're done all of my steps. What's next? There are good commands for management the unit 1. journalctl -u multitheftauto -n -f 2. systemctl enable multitheftauto 3. systemctl stop multitheftauto 4. systemctl restart multitheftauto 5. systemctl start multitheftauto 6. systemctl status multitheftauto 1. Reads logs in the stream 2. Enable the unit (after rebooting the server the unit will start) 3,4,5 Stop/restart/start the unit (the server) 6. Status of the unit (is it running? Stopped? and last lines from the std out) More info you may read here: https://www.freedesktop.org/software/systemd/man/journalctl.html and here: https://www.freedesktop.org/software/systemd/man/systemctl.html5 points
-
منشور قديم... لكن اشتقنا للاعضاء!2 points
-
1 point
-
1 point
-
actually you don't need some lines here like getPlayerAccount because the onPlayerLogin event carries the account you are logged into so change it like this function afterlogin(_,account) -- this account local SkinData = dbPoll(dbQuery(db,"SELECT Account,Skin,ID FROM SkinShop"), -1) --local account = getPlayerAccount(source) -- no need this local accName = getAccountName(account) if (SkinData) and (SkinData[1]) and (SkinData[2]) then if (SkinData[1].Account == tostring(accName)) then setElementModel(source, SkinData[2].Skin ) end end end addEventHandler("onPlayerLogin",root, afterlogin)1 point
-
1 point
-
This varies according to the resource you use. Since you do not show the code, I will explain the logic, but if you have a save system, you may need to write more code than that. you can call the savePlayerDefaultSkin function before the job starts and when the job is finished you can call the loadPlayerDefaultSkin function local playerDefaultSkin = {} -- define storage for player default skins function savePlayerDefaultSkin(player) playerDefaultSkin[player] = getElementModel(player) --save player model to table end function loadPlayerDefaultSkin(player) if(playerDefaultSkin[player]) then setElementModel(player, playerDefaultSkin[player]) -- load skin from table playerDefaultSkin[player] = nil -- remove from table we don't need anymore end end addEventHandler("onPlayerQuit", root, function() playerDefaultSkin[player] = nil --delete player skin from game completely from memory end )1 point
-
hi if you using database you must wrote the function that update your previous saved skin model data in database after leaving or changing job or faction1 point
-
1 point
-
1 point
-
I don't know much about database, if you want, ask someone else about this I don't want to give you wrong information.1 point
-
،وعليكم السلام ،إذا كان معاك فترة طويلة غالبًا أي، لكن متأكد المشكلة 100% من الهارد نفسه؟ تأكد إن مثلًا الأسلاك يلي توصله ما خربت .وحاول تجرب تشغله على جهاز ثاني عشان تتأكد أكثر، في حال اشتغل يعني عندك مشكلة بالبايوس. أو لو عندك وصلة تركبه بمنفذ اليو اس بي جرب SSD جرب توديه بعض المحلات بعض الأحيان فيه إمكانية يتصلح أو يقدر يرجع بعض الملفات أحيانًا، لكن لو ،HDD لو كان ما أعتقد (ممكن اكون خطأ لكن هذا يلي اعرفه من واقع تجربة)1 point
-
I think I forgot this part, I edited the code above again local accName = getAccountName(account)1 point
-
I think here it gives a warning message because something other than the player element enters the marker. You can check it with getElementType function BuySkin159 (theplayer) if(getElementType(theplayer) ~= "player") then return end -- if theplayer not player stop continue local account = getPlayerAccount(theplayer) local skinprice = 5000 if(account) then -- Does the player have an account? if(isGuestAccount(account)) then return end -- if account guest account stop continue local accName = getAccountName(account) if getPlayerMoney(theplayer) >= skinprice then takePlayerMoney(theplayer, 5000) setTimer(function() fadeCamera(theplayer,true) setElementModel(theplayer, 159) local ID = getFreeID() local skinid = 159 local myData = dbExec(db,"INSERT INTO SkinShop VALUES (?, ?, ?)",ID,accName,skinid) skin = getElementModel(theplayer) outputChatBox("#00ff00 [Done]: #ffffffskin shoma be id #ff0000"..skin.."#ffffff taghir kard",theplayer, 255,255,255,true) end,1000,1) fadeCamera(theplayer,false) end end end addEventHandler("onMarkerHit", marker1, BuySkin159)1 point
-
1 point
-
Se o seu MTA crasha na inicialização ou durante o jogo, primeiro você deve visitar a lista de tipos de crash conhecidos (link) ou por meio do spoiler no final deste post e procure pelo crash correspondente ao seu offset (exemplo: "Offset = 0x003F0BF7"> copie e procure por 0x003F0BF7). Caso seu crash específico esteja listado na tabela, o motivo desse crash e as informações de solução são fornecidas nessa página, logo após o offset. Observação: a maioria das pessoas pensará "Ah não, provavelmente não é relevante para mim", mas crashs listados com motivos conhecidos, juntos, representam 85% de todos os crashs do MTA em todo o mundo, e a maior parte do suporte é solicitada para crashs já esclarecidos. Portanto, para obter uma correção mais rápida, recomendamos realmente seguir esta etapa. Se seu crash não estiver listado, baixe e execute o MTADiag e siga as instruções. Se o MTADiag não for executado para você, baixe e instale o Visual C++ 2017 runtimes (usando este link, o download é iniciado automaticamente) Em seguida, crie um tópico nesta seção (Ajudas relacionadas ao MTA:SA (Cliente/Servidor)) e publique qualquer URL do Pastebin que o MTADiag fornecer a você. Se por algum motivo o MTADiag não funcionar, faça o seguinte antes de criar um novo tópico: Instale a última versão do MTA:SA Instale a última versão do DirectX runtime, usando a opção para instalá-lo automaticamente, que deve ser habilitada bi instalador do MTA. Se instalá-los não resolver o problema, tente: Exclua o arquivo gta_sa.set localizado em GTA San Andreas User Files em sua pasta/biblioteca de Documentos (usuários do Windows Vista e 7) ou o diretório Meus Documentos (usuários do Windows XP) Verifique no diretório de instalação do GTA San Andreas se há o D3D9.dll. Se estiver presente, exclua-o. Certifique-se de que sua instalação do GTA San Andreas não seja modificada de forma alguma. Se for - desinstale e reinstale o GTA San Andreas antes de instalar o MTA: San Andreas. Embora o MTA possa lidar bem com a maioria dos mods, isso excluirá a chance de que algum mod esquisito esteja causando problemas sem que seja necessário um longo processo de solução para determinar qual mod específico é o culpado. Observe que quanto mais (tipo de) mods você tiver, maior será o risco de problemas de estabilidade; O MTA tem uma alta tolerância para coisas com as quais não foi projetado para ser compatível, mas tem seus limites. Não podemos garantir suporte se você estiver usando uma instalação modificada enquanto tiver problemas. Inclua também quaisquer mensagens de erro que possam aparecer quando o MTA:SA crashar; copie e cole o log de crash ou tire um print/screenshot. Obrigado! Observação: se você quiser ler mais sobre o MTADiag ou relatar problemas ao usar esta ferramenta, acesse aqui: https://forum.multitheftauto.com/topic/32071-mtadiag-diagnostic-tool-for-mtasa-support-section-information/ Tópico original criado em inglês aqui, graças ao Towncivilian! A página da wiki está offline? Você também pode ver as informações no spoiler abaixo:1 point
-
Atualizei o post com o link direito para a tradução de toda a página da Wiki, mas mantive os crashs dentro spoiler para que ainda seja possível a verificação caso a Wiki esteja offiline.1 point
-
hello, you should add some code to the client side as an extra showServerInfo = true settings = { ["showserverinfo"] = nil, defaultSettings = { ["showserverinfo"] = true, i think you are using dxscoreboard,you can do it better than this site Dxscoreboard1 point
-
your server needs a save system, it needs to save colors setAccountData,getAccountData etc.1 point
-
As ps2 gta sa graphics fan as I am, I am really enjoying playing with SkyGFX mod in singleplayer. So I've tried to run it with MTA and ofcourse I can't cause of ASI scripts. Is there a way for porting at least a half of this mod like original orange color scheme I'll be happy, every pseudo ps2 timecyc mod and ENB's I have tried are nothing in comparison with original PS2 San Andreas post processing technique used in SkyGfx. Looking at how many players are enjoying original post-process effects in PC version, I think it will be very well received. Here is this mod, if you want to look at it: http://gtaforums.com/topic/750681-skygfx-ps2-and-xbox-graphics-for-pc/1 point
-
local function playerChat(message, messageType) if messageType == 0 then --Global (main) chat cancelEvent() local red, green, blue = getPlayerNametagColor(source) outputChatBox(getPlayerName(source)..": #FFFFFF"..message, root, red, green, blue, true ) outputServerLog("CHAT: "..getPlayerName(source)..": "..message) end end addEventHandler("onPlayerChat", root, playerChat)1 point
-
function guardarAuto() player = source local veh = getNearestVehicle(player,5) or Ped.getOccupiedVehicle(player) if (veh) then local acc = player:getAccount() local owner = acc:getName() local location = player:getPosition() local rotation = player:getRotation() local int = player:getInterior() local dim = player:getDimension() local loc = toJSON({location.x,location.y,location.z}) local rot = toJSON({rotation.x,rotation.y,rotation.z}) if (veh:getData("vehicles:owner") == owner) then local id = getElementData(veh, "vehicles:id") end end end) addEventHandler("onPlayerQuit", root, guardarAuto) Can you try this1 point
-
this code will work when you hit all the markers in the game only if you want it for the shop menu, check it with the marker hit by the player with the for loop other than that, your code looks good, there is no problem example: addEventHandler("onPlayerMarkerHit", root, function(markerHit, matchingDimension) for id,marker in pairs(_marker) do -- only for shop markers if(markerHit == marker.marker) then outputChatBox("Presiona la H para acceder al panel", source) end end end )1 point
-
If you want to do this with the key, you will need to do a little more code. You have to bind the key both when you start the resource and when a new player enters the game. server: addEventHandler("onResourceStart", resourceRoot, function() for _,player in ipairs(getElementsByType("player")) do -- pull all players when resource starts bindKey(player, "B", "down", toggleCarShopMenu) -- bind the b key to the toggleCarShopMenu function for this player end end ) addEventHandler("onPlayerJoin", root, function() bindKey(source, "B", "down", toggleCarShopMenu) -- bind b key to toggleCarShopMenu function for newly joined player end ) function toggleCarShopMenu(player) for id,marker in pairs(_marker) do if(isElementWithinMarker(player, marker.marker)) then -- Is the player inside any marker found in this loop? triggerClientEvent(player, "vehicles:CarshopShowMenu", player, marker.marker:getData("vehicles:shop_name"), marker.marker:getData("vehicles:shop_data"), marker.marker:getData("vehicles:name"), marker.marker:getData("vehicles:price")) -- if so call menu break -- break loop end end end1 point
-
To do this, you can lock and export the file in 3ds max. There are different programs in txd or you can have a look at this topic. https://forum.multitheftauto.com/topic/131845-model-encrypter-protect-your-models-dff-txd-col/ if you are looking for a way to load the file without downloading it sorry i don't know that1 point
-
1 point
-
Basicamente salvar uma tabela usada nos códigos lua diretamente no SQL dá ruim, o toJSON e fromJSON servem para fazer essa conversão. Aqui o exemplo de um sistema de inventário, onde quando o player sai do servidor, o inventário dele (que é uma tabela) é convertido usando o toJSON e depois hospedado no SQLite: function onQuit() local id_ = getElementData(source, "ID") local inv_ = toJSON(inventario[source]) executeSQLQuery("UPDATE inventario_players SET inv=? WHERE id=?", inv_, id_) end addEventHandler("onPlayerQuit", root, onQuit) E agora para pegar a tabela no SQLite quando o player logar no servidor, convertê-la e setar como o inventário do jogador: function onLogin() local id_ = getElementData(source, "ID") local data = executeSQLQuery("SELECT inv FROM inventario_players WHERE id=?", id_) inventario[source] = {} inventario[source] = fromJSON(data[1]["inv"]) end addEventHandler("onPlayerLogin", root, onLogin)1 point
-
Very nice system. I wonder where you found those awesome looped sounds? I've searched everywhere for them but can't seem to find them on the web.1 point