Wysłany: 2016-09-16, 17:37
iksik
Wiek: 26 Na forum: 3571 dni Posty: 37
Witam,
Chcia?bym si? dowiedzie? jak zrobi? napis nad g?ow? pod ACL. Chcia?bym, aby ten napis by? w kolorze (rgb). Pozycj? powinienem sam ogarn?? raczej. Prosz? o podanie funkcji jakie b?d? musia? u?y?.
Wysłany: 2016-09-16, 20:07
eject
kurdebele
Wiek: 30 Na forum: 3659 dni Posty: 182
Nick w MP: EjecT
Piwa : 2456
Funkcje:
dxDrawText
getPlayerName
getCameraMatrix
getScreenFromWorldPosition
getDistanceBetweenPoints3D
Wysłany: 2016-09-16, 21:17
iksik
Wiek: 26 Na forum: 3571 dni Posty: 37
A jak to teraz w ca?o?? z?o?y??
Wysłany: 2016-09-16, 21:28
eject
kurdebele
Wiek: 30 Na forum: 3659 dni Posty: 182
Nick w MP: EjecT
Piwa : 2456
strona klienta;
addEventHandler ( "onClientRender" , root , function()
local nametagFont = "bankghotic"
local nametagScale2 = 1
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 konto = getAccount ( player )
local level
if isObjectInACLGroup ( "user." .. konto , aclGetGroup ( "RCON" ) ) then
local level = "RCON"
end
if isObjectInACLGroup ( "user." .. konto , aclGetGroup ( "Admin" ) ) then
local level = "Admin"
end
if level == "RCON" then
dxDrawText ( "RCON" , sxc , syc , sxc , syc , tocolor ( 0 , 102 , 0 , 255 ), nametagScale2 , nametagFont , "center" , "center" )
end
if level == "Admin" then
dxDrawText ( "ADMIN" , sxc , syc , sxc , syc , tocolor ( 255 , 0 , 0 , 255 ), nametagScale2 , nametagFont , "center" , "center" )
end
end
end
end
end
end
Ostatnio zmieniony przez eject 2016-09-16, 21:30, w całości zmieniany 2 razy
Wysłany: 2016-09-16, 21:34
iksik
Wiek: 26 Na forum: 3571 dni Posty: 37
[2016-09-16 21:33] ERROR: Loading script failed: ranganadglowa/ranga_s.lua:1: unexpected symbol near ']'
Wysłany: 2016-09-16, 21:36
eject
kurdebele
Wiek: 30 Na forum: 3659 dni Posty: 182
Nick w MP: EjecT
Piwa : 2456
Wklej ten kod i ustaw kodowanie na UTF-8
addEventHandler ( "onClientRender" , root , function()
local nametagFont = "bankghotic"
local nametagScale2 = 1
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 konto = getAccount ( player )
local level = getElementData ( player , "level" )
if isObjectInACLGroup ( "user." .. konto , aclGetGroup ( "RCON" ) ) then
setElementData ( player , "level" ) = "RCON"
end
if isObjectInACLGroup ( "user." .. konto , aclGetGroup ( "Admin" ) ) then
setElementData ( player , "level" ) = "Admin"
end
if level == "RCON" then
dxDrawText ( "RCON" , sxc , syc , sxc , syc , tocolor ( 0 , 102 , 0 , 255 ), nametagScale2 , nametagFont , "center" , "center" )
end
if level == "Admin" then
dxDrawText ( "ADMIN" , sxc , syc , sxc , syc , tocolor ( 255 , 0 , 0 , 255 ), nametagScale2 , nametagFont , "center" , "center" )
end
end
end
end
end
end
Ostatnio zmieniony przez eject 2016-09-16, 21:39, w całości zmieniany 1 raz
Wysłany: 2016-09-16, 21:37
iksik
Wiek: 26 Na forum: 3571 dni Posty: 37
Wklei?em teraz po tym jak zmieni?e? na cytat i mam taki b??d:
[2016-09-16 21] ERROR: Loading script failed: ranganadglowa/ranga_s.lua:33: 'end' expected (to close 'function' at line 1) near '<eof>'
Wysłany: 2016-09-16, 21:40
eject
kurdebele
Wiek: 30 Na forum: 3659 dni Posty: 182
Nick w MP: EjecT
Piwa : 2456
dodaj jednego end na ko?cu i zmie? kodowanie na UTF-8
Wysłany: 2016-09-16, 21:40
iksik
Wiek: 26 Na forum: 3571 dni Posty: 37
To co pisa?e? z tym kodowaniem mam b??d:
[2016-09-16 21:40] SCRIPT ERROR: ranganadglowa/ranga_s.lua:17: unexpected symbol near '='
[2016-09-16 21:40] ERROR: Loading script failed: ranganadglowa/ranga_s.lua:17: unexpected symbol near '='
Wysłany: 2016-09-16, 21:41
eject
kurdebele
Wiek: 30 Na forum: 3659 dni Posty: 182
Nick w MP: EjecT
Piwa : 2456
i to ma by? strona klienta zmie? w meta.xml
[ Dodano : 2016-09-16, 21:42 ]
Ca?y dzia?aj?cy kod:
addEventHandler ( "onClientRender" , root , function()
local nametagFont = "bankghotic"
local nametagScale2 = 1
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 konto = getAccount ( player )
local level = getElementData ( player , "level" )
if isObjectInACLGroup ( "user." .. konto , aclGetGroup ( "RCON" ) ) then
setElementData ( player , "level" , "RCON" )
end
if isObjectInACLGroup ( "user." .. konto , aclGetGroup ( "Admin" ) ) then
setElementData ( player , "level" , "Admin" )
end
if level == "RCON" then
dxDrawText ( "RCON" , sxc , syc , sxc , syc , tocolor ( 0 , 102 , 0 , 255 ), nametagScale2 , nametagFont , "center" , "center" )
end
if level == "Admin" then
dxDrawText ( "ADMIN" , sxc , syc , sxc , syc , tocolor ( 255 , 0 , 0 , 255 ), nametagScale2 , nametagFont , "center" , "center" )
end
end
end
end
end
end
end
Wysłany: 2016-09-16, 21:46
iksik
Wiek: 26 Na forum: 3571 dni Posty: 37
Nadal b??dy wyskakuj? w DB3.
Wysłany: 2016-09-16, 21:48
eject
kurdebele
Wiek: 30 Na forum: 3659 dni Posty: 182
Nick w MP: EjecT
Piwa : 2456
Je?li dzia?a prosi?bym o
[ Dodano : 2016-09-16, 21:48 ]
daj mi tw?j kod i ss b?ed?w
Wysłany: 2016-09-16, 21:52
iksik
Wiek: 26 Na forum: 3571 dni Posty: 37
Kod:
addEventHandler ( "onClientRender" , root , function()
local nametagFont = "bankghotic"
local nametagScale2 = 1
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 konto = getAccount ( player )
local level = getElementData ( player , "level" )
if isObjectInACLGroup ( "user." .. konto , aclGetGroup ( "RCON" ) ) then
setElementData ( player , "level" , "RCON" )
end
if isObjectInACLGroup ( "user." .. konto , aclGetGroup ( "Admin" ) ) then
setElementData ( player , "level" , "Admin" )
end
if level == "RCON" then
dxDrawText ( "RCON" , sxc , syc , sxc , syc , tocolor ( 0 , 102 , 0 , 255 ), nametagScale2 , nametagFont , "center" , "center" )
end
if level == "Admin" then
dxDrawText ( "ADMIN" , sxc , syc , sxc , syc , tocolor ( 255 , 0 , 0 , 255 ), nametagScale2 , nametagFont , "center" , "center" )
end
end
end
end
end
end
end
SS b??d?w: http://imgur.com/a/NQSyb
Ostatnio zmieniony przez iksik 2016-09-16, 21:53, w całości zmieniany 1 raz
Wysłany: 2016-09-16, 21:55
eject
kurdebele
Wiek: 30 Na forum: 3659 dni Posty: 182
Nick w MP: EjecT
Piwa : 2456
addEventHandler ( "onClientRender" , root , function()
local nametagFont = "bankghotic"
local nametagScale2 = 1
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 konto = getAccount ( player )
local level = getElementData ( player , "level" )
if isObjectInACLGroup ( "user." .. konto , aclGetGroup ( "RCON" ) ) then
setElementData ( player , "level" , "RCON" )
end
if isObjectInACLGroup ( "user." .. konto , aclGetGroup ( "Admin" ) ) then
setElementData ( player , "level" , "Admin" )
end
if level == "RCON" then
dxDrawText ( "RCON" , sxc , syc , sxc , syc , tocolor ( 0 , 102 , 0 , 255 ), nametagScale2 , nametagFont , "center" , "center" )
end
if level == "Admin" then
dxDrawText ( "ADMIN" , sxc , syc , sxc , syc , tocolor ( 255 , 0 , 0 , 255 ), nametagScale2 , nametagFont , "center" , "center" )
end
end
end
end
end
end
end )
Wysłany: 2016-09-16, 21:58
iksik
Wiek: 26 Na forum: 3571 dni Posty: 37
B??d?w nie pokazuje, ale, aby zobaczy? czy dzia?a musz? poczeka? na koleg?, dzi?ki za pomoc oczywi?cie dam zimne piwko jak b?dzie dzia?a?.
Tagi: napis :: nad :: głową :: pod :: acl
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: