Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/05/19 in all areas

  1. 2 points
  2. I've played some Garry's Mod recently and find out that instruments are quite popular there. I thought why not to make one in MTA. Preview video Features: synced piano sounds: every player hears them real grand piano sounds by Keppy Studios (http://kaleidonkep99.altervista.org/kep ... piano.html) sheet preview using CEF from virtualpiano.net downloading sounds (50 MB) in background so you don't have to wait to start playing on server You can customize some options in settings.lua. Download: https://github.com/Brzysiu/playablepiano/ (download on github because community upload limit is too high)
    2 points
  3. bengines provides custom engine sounds for vehicles. The resource is not focused to be ultra realistic, it is designed to use for casual servers. Not useful for me anymore so sharing with community. Used on old project. Sounds are copyrighted content not owned by me. Features: ready to use, chooses the best engine for vehicle depending on handling! easy to customize & expand for Lua programmers 30 soundpacks for vehicles (buses, bikes, sport cars etc.) stable code with quite high performance used on server with 600 players ALS effect (exhaust flames) Turbo (satisfying whistle and blow-off sounds) Videos: https://streamable.com/n7k40 https://streamable.com/lp14t https://streamable.com/q5e9g Download: Github: https://github.com/brzys/bengines (feel free to send pull requests) Community: to-do For programmers: --[[ Element datas used by resource [array] vehicle:engine - stores basic info about engine type, sound pack etc. (synced) [string] vehicle:type - used for engine calculation, useful for servers. Available: Bus, Truck, Sport, Casual, Muscle, Plane, Boat, Motorbike (synced) [string] vehicle:fuel_type - customized for each engine. Useful for servers. Available: "diesel", "petrol" (synced) You can use setElementData(vehicle, "vehicle:upgrades", {turbo=true, als=true}) to add turbo or ALS. --]] --[[ Exported functions --]] exports.bengines:getVehicleRPM(vehicle) -- returns RPM of given vehicle exports.bengines:getVehicleGear(vehicle) -- returns current gear of given vehicle exports.bengines:toggleEngines(bool) -- true / false, restore GTA engine sounds
    1 point
  4. I brought you bakaGaijin and Ash Now I bring Discord integration with MTA scripts. MTA already has this for IRC Shoutout to the people who made the Sockets module, you're awesome. Features: -Scripts can echo messages to any Discord text channel of their choosing. -Any Discord channel can be set up to echo all messages to an ingame script. (Including the name of the person who said it, and his role) -One MTA server can send/receive to multiple Discord guilds. Example use: To show how this is useful, I made a small program to echo all global chat to a "global" Discord channel, and all team chats to individual "team" Discord channels. These Discord channels ofc echo messages back when someone posts. As proof of concept for commands, if a Discord user types "!ban name" then his role is checked, and if it includes Founder, the chat outputs "name was banned!" This is the client side script I used for this example: local SECRET_KEY = "15-A-53CR3T-K3Y" --The script works even if your server IP changes. You are mapped to a unique key. local function onopen(self) self:send(SECRET_KEY) --Your MTA server logs in addEventHandler("onResourceStop", resourceRoot, function() self:close() --Break off from Discord end) addEventHandler("onPlayerChat", getRootElement(), function(message, type) --Example hook to capture player chats local name = getPlayerName(source) local channel = "global" --Send to global channel if global chat if type==2 then channel = getTeamName(getPlayerTeam(source)) end --Or team channel if teamchat --Format to send messages is ("discord", channelName, message) self:send("discord", channel, name..": "..message) end) end function onmessage(self, data) local channelName, name, role, message = data[3], data[4], data[5], data[6] local orginal_message = message --The message we got from discord message = "("..role..") "..name..": "..message --Make it pretty if channelName=="global" then --Output to global chat or team chat outputChatBox("(DISCORD) "..message) else local team = getTeamFromName(channelName) local members = getPlayersInTeam(team) or {} local r, g, b = getTeamColor(team) --Color the output for lulz for _, player in ipairs(members) do outputChatBox( "(DISCORD) (TEAM) "..message, player, r, g, b) end end local commandExample = string.match(orginal_message, "^!ban (.+)") --If message started with !ban... if role=="Founders" and commandExample then -- ...and the person who said it had the right Role outputChatBox(commandExample.." was banned!", getRootElement(), 255, 0, 0) end end local function onclose() outputChatBox("The Discord link was closed") end local discord = Discord.new(onopen, onmessage, onclose) That's 41 lines of code, now let's see it in effect. I would love to hear what you think about it.
    1 point
  5. Você deve usar a função: function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end Esta função não é nativa do MTA, se você preferir usar uma nativa use: GetPlayerFromName OBS: Eu usaria a primeira pois a função nativa do MTA você precisa escrever o nick do player completo que você deseja dar o dinheiro, já a primeira você apenas digita as letras iniciais que ela já puxa o jogador. Se tiver alguma dúvida deixe aqui em baixo que te auxilio.
    1 point
  6. Esse trigger no getRootElement num timer aí que é o problema. De preferência faça o script no lado cliente, como disse o Jonas.
    1 point
  7. Está resolvido o problema consegui formular um script que o jogador recebera uma mensagem de bem vindo quando se conectar.
    1 point
  8. Você esta usando client-side? se for client-side acho que não, eu aumentaria o tempo ali do timer colocaria uns 10 segundos.
    1 point
  9. Digita no Console o comando /info nome_do_resource Se o status tiver ok, tente isto e veja no jogo se mostra alguma mensagem no chat ao ligar: local message = "Seja bem-vindo ao servidor MrShadows Race."; addEventHandler( "onResourceStart", root, function( res ) local res_type = getResourceInfo( res, "type" ); outputChatBox("Resource Iniciado!") if ( res_type and res_type == "map" ) then outputChatBox( message, root, 255, 255, 255, true ); end end );
    1 point
  10. 1. Quando cara efetuar o primeiro registro você verifica se existe uma data na conta dele com getAccountData se não existir, seta a data na conta e seta o prêmio acredito que você queria dar algum bônus no primeiro login. 2. Quando o cara efetuar novamente o login ele vai cair na verificação e a data já vai existir dai ele vai ignorar e vai prosseguir com o login normalmente sem dar o bônus. Exemplo: function rewardLogin (prevAcc, currAcc) if not getAccountData (currAcc, "primeiroLogin") then -- Se a data ' primeiroLogin ' não existir, então: local reward = math.random (5000, 10000) givePlayerMoney (source, reward) -- Seta o valor da variável 'reward' na conta do jogador. setAccountData (currAcc, "primeiroLogin", true) -- Seta a data na conta do jogador (evitando que ele pegue novamente o prêmio ao logar.) end end addEventHandler ("onPlayerLogin", root, rewardLogin)
    1 point
  11. To do this you can cancel onClientPlayerDamage. Make sure you run the cancelling logic on every client, this is important for sync. You can implement the timer display using dxDrawText. Use getTickCount to record the start time instead of increasing a counter every second. If gangs are implemented using MTA's team system, you can use getPlayersInTeam and trigger an event to those players. You can modify the "start time" instead of every player having a timer. Assuming you want everyone to see the same timer. You'd modify the "start time" by subtracting 30s when they enter the turf (this means they have "spent more time capturing the turf"), or adding 30s when they leave the turf (meaning they have now "spent less time"). Note: timeSpent = getTickCount() - startTime You can use toggleControl with vehicle_fire / vehicle_secondary_fire. See "Control names". This will prevent those vehicles from firing whilst inside the turf. You may want to use a separate colshape to ensure that people outside the turf aren't shooting into the turf area, if that makes sense. You may also want to say "You are too close to a turf war to fire this vehicle!"
    1 point
  12. Nessa parte tu ta fechando só a verificação dali entao nao vai aparecer a mensagem ao ele "hitar" o marker, e tem que botar um marker valido no onMarkerHit e botar o nome correto da função edit:Esse é o codigo inteiro, se for, envie aqui ele
    1 point
  13. I am not 100% sure why sending the root to the other side will create more CPU usage. It is not logic when you look at the element tree Element_tree. Most addEventHandlers have by default propagation enabled. Which means that all element (children) in the server will be able to trigger those addEventHandlers, if the eventname is the same and the handler element is root. The situation with using a child should be able to trigger more events than when the root element is used. What is the difference between sending root and resourceRoot from a performance perspective? Can't answer that. Not even sure if it has any relations with the addEventHandler.?
    1 point
  14. ترفع لنا موضوع قديم مشان شيء بسيط , ليه ما كلمته خاص ولأن ما اعتقد انه احد رح يساعدك او يفيدك لى انه جرائد معتزل وانت طلبت فقط جرائد ما طلبت اي شخص اخرى
    1 point
  15. Cria um arquivo .lua e cola esse código, faz o meta.xml (clique no link e leia) dele e deixa os 2 arquivos numa pasta; a pasta você deixa no diretório [...]server\mods\deathmatch\resources Aqui um link útil pra você ler: https://wiki.multitheftauto.com/wiki/PT-BR/Introdução_ao_Scripting
    1 point
  16. Alright that'd be amazing because I plan on adding an entirely new animation set that's fully dynamic. (Meaning no animation is static, every animation has a random movement added; (running, one leg may fall ahead or behind of the other by a small amount, shooting your hands follow the trigger / handle, driving your hands follow the steering wheel, ect along with ziplines and crap in the future.)
    1 point
×
×
  • Create New...