Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-12-08, 22:56


MESTIHD







Wiek: 23
Na forum: 3721 dni
Posty: 36
Nick w MP: MESTI

Piwa: 1

Respekt: 50

Witam, mam problem z rang? w?a?ciciel w mysql mam lv 4 a o to problemy:
1. Po wpisaniu /duty znikam mi nick na scoreboardzie jest widoczny tylko sekund?
2. Nie mam nad nametagiem rangi ( z innymi rangami np rcon nie mam takiego problemu
3.albo na chacie /e bez wpisania w visual rank w mysql wlasciciel s? tylko nawiasy (z innymi rangami nie ma takiego problemu nic takiego nie musze wpisywa?)
Oczywi?cie mam wszystkie uprawnienia tylko to wygl?da tak jakbym w og?le nie mia? ?adnej rangi prosz? o szybk? pomoc.
Czy gdzie? co? trzeba doda? czy co.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-08, 23:36


AsterBonzo

Otwórz ogień






Wiek: 21
Na forum: 3109 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 61

Respekt: 35,8

Dodawa?e? t? rang? sam czy ona ju? by?a ?

Podpis

Pomagam jak potrafię :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-08, 23:41


MESTIHD







Wiek: 23
Na forum: 3721 dni
Posty: 36
Nick w MP: MESTI

Piwa: 1

Respekt: 50

Edytowa?em z CEO, ale to jest ok dlatego, ?e sprawdza?em u kolegi i koledze dzia?a ma nad nickiem range i na /e oraz ma kolor na scoreboardzie te? a u mnie dalej nie dzia?a.

Ostatnio zmieniony przez MESTIHD 2018-12-08, 23:44, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-08, 23:42


AsterBonzo

Otwórz ogień






Wiek: 21
Na forum: 3109 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 61

Respekt: 35,8

Podaj kodzik do dutyadmin i do nametag?w

Podpis

Pomagam jak potrafię :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-08, 23:45


MESTIHD







Wiek: 23
Na forum: 3721 dni
Posty: 36
Nick w MP: MESTI

Piwa: 1

Respekt: 50

addEventHandler("onClientRender", root, function()
        local rootx, rooty, rootz = getCameraMatrix()--getElementPosition(getLocalPlayer())
        for i, player in ipairs(getElementsByType("player",root,true)) do
            if player ~= localPlayer and getElementDimension(localPlayer)==getElementDimension(player) and getElementInterior(localPlayer)==getElementInterior(player) and getElementAlpha(player)>0 then
                local x,y,z = getPedBonePosition(player,8)
                local sx, sy = getScreenFromWorldPosition(x, y, z+0.43)
                local sxc,syc =getScreenFromWorldPosition(x, y, z+0.68)
                if sx and sy and sxc and syc then
                local distance = getDistanceBetweenPoints3D(rootx, rooty, rootz, x, y, z)                                            
                if(distance <= 22) then
                  if isLineOfSightClear( rootx,rooty,rootz, x,y,z, true, false, false, true, false, false, true,localPlayer ) then
                    local name=getPlayerName(player).." ("..getElementData(player,"id")..")"
                    local level = tonumber(getElementData(player, "player:level"))
                    if not getElementData(player,"p:inv") then 
                    if level == 1 then
                    dxDrawText("Supporter", sxc, syc, sxc, syc, tocolor(0, 102, 0, 255), 1.0, vopisFont, "center", "center")
                    end
                    if level == 2 then
                    dxDrawText("Administrator", sxc, syc, sxc, syc, tocolor(255, 0, 0), 1.0, vopisFont, "center", "center")
                    end
                    if level == 3 then
                    dxDrawText("Administrator RCON", sxc, syc, sxc, syc, tocolor(102, 0, 0), 1.0, vopisFont, "center", "center")
                    end
                    if level == 4 then
                    dxDrawText("Wlasciciel", sxc, syc, sxc, syc, tocolor(51, 102, 255), 1.0, vopisFont, "center", "center")
                    end

                    dxDrawText(name:gsub("#%x%x%x%x%x%x",""),sx, sy, sx, sy,tocolor(0, 0, 56,255), 1.00, vopisFont ,"center","center",false,false,false,true,true,0,0,-50 )
                    dxDrawText(name,sx+1, sy+1, sx+1, sy+1,tocolor(255,255,255,190), 1.00, vopisFont ,"center","center",false,false,false,true,true,0,0,-50 )
                    if getElementData(localPlayer,"player:faction") == "samc-sf" then
                    dxDrawRectangle(sx-25*2-1, sy+5*2, 100-distance, 18+2-distance/2.0, tocolor(27,27,27,155)) 
                    dxDrawRectangle(sx-25*2, sy+5*2+1, getElementHealth(player)-distance, 18-distance/1.0, tocolor(255,5,5,155))
                    end


[ Dodano: 2018-12-08, 23:46 ]
unction censorSentence(text)
    local cnt = 0
    for k,v in ipairs(cenzured_strings) do
        text, lcnt = string.gsub(text, v, censorWord)
        if lcnt and lcnt > 0 then cnt = cnt + lcnt end
    end
    return text,cnt
end

rangi = {
    [4] = "Wlasciciel",
    [3] = "Administrator RCON",
    [2] = "Administrator",
    [1] = "Supporter",
}

addCommandHandler("e", function(plr,cmd, ...)
    if getAdmin(plr) then
        if not ... then
                local x = getElementData(plr,"player:ekipaoff")
                if not x then
                    triggerClientEvent(plr, "iyw_notifications:send", plr, "success", "Wy??czy?e?/a? czat ekipy.")
                    setElementData(plr,"player:ekipaoff",true)
                elseif x then
                    triggerClientEvent(plr, "iyw_notifications:send", plr, "success", "W??czy?e?/a? czat ekipy.")
                    setElementData(plr,"player:ekipaoff",false)
                end
            return
        else
            if getElementData(plr, "player:ekipaoff") then return triggerClientEvent(plr, "iyw_notifications:send", plr, "info", "Posiadasz wy??czony chat ekipy - Twoja wiadomo?? nie zosta?a wys?ana.") end
            local msg = table.concat({...}, " ")
            ranga = nil
            
            local rank = getVisualRank(plr)
            if rank then
                ranga = rank
            else
                ranga = rangi[tonumber(getLevel(plr))]
            end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-08, 23:51


AsterBonzo

Otwórz ogień






Wiek: 21
Na forum: 3109 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 61

Respekt: 35,8

nametagi

local nametagFont = dxCreateFont( "droid-sans.ttf", 20 )
if not nametagFont then nametagFont = "default-bold" end
local vopisFont = dxCreateFont( "fonts/vopis.ttf", 20 )
if not vopisFont then vopisFont = "default-bold" end


local nametagScale = 0.8
local nametagScale2 = 0.8
local nametagAlpha = 180
local nametagColor =
{
    r = 255,
    g = 255,
    b = 255
} 

-- Funkcja nametag?w graczy i pojazd?w
-- zazwyczaj s? dla u?atwienia wygl?du.
addEventHandler("onClientRender", root, function()
        local rootx, rooty, rootz = getCameraMatrix()--getElementPosition(getLocalPlayer())
        for i, player in ipairs(getElementsByType("player",root,true)) do
            if player ~= localPlayer and getElementDimension(localPlayer)==getElementDimension(player) and getElementInterior(localPlayer)==getElementInterior(player) and getElementAlpha(player)>0 then
                local x,y,z = getPedBonePosition(player,8)
                local sx, sy = getScreenFromWorldPosition(x, y, z+0.43)
                local tx, ty = getScreenFromWorldPosition(x, y, z-0.43)
                local sxc,syc =getScreenFromWorldPosition(x, y, z+0.68)
                local progress= math.sin(getTickCount()/300)*3
                if sx and sy and sxc and syc then
                local distance = getDistanceBetweenPoints3D(rootx, rooty, rootz, x, y, z)
                local fX = sx
                local fY = sy
                local alpha = 120                                             
                if(distance <= 22) then
                  if isLineOfSightClear( rootx,rooty,rootz, x,y,z, true, false, false, true, false, false, true,localPlayer ) then
                    local name=getPlayerName(player).." ("..getElementData(player,"id")..")"
                    local level = tonumber(getElementData(player, "player:level"))
                    if not getElementData(player,"p:inv") then 
                    if level == 1 then
                    dxDrawText("&#9658;Supporter&#9668;", sxc, syc, sxc, syc, tocolor(0, 102, 0, 255), nametagScale2, nametagFont, "center", "center")
                    end
                    if level == 2 then
                    dxDrawText(" &#9658;Administrator&#9668;", sxc, syc, sxc, syc, tocolor(255, 0, 0, 255), nametagScale2, nametagFont, "center", "center")
                    end
                    if level == 3 then
                    dxDrawText("&#9658;Administrator RCON&#9668;", sxc, syc, sxc, syc, tocolor(149, 0, 0, 255), nametagScale2, nametagFont, "center", "center")
                    end
                    if level == 4 then
                    dxDrawText("&#9658;W?a?ciciel&#9668;", sxc, syc, sxc, syc, tocolor(50, 255, 255, 255), nametagScale2, nametagFont, "center", "center")
                    end
                    
                    dxDrawText (name:gsub("#%x%x%x%x%x%x",""),fX, fY, fX, fY,tocolor(0,0,0),nametagScale,nametagFont,"center","center",false,false,false,true,true,0,0,-50)
                    dxDrawText (name:gsub("#%x%x%x%x%x%x",""),fX, fY, fX, fY,tocolor(0,0,0),nametagScale,nametagFont,"center","center",false,false,false,true,true,0,0,-50)
                    dxDrawText (name,fX+1, fY+1, fX+1, fY+1,white,nametagScale,nametagFont,"center","center",false,false,false,true,true,0,0,-50)
                    --dxDrawText (name,fX+1, fY+1, fX+1, fY+1,white,nametagScale,nametagFont,"center","center",false,false,false,true,true )
                    --    dxDrawText(name, fX+1, fY+1, fX+1, fY+1, tocolor(0, 0, 0, alpha), nametagScale, nametagFont, "center", "center",false,false,false,false,true)
                        --dxDrawText(name, fX, fY, fX, fY, tocolor(255, 255, 255, alpha), nametagScale, nametagFont, "center", "center",false,false,false,false,true)
                    --dxDrawText(name, sx-1, sy-1, sx-1, sy-1, tocolor( 0, 0, 0, 255), 1.5-distance/15, "default-bold", "center", "center")
                    if getElementData(localPlayer,"player:faction") == "samc-sf" then
                    dxDrawRectangle(sx-25*2-1, sy+5*2, 100-distance, 18+2-distance/2.0, tocolor(27,27,27,155)) 
                    dxDrawRectangle(sx-25*2, sy+5*2+1, getElementHealth(player)-distance, 18-distance/1.0, tocolor(255,5,5,155))
                    end
                    end
                  end
                end
            end
        end
    end
    for i,ped in ipairs(getElementsByType("ped")) do
        if ped~=localPlayer and getElementDimension(localPlayer)==getElementDimension(ped) and getElementInterior(localPlayer) == getElementInterior(ped) and getElementAlpha(ped) > 0 then
            local x,y,z=getElementPosition(ped)
            local sx,sy =getScreenFromWorldPosition(x, y, z+1)
            if sx and sy then
                local desc=getElementData(ped,"ped:desc")
                if desc then
                    local distance = getDistanceBetweenPoints3D(rootx,rooty,rootz,x,y,z)
                    if distance <= 18 then
                        dxDrawText(desc, sx+1, sy+1, sx+1, sy+1, tocolor(0, 0, 0, 255), 1.4-distance/15, font, "center", "center")
                        dxDrawText(desc, sx, sy, sx, sy, tocolor(255, 255, 255, 255), 1.4-distance/15, font, "center", "center")
                    end
                end
            end
        end
    end
    for i,vehicle in ipairs(getElementsByType("vehicle")) do
        local x,y,z=getElementPosition(vehicle)
        local sx,sy=getScreenFromWorldPosition(x,y,z)
        if sx and sy then
            local desc=getElementData(vehicle,"vehicle:desc")
            if desc then
                local distance=getDistanceBetweenPoints3D(rootx,rooty,rootz,x,y,z)
                if distance <= 25 then
                    if isLineOfSightClear( rootx,rooty,rootz, x,y,z, true, false, false, true, false, false, true,localPlayer ) then
                    dxDrawText(desc:gsub("#%x%x%x%x%x%x",""), sx, sy, sx, sy, tocolor(255, 255, 255, 255), 0.63, vopisFont, "center", "center")
                    end
                end
            end
        end
    end
end)

addEventHandler("onClientResourceStart", resourceRoot, function()
    for _,v in ipairs(getElementsByType("player")) do
        setPlayerNametagShowing(v, false)
    end
end)

addEventHandler("onClientPlayerSpawn", root,  function()
    setPlayerNametagShowing(source, false)
end)


Podpis

Pomagam jak potrafię :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-09, 00:14


MESTIHD







Wiek: 23
Na forum: 3721 dni
Posty: 36
Nick w MP: MESTI

Piwa: 1

Respekt: 50

Problem Rozwi?zany! Mozna zamkn??

Postaw piwo autorowi tego posta
 

 
Tagi: kłopot :: rangami
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Kłopot z Rangami Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku