Szerző Téma: TÖRÖLHETŐ  (Megtekintve 870 alkalommal)

TÖRÖLHETŐ
« Dátum: 2019. Április 22. - 17:09:25 »
0
TÖRÖLHETŐ
« Utoljára szerkesztve: 2019. Május 21. - 18:01:00 írta Killerke23 »

TÖRÖLHETŐ
« Válasz #1 Dátum: 2019. Április 23. - 08:06:57 »
0
 
 


local screenWidth,screenHeight = guiGetScreenSize()
 
function renderDisplay ( )
local seconds = getTickCount() / 1000
local angle = math.sin(seconds) * 80
 
  players = getElementsByType ( \"player\" )
  for k,v in ipairs(players) do
     local accountname = \"\"
     if (isGuestAccount(getPlayerAccount(v)) == false) then
        accountname = getAccountName (getPlayerAccount(v))
        if isObjectInACLGroup ( \"user.\" .. accountname, aclGetGroup ( \"admin\" ) ) then
         dxDrawImage ( screenWidth/2 - 50, 0, 100, 240, \'arrow.png\', angle, 0, -120 )
        end
     end
  end
end
addEventHandler(\"onClientRender\", root, renderDisplay)

 
Elvileg ez működőképes. Bár nem nagyon szórakoztam még ACL-el. Viszont így nem lesz a fejük felett a logo. Arra figyelj.

TÖRÖLHETŐ
« Válasz #2 Dátum: 2019. Április 23. - 13:26:31 »
0
Rendben. Köszönöm, de én úgy szeretném hogy a megadott logo, ott legyen az admin felett akkor amikor beírja hogy /login Xy Xy
 
és utána bejelentkezett és akkor jelenítse meg. :)
 
 
« Utoljára szerkesztve: 2019. Április 23. - 13:35:56 írta Killerke23 »

Nem elérhető Fuzzy

TÖRÖLHETŐ
« Válasz #3 Dátum: 2019. Április 23. - 20:37:07 »
0

local screenWidth, screenHeight = guiGetScreenSize()
addEventHandler(\"onClientRender\", getRootElement(), function()
    local lx, ly, lz = getElementPosition(localPlayer)
for k,v in ipairs(getElementsByType(\"player\")) do
    if isElement(v) and isElementOnScreen(v) then
       if v ~= localPlayer then
          local tx, ty, tz = getElementPosition(v) --másik játékos pozíciója
         local bx, by, bz = getPedBonePosition(v, 4) -- fejcsont pozíció
         if getDistanceBetweenPoints3D(lx, ly, lz, tx, ty, tz) < 20 then
             local sx, sy = getScreenFromWorldPosition(tx, ty, bz+0.5)
            if sx and sy then
                local accountName = getAccountName(getPlayerAccount(v))
               if isObjectInACLGroup ( \"user.\" .. accountName, aclGetGroup ( \"admin\" ) ) then
                   local w, h = 100, 100
                  local sx, sy = sx-w/2, sy-h
                   dxDrawImage (sx, sy, w, h, \"arrow.png\")
               end
            end
         end
      end
   end
end
end)

 
Gyorsan elkészítettem egyet, lehetőleg középre helyezi a képet a játékos fölött. Még nem teszteltem, de ha gond van jelezd!
« Utoljára szerkesztve: 2019. Április 23. - 20:38:16 írta Fuzzy »

TÖRÖLHETŐ
« Válasz #4 Dátum: 2019. Április 23. - 21:32:28 »
0
Nem tudom, nekem kell látni vagy a másik playernek?
 
Így jó?
 
meta.xml   
 
<meta>
    <info author=\"PETke\" name=\"Adminlogok\" version=\"3.0.1\" type=\"script\" />
    <script src=\"sourceC.lua\" type=\"client\"/>    
    <file src=\"files/Admin.png\" type=\"client\" />
</meta>
 
és amit készítettél
 
local screenWidth, screenHeight = guiGetScreenSize()
addEventHandler(\"onClientRender\", getRootElement(), function()
    local lx, ly, lz = getElementPosition(localPlayer)
    for k,v in ipairs(getElementsByType(\"player\")) do
        if isElement(v) and isElementOnScreen(v) then
            if v ~= localPlayer then
                local tx, ty, tz = getElementPosition(v) --másik játékos pozíciója
                local bx, by, bz = getPedBonePosition(v, 4) -- fejcsont pozíció
                if getDistanceBetweenPoints3D(lx, ly, lz, tx, ty, tz) < 20 then
                    local sx, sy = getScreenFromWorldPosition(tx, ty, bz+0.5)
                    if sx and sy then
                        local accountName = getAccountName(getPlayerAccount(v))
                        if isObjectInACLGroup ( \"user.\" .. accountName, aclGetGroup ( \"admin\" ) ) then
                            local w, h = 100, 100
                            local sx, sy = sx-w/2, sy-h
                            dxDrawImage (sx, sy, w, h, \"arrow.png\")
                        end
                    end
                end
            end
        end
    end
end
 
Nem tudom valamiért nem mutatja :(
« Utoljára szerkesztve: 2019. Április 23. - 21:47:30 írta Killerke23 »

Nem elérhető Fuzzy

TÖRÖLHETŐ
« Válasz #5 Dátum: 2019. Április 24. - 18:50:50 »
0
arrow.png-t cseréld ki \"files/Admin.png\" re :)

TÖRÖLHETŐ
« Válasz #6 Dátum: 2019. Április 24. - 19:29:48 »
0
Nem... nem jó
« Utoljára szerkesztve: 2019. Április 25. - 14:04:17 írta Killerke23 »

TÖRÖLHETŐ
« Válasz #7 Dátum: 2019. Május 18. - 09:22:50 »
0
Szia, bocsi egy pár hét elteltével. de jó lenne csak a  \"screenWidth\" írja ki hogy nil value

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal