Jump to content

India

Members
  • Posts

    85
  • Joined

  • Last visited

1 Follower

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

India's Achievements

Transformer

Transformer (11/54)

6

Reputation

3

Community Answers

  1. India

    [HELP] AdminTag

    Thank you very much Thank you for your time and attention
  2. India

    [HELP] AdminTag

    Playername not showing should be like this "Server Admin: Infinate" while player is not in ACL, nothing should shown
  3. India

    [HELP] AdminTag

    if player is not in ACL, ACL name does not appear. its right but problem is PlayerName staying
  4. India

    [HELP] AdminTag

    Yes but, its DayZ gamemode, if player is not in ACL, nothing should show
  5. India

    [HELP] AdminTag

    If player not in ACL, only the Name staying
  6. India

    [HELP] AdminTag

    Okay, there is all of code client/server client local drawDistance = 70 g_StreamedInPlayers = {} function drawHPBar(x, y, v, d) if v < 0 then v = 0 elseif v > 100 then v = 100 end dxDrawRectangle(x - 21, y, 42, 5, tocolor(0, 0, 0, 255 - d)) dxDrawRectangle(x - 20, y + 1, v / 2.5, 3, tocolor((100 - v) * 2.55, v * 2.55, 0, 255 - d)) end function drawArmourBar(x, y, v, d) if v < 0 then v = 0 elseif v > 100 then v = 100 end dxDrawRectangle(x - 21, y, 42, 5, tocolor(0, 0, 0, 255 - d)) dxDrawRectangle(x - 20, y + 1, v / 2.5, 3, tocolor(255, 255, 255, 255 - d)) end function drawHud() healthColor = tocolor(0, 0, 0, 255) healthbgColor = tocolor(255, 151, 0, 127) healthfgColor = tocolor(255, 151, 0, 185) sx, sy = guiGetScreenSize() healthx = sx / 800 * 683 healthy = sy / 600 * 89 healthxoverlay = sx / 800 * 685 healthyoverlay = sy / 600 * 91 vehiclehealthx = sx / 800 * 619 vehiclehealthy = sy / 600 * 169 vehiclehealthxoverlay = sx / 800 * 621 vehiclehealthyoverlay = sy / 600 * 171 if not normalhealthbar then --local health = getElementHealth(getLocalPlayer()) --local armour = getPedArmor(getLocalPlayer()) local rate = 500 / getPedStat(getLocalPlayer(), 24) if getElementHealth(getLocalPlayer()) == 0 then if 500 > getTickCount() - visibleTick then do local healthRelative = health * rate / 100 local v = health * rate dxDrawRectangle(healthx, healthy, 76, 12, healthColor, false) dxDrawRectangle(healthxoverlay, healthyoverlay, 72, 8, tocolor((100 - v) * 2.55, v * 2.55, 0, 127), false) dxDrawRectangle(healthxoverlay, healthyoverlay, 72 * healthRelative, 8, tocolor((100 - v) * 2.55, v * 2.55, 0, 185), false) end elseif getTickCount() - visibleTick >= 1000 then visibleTick = getTickCount() end else local healthRelative = health * rate / 100 local v = health * rate dxDrawRectangle(healthx, healthy, 76, 12, healthColor, false) dxDrawRectangle(healthxoverlay, healthyoverlay, 72, 8, tocolor((100 - v) * 2.55, v * 2.55, 0, 127), false) dxDrawRectangle(healthxoverlay, healthyoverlay, 72 * healthRelative, 8, tocolor((100 - v) * 2.55, v * 2.55, 0, 185), false) end end end function un:O(text) return string.gsub(text, "(#%x%x%x%x%x%x)", function(colorString) return "" end) end function onClientRender() local cx, cy, cz, lx, ly, lz = getCameraMatrix() for k, player in pairs(g_StreamedInPlayers) do if isElement(player) and isElementStreamedIn(player) then do local vx, vy, vz = getPedBonePosition(player, 8) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3) if x and y then local name = getPlayerName(player) local w = dxGetTextWidth(name, 1, "default-bold") local h = dxGetFontHeight(1, "default-bold") local cargo_player = getElementData(player, "cargo") or "" --local cargo_player = getPlayerName(player)..": "..getElementData(player, "cargo") or "" local cargo_player_cor = getElementData(player, "cargo->cor") or {255, 255, 255, 240} dxDrawText(cargo_player, x - 1 - w / 2, y - 1 - h - 40, w, h, tocolor(0, 0, 0), 2, "default-bold") dxDrawColorText(cargo_player, x - w / 2, y - h - 40, w, h, tocolor(unpack(cargo_player_cor)), 2, "default-bold") -- part by AndreiSR --dxDrawText(name2, x - 1 - w / 2, y - 1 - h - 12, w, h, tocolor(0, 0, 0), 1, "default-bold") --dxDrawColorText(name, x - w / 2, y - h - 12, w, h, tocolor(getPlayerNametagColor(player)), 1, "default-bold") --local health = getElementHealth(player) --local armour = getPedArmor(player) --if health > 0 then local rate = 500 / getPedStat(player, 24) --drawHPBar(x, y - 6, health * rate, dist) --if armour > 0 then --drawArmourBar(x, y - 12, armour, dist) end end end else table.remove(g_StreamedInPlayers, k) end end end addEventHandler("onClientRender", root, onClientRender) function onClientElementStreamIn() if getElementType(source) == "player" and source ~= getLocalPlayer() then setPlayerNametagShowing(source, false) table.insert(g_StreamedInPlayers, source) end end addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn) function onClientResourceStart(startedResource) visibleTick = getTickCount() counter = 0 normalhealthbar = false local players = getElementsByType("player") for k, v in pairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart) function dxDrawColorText(str, ax, ay, bx, by, color, scale, font) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x" .. col:sub(1, 2)), tonumber("0x" .. col:sub(3, 4)), tonumber("0x" .. col:sub(5, 6)), 255) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(tonumber("0x" .. col:sub(1, 2)), tonumber("0x" .. col:sub(3, 4)), tonumber("0x" .. col:sub(5, 6)), 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) end end server function setCargo(player) if player then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Kurucu")) then setElementData(player, "cargo", "Sunucu Yazılımcısı") setElementData(player, "cargo->cor", {255, 0, 0, 240}) elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("KurucuOffline")) then removeElementData(player, "cargo_player") --REMOVE DATA elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("SuperAdmin")) then setElementData(player, "cargo", "Süper ADMİN") elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("SuperAdminOffline")) then removeElementData(player, "cargo_player") --REMOVE DATA elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then setElementData(player, "cargo", "Admin") setElementData(player, "cargo->cor", {255, 0, 0, 240}) elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("AdminOffline")) then removeElementData(player, "cargo_player") --REMOVE DATA elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("SuperModerator")) then setElementData(player, "cargo", "Süper Moderatör") setElementData(player, "cargo->cor", {158, 255, 39}) elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("SuperModeratorOffline")) then removeElementData(player, "cargo_player") --REMOVE DATA elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Moderator")) then setElementData(player, "cargo", "Moderatör") setElementData(player, "cargo->cor", {255, 255, 0, 240}) elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("ModeratorOffline")) then removeElementData(player, "cargo_player") --REMOVE DATA end end end setTimer( function() for i, pl in pairs(getElementsByType("player")) do if pl ~= (false or nil) then setCargo(pl) end end end, 3000, 0)
  7. India

    [HELP] AdminTag

    no way to fix this?
  8. India

    [HELP] AdminTag

    with this local cargo_player = getPlayerName(player)..": "..getElementData(player, "cargo") or "" attempt to concatenate a boolean value
  9. India

    [HELP] AdminTag

    local cargo_player = getPlayerName(player)..": "..getElementData(player, "cargo") or "" Still same but with this, no errors, local cargo_player = getElementData(player, "cargo") or "" I want get playerName also, like this "Admin India"
  10. India

    [HELP] AdminTag

    I do something tag are going away when the player is in the AdminOffline ACL Group, exactly as i want but the problem is in clientside. ERROR: attempt to concatenate a boolean value error line: local cargo_player = getPlayerName(player)..": "..getElementData(player, "cargo") or nil elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then setElementData(player, "cargo", "Admin") --ADD DATA setElementData(player, "cargo->cor", {255, 0, 0, 240}) elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("AdminOffline")) then removeElementData(player, "cargo", "") --REMOVE DATA setElementData(player, "cargo->cor", {255, 0, 0, 240})
  11. India

    [HELP] AdminTag

    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Kurucu")) then setElementData(player, "cargo", "Sunucu Yazılımcısı") else setElementData(player, "cargo", "") setElementData(player, "cargo->cor", {255, 0, 0, 240}) like this?
  12. India

    [HELP] AdminTag

    function setCargo(player) if player then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Kurucu")) then setElementData(player, "cargo", "Sunucu Yazılımcısı") setElementData(player, "cargo->cor", {255, 0, 0, 240}) elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("SuperAdmin")) then setElementData(player, "cargo", "Süper ADMİN") setElementData(player, "cargo->cor", {255, 0, 0, 240}) elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then setElementData(player, "cargo", "Admin") setElementData(player, "cargo->cor", {255, 0, 0, 240}) elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Rehber")) then setElementData(player, "cargo", "Sunucu Rehberi") setElementData(player, "cargo->cor", {255, 100, 0, 240}) elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("SuperModerator")) then setElementData(player, "cargo", "Süper Moderatör") setElementData(player, "cargo->cor", {158, 255, 39}) elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Moderator")) then setElementData(player, "cargo", "Moderatör") setElementData(player, "cargo->cor", {255, 255, 0, 240}) end end end setTimer( function() for i, pl in pairs(getElementsByType("player")) do if pl ~= (false or nil) then setCargo(pl) end end end, 3000, 0) I don't know, can u make for me?
  13. Hi, i have a admintag system, displays the name of the ACL on the character. But the problem is that while the player is not in ACL, her last ACL name remains. Example: This player currently has no ACL but the text remains client.lua local drawDistance = 70 g_StreamedInPlayers = {} function drawHPBar(x, y, v, d) if v < 0 then v = 0 elseif v > 100 then v = 100 end dxDrawRectangle(x - 21, y, 42, 5, tocolor(0, 0, 0, 255 - d)) dxDrawRectangle(x - 20, y + 1, v / 2.5, 3, tocolor((100 - v) * 2.55, v * 2.55, 0, 255 - d)) end function drawArmourBar(x, y, v, d) if v < 0 then v = 0 elseif v > 100 then v = 100 end dxDrawRectangle(x - 21, y, 42, 5, tocolor(0, 0, 0, 255 - d)) dxDrawRectangle(x - 20, y + 1, v / 2.5, 3, tocolor(255, 255, 255, 255 - d)) end function drawHud() healthColor = tocolor(0, 0, 0, 255) healthbgColor = tocolor(255, 151, 0, 127) healthfgColor = tocolor(255, 151, 0, 185) sx, sy = guiGetScreenSize() healthx = sx / 800 * 683 healthy = sy / 600 * 89 healthxoverlay = sx / 800 * 685 healthyoverlay = sy / 600 * 91 vehiclehealthx = sx / 800 * 619 vehiclehealthy = sy / 600 * 169 vehiclehealthxoverlay = sx / 800 * 621 vehiclehealthyoverlay = sy / 600 * 171 if not normalhealthbar then --local health = getElementHealth(getLocalPlayer()) --local armour = getPedArmor(getLocalPlayer()) local rate = 500 / getPedStat(getLocalPlayer(), 24) if getElementHealth(getLocalPlayer()) == 0 then if 500 > getTickCount() - visibleTick then do local healthRelative = health * rate / 100 local v = health * rate dxDrawRectangle(healthx, healthy, 76, 12, healthColor, false) dxDrawRectangle(healthxoverlay, healthyoverlay, 72, 8, tocolor((100 - v) * 2.55, v * 2.55, 0, 127), false) dxDrawRectangle(healthxoverlay, healthyoverlay, 72 * healthRelative, 8, tocolor((100 - v) * 2.55, v * 2.55, 0, 185), false) end elseif getTickCount() - visibleTick >= 1000 then visibleTick = getTickCount() end else local healthRelative = health * rate / 100 local v = health * rate dxDrawRectangle(healthx, healthy, 76, 12, healthColor, false) dxDrawRectangle(healthxoverlay, healthyoverlay, 72, 8, tocolor((100 - v) * 2.55, v * 2.55, 0, 127), false) dxDrawRectangle(healthxoverlay, healthyoverlay, 72 * healthRelative, 8, tocolor((100 - v) * 2.55, v * 2.55, 0, 185), false) end end end function un:O(text) return string.gsub(text, "(#%x%x%x%x%x%x)", function(colorString) return "" end) end function onClientRender() local cx, cy, cz, lx, ly, lz = getCameraMatrix() for k, player in pairs(g_StreamedInPlayers) do if isElement(player) and isElementStreamedIn(player) then do local vx, vy, vz = getPedBonePosition(player, 8) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3) if x and y then local name = getPlayerName(player) --local name2 = un:O(getPlayerName(player)) local w = dxGetTextWidth(name, 1, "default-bold") local h = dxGetFontHeight(1, "default-bold") -- part by AndreiSR local cargo_player = getElementData(player, "cargo") or "" local cargo_player_cor = getElementData(player, "cargo->cor") or {255, 255, 255, 240} dxDrawText(cargo_player, x - 1 - w / 2, y - 1 - h - 40, w, h, tocolor(0, 0, 0), 2, "default-bold") dxDrawColorText(cargo_player, x - w / 2, y - h - 40, w, h, tocolor(unpack(cargo_player_cor)), 2, "default-bold") -- part by AndreiSR --dxDrawText(name2, x - 1 - w / 2, y - 1 - h - 12, w, h, tocolor(0, 0, 0), 1, "default-bold") --dxDrawColorText(name, x - w / 2, y - h - 12, w, h, tocolor(getPlayerNametagColor(player)), 1, "default-bold") --local health = getElementHealth(player) --local armour = getPedArmor(player) --if health > 0 then local rate = 500 / getPedStat(player, 24) --drawHPBar(x, y - 6, health * rate, dist) --if armour > 0 then --drawArmourBar(x, y - 12, armour, dist) end end end else table.remove(g_StreamedInPlayers, k) end end end addEventHandler("onClientRender", root, onClientRender) function onClientElementStreamIn() if getElementType(source) == "player" and source ~= getLocalPlayer() then setPlayerNametagShowing(source, false) table.insert(g_StreamedInPlayers, source) end end addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn) function onClientResourceStart(startedResource) visibleTick = getTickCount() counter = 0 normalhealthbar = false local players = getElementsByType("player") for k, v in pairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart) function dxDrawColorText(str, ax, ay, bx, by, color, scale, font) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x" .. col:sub(1, 2)), tonumber("0x" .. col:sub(3, 4)), tonumber("0x" .. col:sub(5, 6)), 255) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(tonumber("0x" .. col:sub(1, 2)), tonumber("0x" .. col:sub(3, 4)), tonumber("0x" .. col:sub(5, 6)), 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) end end
  14. Still same, this lines gives warning; local attaches = getAttachedElements ( zomb,1) destroyElement ( zomb,1)
×
×
  • Create New...