Leaderboard
Popular Content
Showing content with the highest reputation on 10/05/17 in all areas
-
Yes there's a solution for ''pub other servers'' you named (advertising servers) get it here: https://community.multitheftauto.com/index.php?p=resources&s=details&id=13376 It blocks advertisements, code; local BannedWords = {"22003", ":22", "22010", "22005", "tasa:"} addEventHandler("onPlayerChat",root, function(msg) function checkBannedWords(Message) for _, BannedWord in ipairs(BannedWords) do if (Message:lower()):find(BannedWord:lower()) then return 2 end end local Chunks = {(Message:gsub("%s+", "")):match("(%d+)%.(%d+)%.(%d+)%.(%d+)")} if (#Chunks == 4) then return 1 end return 0 end -- Definitions -- 1 = Might be an advert -- 2 = Confirmed advert local result = checkBannedWords(msg) if (result == 1) then cancelEvent() outputChatBox("Your Message was detected as potential server advert and you're in trouble now if true.", source, 255, 0, 0) outputServerLog("[SUSPECT-ADVERTISING] " .. getPlayerName(source) .. " (tried to) output '" .. msg .. "'") local _players = getElementsByType("player") for _, v in pairs(_players) do if (getPlayerAccount(v)) then if ((isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Admin"))) or (isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Moderator")))) then outputChatBox("[SUSPECT-ADVERTISING] " .. getPlayerName(source) .. " (tried to) output '" .. msg .. "'", v) end end end elseif (result == 2) then cancelEvent() local g_Name = getPlayerName(source) local _r,_g,_b = getPlayerNametagColor(source) outputChatBox( g_Name .. ":server-advertiser " .. ' was detected and temporarily banned' , g_Root, _r, _g, _b, false) banPlayer ( source, false, false, true, nil, "Don't advertise other servers, you got an 1-day ban for it now.", 86400 ) end end ) when I thought of that, it didn't exist and I hadnt seen any anti-advert scripts at servers, while it's a growing and widespread problem. It blocks both by a filter list of words only used in server advertisements, but also logs/warns and prevent IP addresses in chat. But that's just 1 side of your problems. You can make the serverside script so heavily integrated with the client compiled ones, that making a stolen .luac usable takes far too much effort or becomes impossible. Also the no-cache option suggested before reduces it. However you can never stop others from cloning your scripts (written from scratch but looking and doing exactly the same as your scripts) however from that point it's not much related to your banlist.. it's just that you can never be assured. @TorNix~|nR2 points
-
@Pedro861, ele quer setar a skin somente em quem usar o comando /skin, no caso ele mesmo. Desse jeito que vc colocou vai setar a skin em todo mundo que for Admin. Do jeito que o @DNL291 fez é o correto, se o jogador que usar o comando não for do EB, mostra a mensagem de erro em vermelho. Caso contrario, seta a skin nele. Outro jeito de fazer, que no fim das contas é a mesma coisa, pode ser assim: function darSkin (thePlayer) local nomeAcc = getAccountName (getPlayerAccount (thePlayer)) --Variável 'nomeAcc' recebe a conta de quem executou o comando. (no caso, a sua conta) if isObjectInACLGroup ("user."..nomeAcc, aclGetGroup("EB")) then --Se o jogador que executou o comando estiver na ACL "EB", faz o seguinte: setElementModel (thePlayer, 287) --Coloca skin 287 nele. else --Se não estiver na ACL "EB", faz o seguinte: outputChatBox ("Somente membros do #00BB00Exercito Brasileiro#FF0000 podem pegar a skin!", thePlayer, 255, 0, 0, true) --Manda isso em vermelho, onde "Exército Brasileiro" fica em verde e o resto vermelho. Manda isso somente para quem executou o comando. end --Finaliza o If e o Else. end --Finaliza a função darSkin. addCommandHandler ("skin", darSkin) --Executa essa função quando alguém usa o comando /skin. Qualquer dúvida, volte a perguntar. Boa sorte.2 points
-
Add an export clientside to call the server, and then trigger the event to the client to fix this. Delaying it can still be unpredictable due to the download rate of the client1 point
-
Just get the mods from the source (dff and txd files) and use this script to replace default weapons with mod: (clientside) function replaceWeapon() txd = engineLoadTXD ( "m4.txd" ) engineImportTXD ( txd, 356) dff = engineLoadDFF ( "m4.dff", 356) -- use weapon model ID, not weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 356) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) Example code, change into your dff/txd mod file names and change model ID to weapon you're replacing.1 point
-
1 point
-
Надеюсь на помощь в предоставлении хоть какого-то материала. Из всех интересных проектов знаю только: SAS-Network, SAES-RPG, FFS.1 point
-
function giveBombToRandomPlayer() local teamElement = getTeamFromName ("Terrorists") local teamMembers = {} if isElement(teamElement) then for k, p in ipairs(getPlayersInTeam(teamElement)) do if getElementDimension(p) == 0 then table.insert(teamMembers, p ) end end else outputChatBox("Team is not available") return end if(teamMembers and #teamMembers > 0 then) local randomIndex = math.random(1, #teamMembers) -- get a random index: between 1 and the length of the table local randomPlayer = teamMembers[randomIndex] -- we already have a random index, now get it from the table setTimer(function() if not isElement(randomPlayer) then -- there's a 6 seconds timer here, there's a chance the terrorist we picked got disconnected, if so, find a new one outputChatBox("Player is no longer available, finding new player...") giveBombToRandomPlayer() return end outputChatBox("You have the bomb!", randomPlayer, 255, 0, 0) outputChatBox("Remember when you enter site.. switch to the C4 to plant!", randomPlayer, 255, 0, 0) giveWeapon ( randomPlayer, 14,1,true) end,6000,1) else outputChatBox("Couldn't find any Terrorists") end end That should work1 point
-
دعنا لا نتكلم الان ونفعل مشاجرة معه بحسب القوانين الموجودة فهو ممنوع لذا فلنصمت وننتظر رد المشرف الخاص بالمواضيع حتى يناقشه ويصحح من اسلوبه ولكي لا ناخذ حضر ايضا1 point
-
بم يا إلهي ، نص اللي ف المنتدى صار يكرهه من تصرفاته حقت الأطفال نهايته شكوى وباند1 point
-
انت هذه الايام تتفاخر بنفسك ههه بانك مبرمجا انت لست مبرمجا يا هذا تعلم لغة الاسمبلي ثم قل انك مبرمج ثم ها انت تبحث عن المشاكل لديك سلوك سيئ للغاية ارجو منك تصحيحه1 point
-
1 point
-
Well on the wiki it says value: The value you wish to store. Set to false to remove the data. NOTE: you cannot store tables as values, but you can use toJSON strings. Try to set it to false to remove the data instead of setting it to nil and see. Setting it to nil and expecting it to be removed is indeed logical, as far as I know setting setElementData to nil does actually remove it.1 point
-
1 point
-
اذا استخدمتها بكثرهـ راح تستهلك بكثرهـ او اذا استخدمتها بطريقة خطأ !!! واذا ع المتغير اتوقع يقدر يسويها بنفسه مو صعبة .. ما يحتاج تكبرو الموضوع وهو بسيط1 point
-
في اول مطاف لاي مبرمج كان يعتمد على اكواد جاهزة ولا اشوف اي مانع في موضوع هدا1 point
-
لايوجد قانون منع الاكواد الجاهزة فقد كان مكتوبا في نص المنتدى أسمه قسم البرمجة وليس قسم البرمجة بعدم الاكواد الجاهزة1 point
-
1 point
-
No, look at this code: function giveBombToRandomPlayer() local teamElement = getTeamFromName ("Terrorists") local teamMembers if isElement(teamElement) then teamMembers = getPlayersInTeam(teamElement) else outputChatBox("Team is not available") return end if(teamMembers and #teamMembers > 0 then) local randomIndex = math.random(1, #teamMembers) -- get a random index: between 1 and the length of the table local randomPlayer = teamMembers[randomIndex] -- we already have a random index, now get it from the table setTimer(function() if not isElement(randomPlayer) then -- there's a 6 seconds timer here, there's a chance the terrorist we picked got disconnected, if so, find a new one outputChatBox("Player is no longer available, finding new player...") giveBombToRandomPlayer() return end outputChatBox("You have the bomb!", randomPlayer, 255, 0, 0) outputChatBox("Remember when you enter site.. switch to the C4 to plant!", randomPlayer, 255, 0, 0) giveWeapon ( randomPlayer, 14,1,true) end,6000,1) else outputChatBox("Couldn't find any Terrorists") end end PS. this code editor is so annoying, I miss the old one, this one always fks up the indentation... not to mention the copy code function, it copies the line numbers and empty lines after each statement... It is not tested, if you get any errors and you can't solve it yourself, feel free to come back with the errors you're getting.1 point
-
addEventHandler("onClientMarkerHit" , Marker , markerhit) try to put it at the end of the file, because actually, when you trigger, markerhit is a nil value and Marker too1 point
-
Yeah I must do the same on my local server, that's really sad1 point
-
O que impede o seu código de funcionar é a falta de um 'end', que fecha a condição na linha 3. Pra ativar estas cores: #FF0000, use true no 4º argumento de outputChatBox: outputChatBox("#ff0000texto", thePlayer, 255,255,255, true) Como você pode ver, onde está thePlayer, é o jogador pra quem a msg do chat vai mostrar, depois as cores R,G,B do texto e o 4º argumento é o que habilita o uso das cores hex. Outra coisa a esclarecer, setPlayerSkin é uma função antiga que não é mais usada - use está função: setElementModel. Fica assim: function darSkin( thePlayer ) local nomeAcc = getAccountName(getPlayerAccount(thePlayer)) if not isObjectInACLGroup("user."..nomeAcc, aclGetGroup("EB")) then outputChatBox("#ff0000Somente membros do Exercito Brasileiro podem pegar a skin!", thePlayer, 255,255,255, true) else setElementModel(thePlayer, 287) end end addCommandHandler("skin", darSkin)1 point
-
addCommandHandler("skin", function() for i, thePlayer in ipairs(getElementsByType("player")) do if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ( "Admin" )) then setPlayerSkin(thePlayer, 287) --outputChatBox ( "Você pegou a skin do Exercito Brasileiro!", thePlayer, 255, 255, 255, true ) else outputChatBox ( "Somente membros do Exercito Brasileiro podem pegar a skin!", thePlayer, 255, 0, 0, true ) end end end)1 point
-
أهنيك صراحة ههههههههههههههههههه، خلاص تم حل المشكل , يقفل الموضوع ###1 point
-
Actually @Simple01 this is very optimized people get better FPS on my server's map then they get in standard SA.1 point
-
No, you will need a loop to get a new random player until it finds one that's in that team. It would be easier to get the list of players in that team using getPlayersInTeam and use math.random to get a random player from the returned table.1 point
-
1 point
-
1 point
-
addEventHandler("onPlayerLogin", root, function() local coin = getAccountCoinValue(source) or 0 setElementData(source, "moneycoins", coin) end) addEventHandler("onPlayerQuit", root, function() local coin = getElementData(source, "moneycoins") or 0 setAccountCoinValue(source, coin) end) addEventHandler("onResourceStart", resourceRoot, function() for _, player in pairs(getElementsByType("player")) do local coin = getAccountCoinValue(player) if coin then setElementData(player, "moneycoins", coin) end end end)1 point
-
Anything is possible in regular SA; just requires lots of work. Here's a good example of what's possible these days in MTA.1 point
-
But what about now? At the moment there is a few GTA V online mods developed be different groups and are in early beta stages, my suggestion is to MTA team join them and make one great multiplayer mod, because current developers of GTA V mods in my opinion are not trustworthy as MTA team is to work on their mods. For now maybe they show interest in making a such mod, but who knows what they will do after a year or two. We know that MTA devs care about this mod, so they could take care of GTAV mod aswell if the original creators decide to stop development. MTA team should try to make contact with them and make one great MP mod for GTAV. If you want some info on those mods, i can tell you where you can follow their progress1 point
-
Section Rules 1. Any fulfilled requests or discarded offers shall be reported via the report system in order to be locked and/or archived. This is mandatory, as the goal is to keep this section as clean and accurate as possible. 2.Topics must have a sufficient description of what are you offering or looking for. Eg. if you're looking for a scripter for your gamemode, you must detail what would you need the scripter for. This doesn't exactly involve giving away the whole concepts or whatever you don't want to disclose to the public, but it would be appreciated if you could include more details than just straight single line offers, such as "I need a scripter for a zombie gamemode". Whether or not the amount of detail is sufficient for the nature of your request is a subject to moderator judgement, and failing to meet criteria may result in your post being discarded. Formatting your topic In order to keep the section clean, accurate and easily viewable, it would be appreciated if you could use the following guidelines for your topic: 1. Topic titles should have the form [LF/OFFERING] Brief description [Paid/Non-Paid]. Please make the description as brief as possible here. Eg: [OFFERING] Skilled scripter [Paid] [OFFERING] Rookie modeller looking for some practice [Non-paid] [LF] Any-level scripter for a small server [Non-Paid] 2. The first post should be written in at least 2 parts: first part should contain a brief description of yourself (and/or the server or community you are from) second part should elaborate on what are you requesting/offering, once again, as detailed as you possibly can/want1 point
