SaNoR

Members
  • Content Count

    42
  • Joined

  • Last visited

  • Days Won

    1

SaNoR last won the day on October 15 2018

SaNoR had the most liked content!

Community Reputation

17 Decent

1 Follower

About SaNoR

  • Rank
    Rat

Recent Profile Visitors

626 profile views
  1. Don't be toxic, retard. I was talking about https://imgur.com/D76s3Rm
  2. It's sometimes happens when u copy code from forum, just write this line by yourself.
  3. Something like this 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 function aBan(source, cmd, nickname, time, ...) if (hasObjectPermissionTo(source, "function.banPlayer", false)) then time = tonumber(time) if nickname and time then local b_player, b_serial, b_time, b_reason = getPlayerFromPartialName(nickname), "", 1, "" if isElement(b_player) then b_serial = getPlayerSerial(b_player) b_time = getRealTime().timestamp + (time * 86400) if #{...} ~= 0 then b_reason = table.concat({...}, " ") end if kickPlayer(b_player, source, b_reason) then -- INSERT TO MYSQL b_serial, b_time, b_reason outputChatBox(getPlayerName(b_player).." has been banned by "..getPlayerName(source)..". ("..time.." day"..(time == 1 and ")" or "s)"), root, 255, 0, 0) end end else outputChatBox("/aban [Nickname] [Days] [Reason]", source, 255, 0, 0) end end end addCommandHandler("aban", aBan) addEventHandler("onPlayerJoin", root, function() local serial = getPlayerSerial(source) -- SELECT PLAYER SERIAL FROM DB if #result ~= 0 then -- IF FOUND if getRealTime().timestamp < result.b_time then kickPlayer(source, os.date("%Y-%m-%d %H:%M:%S", result.b_time)) end end end)
  4. SaNoR

    pickup on key

    function showAmmoGUI(hitPlayer) triggerClientEvent(hitPlayer, "showAmmoGUI_Ed", getRootElement(), hitPlayer, marker) end addEventHandler("onPlayerPickupHit", marker, function() bindKey(source, "N", "down", showAmmoGUI) end) addEventHandler("onPlayerPickupLeave", marker, function() unbindKey(source, "N", "down", showAmmoGUI) end)
  5. SaNoR

    wanted level

    -- player's screen size width * (icon size / you'r screen size width) -- same with height local sw, sh = guiGetScreenSize() local mineX, mineY = 1280, 720 -- you'r current screen resolution (from video setting) local icon_width, icon_height = sw * (20 / mineX), sh * (20 / mineY) -- star.png width, height local space = sw * (1 / mineX) -- space between icons local x, y = sw - icon_width - sw * (50 / mineX), sh * 0.5 -- x, y position
  6. Use a multiline string. win.text = [[ 1st: Nickname 123 2nd: Nickname 13123 3nd: Nickname 141523 ]]
  7. SaNoR

    wanted level

    local sw, sh = guiGetScreenSize() local icon_width, icon_height = 20, 20 -- star.png width, height local space = 1 -- space between icons local x, y = sw - icon_width - 50, sh * 0.5 -- x, y position addEventHandler("onClientRender", root, function() for i = 1, getPlayerWantedLevel() do dxDrawImage(x + (icon_width + space) - i * (icon_width + space), y, icon_width, icon_height, "star.png") end end)
  8. Use loop As example: function updateScoreboard() scoreboard = {} for _, player in ipairs(getElementsByType("player")) do if not getPlayerTeam(player) then for n = 1, 10 do table.insert(scoreboard, {"player", player}) end end end
  9. https://wiki.multitheftauto.com/wiki/Scripting_Introduction#Clientside_and_Serverside_scripts
  10. SaNoR

    Dx Visibility

    function Dx () if getPlayerTeam(localPlayer) == getTeamFromName("Admins") then dxDrawText("text", 1, 1, 1, 1, tocolor(250, 120, 4, 255), 7.00, "bankgothic", "center", "center", false, false, false, false, false) end end
  11. SaNoR

    Hex Name colors

    You're welcome.
  12. SaNoR

    Hex Name colors

    dxDrawText( un:O(killRow[r]["killerName"]), killRow[r]["killerNamePos"]["leftX"] + 1, killRow[r]["killerNamePos"]["topY"] + 1, killRow[r]["killerNamePos"]["rightX"] + 1, killRow[r]["killerNamePos"]["bottomY"] + 1, label_shadowColor, 1, label_font, "right", _, _, _, _, true) dxDrawText( killRow[r]["killerName"], killRow[r]["killerNamePos"]["leftX"], killRow[r]["killerNamePos"]["topY"], killRow[r]["killerNamePos"]["rightX"], killRow[r]["killerNamePos"]["bottomY"], killRow[r]["killerNameColor"], 1, label_font, "right", _, _, _, _, true) This should help. I just forgot to do it
  13. SaNoR

    Health problem

    I test it in local server and everything works fine. Maybe you're problem in "ArMoR" event.
  14. SaNoR

    Health problem

    function armor(loss) local Health = getElementHealth(source) local Armour = getPedArmor(source) if Armour - tonumber(loss) >= 0 then setPedArmor(source, Armour - tonumber(loss)) else setPedArmor(source, 0) end if getPedArmor(source) == 0 then setElementHealth(source, Health + (Armour - tonumber(loss))) end end addEvent("ArMoR", true) addEventHandler("ArMoR", getRootElement(), armor)