Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 29/01/23 in all areas

  1. Olá, boa tarde tudo bem? Espero que sim... Fiz aqui pra você. createEventHandler ("MST.onPlayerBuyVehicle", getRootElement (), function (player, selecionado, cor_1, cor_2, cor_3, cor_4) if selecionado then local accName = getAccountName (getPlayerAccount (player)) local result = dbPoll (dbQuery (db, "SELECT * FROM Veiculos WHERE Conta = ? AND Modelo = ?", accName, selecionado.model), -1) if #result == 0 then local maximoSlot = getMaxSlot(player) if getAllPlayerVehicles (player) >= maximoSlot then --eu sei q é aqui q impede que o jogador compre mais carros message (player, "Você já possui a quantidade máxima de veículos", "error") return end local money = getPlayerMoney (player) if money >= selecionado.price then local id = NovoID () local cor = cor_1..", "..cor_2..", "..cor_3..", "..cor_4 local t_1, t_2, t_3, t_4, t_5, t_6, t_7, t_8, t_9, t_10, t_11, t_12, t_13, t_14, t_15 = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 local tunning = t_1..", "..t_2..", "..t_3..", "..t_4..", "..t_5..", "..t_6..", "..t_7..", "..t_8..", "..t_9..", "..t_10..", "..t_11..", "..t_12..", "..t_13..", "..t_14..", "..t_15 dbExec (db, "INSERT INTO Veiculos VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", accName, id, selecionado.name, selecionado.model, "Guardado", cor, tunning, "Não", 0, "SemPlaca", selecionado.price, 1000, 100) message (player, "Você comprou o veículo "..selecionado.name.." por R$"..convertNumber(selecionado.price)..",00.", "success") takePlayerMoney (player, selecionado.price) triggerClientEvent (player, "MST.onPlayerCloseEvents", player) else message (player, "Você não possui dinheiro suficiente.", "error") end else message (player, "Você já possui esse veículo.", "error") end else message (player, "Selecione algum veículo da lista.", "error") end end) function getMaxSlot(player) if player and not isGuestAccount(getPlayerAccount(player)) then local acc = getAccountName(getPlayerAccount(player)) for i, v in ipairs(config.gerais.slotsmax) do if aclGetGroup(v[1]) then if isObjectInACLGroup("user."..acc, aclGetGroup(v[1])) then return v[2] end end end end return config.gerais.veiculosmax-- valor padrao, caso o player nao tenha nenhuma das acls end --aqui é a função a cima q verifica os carros q o jogador tem na garagem function getAllPlayerVehicles (player) local accName = getAccountName (getPlayerAccount (player)) local result = dbPoll (dbQuery (db, "SELECT * FROM Veiculos WHERE Conta = ?", accName), -1) return #result end --aqui e no arquivo de configuração config = { gerais = { veiculosmax = 2, -- Veículos Máximos que o Jogador vai poder ter na Garagem. (caso seja um player normal) slotsmax = { {"Console", 5}, {"VIP", 3}, -- só seguir a logica... }, elementfuel = "Gasolina", -- Element Data de Gasolina do seu Servidor. elementid = "ID", -- Element Data de ID do seu Servidor. infobox = "addBox", -- Evento da sua Infobox. distancia = 30, -- Distancia do Player e do Veículo. (Guardar Veículo) velocitymax = 400, -- Velocidade Máximas de todos os Veículos. acls = {"Console"}, -- ACL's Administradoras do seu Servidor. },
    1 point
  2. Hello there, today I'm presenting you my new FDD (Fun Destruction Derby) map: "Mars Effect" as I promised. I want to bring you to our new home within near future theoretically, a dusty and silient atmosphere is waiting for you to play) Map story: You may remember there is a rocket shuttle launchpad in Antartica 2 we have used it to launch the Mars. all we found was dust storms but no life forms when we first arrived, so we investigated the area and started to colonize it, the planet seems more dead then it seems but researching facilites doing their best. I didn't add many objects around the map as decoration and kept the textures optimized, so you will be able to play the map without issues I guess. if you find any bugs or problems please directly contact me via Discord Nebla#0042 Enjoy the video!
    1 point
  3. 1 point
  4. Olá, boa noite. O GiveWeapon também funciona se você passar uma string com o nome da arma, por isso seu código esta dando esse erro. o getWeaponIDFromName(weaponName) está atribuindo o id da minigun pra variavel id. Para fazer seu código funcionar da maneira que eu imagino que queria, o player digitando o nome da arma, e ja recebendo. Isso não seria possivel pois à armas que tem o nome composto, por tanto não seria tão simples usando o eventHandler onPlayerCommand, pos esse evento só recebe o cmd e nenhum argumento a mais. Essa versão seria mais tranquila de manipular: local ilegal = { 'minigun', 'rocket' } local armas = { [22] = 'pistol', --Entre o colchete entra o id da arma, recebe o valor 'comando' que o player digita pra receber a arma | caso queira adicionar mais [23] = 'silenced', [24] = 'deagle', [25] = 'shotgun', [26] = 'saw', [27] = 'combat', [28] = 'uzi', [29] = 'mp5', [32] = 'tec', [30] = 'ak', [31] = 'm4', [33] = 'rifle', [34] = 'sniper' } addEventHandler("onPlayerCommand", root, function(cmd) weaponName = string.lower(cmd) iprint(weaponName) for i, j in pairs(ilegal) do if weaponName == j then -- verifica se o jogador digitou o nome de uma das armas que estão proibidas e exibe mensagem outputChatBox(' you cannot have this gun', source, 255, 0, 0) return end end for i, j in pairs(armas) do if weaponName == j then -- verific se o nome digitado está na tabela de armas giveWeapon(source, i, 1000, true) -- aqui entregamos o valor do i, pois dizemos que essa é a key da tabela que esta OK outputChatBox("[ CDC-Info ]: Você recebeu 1000 unidades de munição para a arma: " .. weaponName, source, 255, 60, 0, true) return end end end) Caso tenha alguma duvida, pergunte. Se não tiver deixe o Thanks
    1 point
  5. To take away some confusion, understand that the changes being announced here are mostly focussed on cutting out the 'community front' of AC team operations, so that we can optimize limited manpower and rebalance expectations for our users to accept there will be periods we can't make waves, if you were able to move yourself into our perspective on how people always want everything solved, fixed, sorted out immediately on their whim, and how persistent they are in that (and in most cases bring something misconceived/invalid, after which they can't even be convinced otherwise or that would take from our time disproportionally), you'd be straight out scared and quickly stressed out. OP was clarified by adding in this segment 1 day after the topic was made: We will continue to bring AC improvements and get rid of emerging cheats and cheaters, but at our own pace, without external pressure or too high community expectations, from now on everything is on a best-effort basis and the point is that there may be periods during which we can't make any waves due to manpower constricts. You can see that this topic intends to lower your expectations and respect the amount of free time we (as volunteers) are able to invest, and get off our backs for things being different compared to some years ago. We're also OK to restrict ban appeals and player reports so we can delegate all of the manpower that's left on our new strategy, breaking cheats (patching them) and just preventing them from working to begin with, instead of permanently banning cheat users and having to deal with them "regretting" in ban appeals. We are also OK to restrict reporting cheaters as our focus shifts to breaking the cheats, and to get the required information to break one, we have our own methods and channels so much that we don't need any sort of reports. Due to the state of anticheat and heuristics, we always have a good picture of abnormalities and what cheats are doing, so the main limiting factor is manpower to get to work with what we have & know. After all, cheating on MTA will not be left alone, and AC team will disrupt it and raise the border even more whenever manpower allows it to do so. Cheaters should realize that their fun may come to an end at any unexpected moment, and that if they're too used to being able to cheat, they will be very upset to have to adapt to playing normally for as long it takes the cheat devs to catch back up to us again.
    1 point
×
×
  • Create New...