Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/06/21 in all areas

  1. Few days ago i started discussion about javascript in mta, for more details checkout https://github.com/multitheftauto/mtasa-blue/discussions/2008 I'm waiting for opinions, suggestions, and everything what can help, here, on at github I already made working "hello world" example
    1 point
  2. Hi. I used various softwares in late 2020 to change my serial and play again on servers where i banned previously. Yeah, i bypassed the server-sided bans, and now, i regretted this thing. I just want to play again on MTA SA servers, like everybody else. I dont want to play on SeeMTA again, just some DM servers. And yeah, in january i dont cared much about the rules of MTA, i breaked it a lot, and i regretted it. I only asking for a last chance. E498808BC962B662AD38471EB40A548E
    1 point
  3. You will get a last chance, you know what would happen if you repeat things like that in the future. @circa
    1 point
  4. The problem is that getElementPosition returns exact coordinates (in this case X coordinate is "-715.83142089844"). And you are comparing it with "-715.8314". To make it work you will have to round the coordinates. You can either use the useful function math.round or do it like this: local theBlip = createBlip(-715.8314, 2328.1269, 44.1525, 41, 2, 255, 0, 0, 255, 0, 1000) function removeBlip(posX, posY, posZ) for _,blip in ipairs(getElementsByType("blip")) do local x,y,z = getElementPosition(blip) if(math.ceil(posX) == math.ceil(x) and math.ceil(posY) == math.ceil(y) and math.ceil(posZ) == math.ceil(z)) then destroyElement(blip) end end end addCommandHandler("blip", function () -- the cmd way is for an example removeBlip(-715.8314, 2328.1269, 44.1525) end) *Changed @Burak5312's code a bit. Note that this way it won't be very accurate but if you don't plan to have close blips it should not cause any problems. Otherwise use the math.round function I mentioned above and specify how many digits to have after the decimal point.
    1 point
  5. This way works for me, to send data as JSON. function sendDiscordMessage(message) local data = { content = "Example:", username = "Webhook - Example", embeds = { { title = "Webhook - Example", description = "```Some user have typed \"help\" command.```", footer = { text = "I want to do this...", } } } } local jsonData = toJSON(data) jsonData = string.sub(jsonData, 3, #jsonData - 2) local sendOptions = { headers = { ["Content-Type"] = "application/json" }, postData = jsonData, } fetchRemote ( discordWebhookURL, sendOptions, WebhookCallback ) end
    1 point
  6. Include the variables inside the functiun and not outside (and inside the condition). -- local hour = ... -- will get values when the script starts addEventHandler("onClientKey", root, function(button,press) -- local hour = ... -- will get values everytime a player press on a key if press and (button == getKeyBoundToCommand("screenshot")) then -- local hour = ... -- will get values when the key is the screenshot command outputChatBox("You have taken a screenshot ! mta-screen_"..year.."-"..month.."-"..day.."_"..hour.."-"..minute.."-"..second..".png", 255, 0, 0, true) end end)
    1 point
  7. Yeah, and there are some other problems. - author subtable's syntax is incorrect, you have to use = instead of : and put index names inside [ ] (or use them withouth " ") - fetchRemote's syntax is incorrect, a callback function is required Don't forget to use /debugscript 3 Here is a tutorial of how to send Discord messages trough webhook:
    1 point
  8. Hey, Dunno but "getResourdiscordName" doesn't look to me like a normal function name. ?
    1 point
  9. This isn't a global ban, but a server-specific ban. You cannot appeal server bans with MTA, we have no power over them. All you can do is contact the server admins and ask for unban. Please read the ban appeals section info (or topic - in Russian) before posting next time! Auto-translated: Это не глобальный запрет, а запрет для конкретного сервера. Вы не можете обжаловать запреты серверов с помощью MTA, мы не властны над ними. Все, что вы можете сделать, это связаться с администраторами сервера и попросить разблокировать. Пожалуйста, ознакомьтесь с информацией в разделе (или теме - на русском языке) об апелляциях на бан, прежде чем размещать их в следующий раз!
    1 point
  10. Due to the lower than average (for people we consider "core DD abuser") amount of total global bans, you will get a final chance. You are still lucky to get unbanned despite the nature of activities you got banned for last time. I hope you can keep your word and play like a normal player from now on, else you'll get a new permanent ban without any more chances @anti98christ
    1 point
  11. local rewardTable = { [5] = {"M4", "M4 Mag", 90}; -- add ammo and ammount of ammo to give! [10] = {"Coyote Backpack"}; -- for items that don't have ammo no need to add anything after! -- you will have to add the rest! }; -- add this to spawn function! local pLvl = getElementData(player, "lvl") or 0; if pLvl >= 5 then --check if valid reward possible! for i = 5, pLvl, 5 do --start from 5 and jump from 5 to 5! as there are no other rewards in between! local data = rewardTable[i] or false; if data then setElementData(player, data[1], (getElementData(player, data[1]) or 0) + 1); -- Give M4; if data[2] then -- check if must give ammo? setElementData(player, data[2], (getElementData(player, data[2]) or 0) + data[3]); -- Give ammo; end end end end -- Add this just after items refresh! for _,player in ipairs(getElementsByType("player")) do local pLvl = getElementData(player, "lvl") or 0; if pLvl >= 20 then setElementData(player, "CZ 550", (getElementData(player, "CZ 550") or 0) + 1); -- Give CZ 550; end end --For the scoreboard you just have to add it by yourself you will just have to add another line with getElementData(player, "lvl")
    1 point
×
×
  • Create New...