Wysłany: 2021-07-29, 20:28
HubertK
Wiek: 20 Na forum: 2451 dni Posty: 21
Nick w MP: Ave
Piwa : 73
Cze??, og?lnie mam stary kod na DUTY, i nie wiem gdzie jest b??d. Pomo?ecie?
CLIENT
|
V
Kod:
local w, h = guiGetScreenSize()
skala = 0.7
wartosc = 0
czcionka = dxCreateFont("czcionka.ttf", 17)
tgn = false
addEventHandler("onClientRender",root,function()
local wartosc = wartosc + 0.05
for key, value in ipairs(getElementsByType("player")) do
if value ~= localPlayer then
setPlayerNametagShowing(value, false)
local nick = getPlayerName(value)
local cx, cy, cz = getCameraMatrix(value)
local x,y,z = getPedBonePosition(value, 8)
local wzWartosc = math.cos(wartosc)/10
local xs,ys,ds = getScreenFromWorldPosition(x,y,z+0.40)
local nx,ny,nz = getElementPosition(localPlayer)
local px, py,pz = getElementPosition(value)
local odleglosc = getDistanceBetweenPoints3D(nx,ny,nz,px,py,pz)
a = 255
if xs and ys and ds then
if isLineOfSightClear(cx,cy,cz,x,y,z,true,false,false,true,true,true,true,value) then
Grupa = ""
if getElementData(value, "duty")=="nadana_elementdata" then Grupa="napis widocznny nad glowa" end
if getElementData(value, "duty")=="admin" then Grupa="#830405Administrator RCON" end
if getElementData(value, "duty")=="DMPD" then Grupa="#0066FFDMPD | Cadet" end
if getElementData(value, "duty")=="smod" then Grupa="#007F01Support" end
local text="#FFFFFF "..Grupa..""
a=a-(odleglosc*17)
if tgn == true then return end
if a>0 then
dxDrawText(text,xs,ys+(18/ds),xs,ys,tocolor(0,0,0,a),skala,czcionka,"center","center",false,false,false,true,false)
end
end
end
end
end
end)
SERVER
|
V
Kod:
function opusc(plr)
local nazwa = getAccountName(getPlayerAccount(plr))
if isObjectInACLGroup("user."..nazwa, aclGetGroup("RCON")) or isObjectInACLGroup ( "user."..nazwa, aclGetGroup ( "DMPD" ) ) or isObjectInACLGroup ( "user."..nazwa, aclGetGroup ( "Support" ) ) then
setElementData(plr, "duty", false)
end
end
addCommandHandler("duty.ex", opusc)
function admin(plr)
local nazwa = getAccountName ( getPlayerAccount ( plr ) )
if isObjectInACLGroup ( "user." ..nazwa, aclGetGroup ( "RCON" ) ) then
setElementData(plr, "duty","rcon",true)
outputChatBox("Zalogowa?e?/-a? si? jako Administrator RCON.",plr)
else
outputChatBox("Nie posiadasz uprawnie? do wej?cia na rang?.",plr)
end
end
addCommandHandler("duty.rcon",admin)
function smod(plr)
local nazwa = getAccountName ( getPlayerAccount ( plr ) )
if isObjectInACLGroup ( "user." ..nazwa, aclGetGroup ( "DMPD" ) ) then
setElementData(plr, "duty", "DMPD", true)
outputChatBox("Rozpocz??e? s?u?be DMPD.",plr)
else
outputChatBox("[!] Nie jeste? zatrudniony w DMPD, b?d? nie jeste? na s?u?bie.",plr)
end
end
addCommandHandler("dmpd.cadet",smod)
function mod(plr)
local nazwa = getAccountName ( getPlayerAccount ( plr ) )
if isObjectInACLGroup ( "user." ..nazwa, aclGetGroup ( "Support" ) ) then
setElementData(plr, "duty","supp",true)
outputChatBox("Zalogowa?e?/-a? si? jako Support.",plr)
else
outputChatBox("Nie posiadasz uprawnie? do wej?cia na rang?.",plr)
end
end
addCommandHandler("duty.supp",mod)
Ostatnio zmieniony przez Dawidos. 2021-07-30, 12:25, w całości zmieniany 2 razy
Wysłany: 2021-07-30, 15:57
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Podaj b??dy z db3, nikt za ciebie tutaj tego nie zrobi
Wysłany: 2021-07-30, 21:47
HubertK
Wiek: 20 Na forum: 2451 dni Posty: 21
Nick w MP: Ave
Piwa : 73
Shuffle ,
Not Fount 'czcionka.ttf' Taki b??d, problem w tym ?e czcionka jest w folderze oraz w mecie.
Wysłany: 2021-07-30, 23:36
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
a dxCreateFont jest zaimplementowane powy?ej?
Wysłany: 2021-08-03, 20:50
HubertK
Wiek: 20 Na forum: 2451 dni Posty: 21
Nick w MP: Ave
Piwa : 73
sirphantasm ,
Tak jest, czasami b??du nie wywala lecz nie ma ?adnych nametag?w nad g?ow?.
Wysłany: 2021-08-04, 19:25
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
1. Wywal to z rendera setPlayerNametagShowing(value, false)
2. Podmien na ten kod c-side i sprawdz
local w , h = guiGetScreenSize ()
skala = 0.7
wartosc = 0
czcionka = dxCreateFont ( "czcionka.ttf" , 17 )
tgn = false
addEventHandler ( "onClientRender" , root ,function()
local wartosc = wartosc + 0.05
for key , value in ipairs ( getElementsByType ( "player" )) do
if value ~= localPlayer then
local nick = getPlayerName ( value )
local cx , cy , cz = getCameraMatrix ( value )
local x , y , z = getPedBonePosition ( value , 8 )
local wzWartosc = math . cos ( wartosc )/ 10
local xs , ys , ds = getScreenFromWorldPosition ( x , y , z + 0.40 )
local nx , ny , nz = getElementPosition ( localPlayer )
local px , py , pz = getElementPosition ( value )
local odleglosc = getDistanceBetweenPoints3D ( nx , ny , nz , px , py , pz )
a = 255
if xs and ys and ds then
if isLineOfSightClear ( cx , cy , cz , x , y , z , true , false , false , true , true , true , true , value ) then
Grupa = "Testowa grupa"
if getElementData ( value , "duty" )== "nadana_elementdata" then Grupa = "napis widocznny nad glowa" end
if getElementData ( value , "duty" )== "admin" then Grupa = "#830405Administrator RCON" end
if getElementData ( value , "duty" )== "DMPD" then Grupa = "#0066FFDMPD | Cadet" end
if getElementData ( value , "duty" )== "smod" then Grupa = "#007F01Support" end
local text = "#FFFFFF " .. Grupa .. ""
a = a -( odleglosc * 17 )
if tgn == true then return end
if a > 0 then
dxDrawText ( text , xs , ys +( 18 / ds ), xs , ys , tocolor ( 0 , 0 , 0 , a ), skala , czcionka , "center" , "center" , false , false , false , true , false )
end
end
end
end
end
end )
Tagi: nametag :: duty :: acl
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: