Jump to content

طلب فنكشات يجي كتابه فوق راس لاعب معاه رتبه معينه


Recommended Posts

^ +
dxDrawText -- خلي الكلام دي اكس 

ممكن شوي شرح زيادة الحين يوم استخدمتها يجيني اسم المنطقه الي انا فيها

شلون اخليها فوق راس اللاعب

ومو كل اللاعبين +عشان اضيف القروب المحدد

Link to comment

هذي صورهـ لكن عدلها تعديل بسيط وسوها تكست .

... وهذا فنكشن بجانب سيرفر isObjectInACLGroup انت مستخدم

هذي طريقة عشان الصورة تكون لقروب محدد ..

Client Side !

local Url = "crown.png" --- اسسم الصورة هنا 
local zUP = 10 ---- ارتفأع الصورة 
      
addEventHandler( "onClientRender", root, function (  ) 
 for _,v in ipairs ( getElementsByType ( "player" ) ) do 
  if ( getElementData ( v, "VIPData" ) == true ) then 
    local x, y, z = getElementPosition( v ) 
    local Mx, My, Mz = getCameraMatrix(   ) 
    if ( getDistanceBetweenPoints3D( x, y, z, Mx, My, Mz ) <= 15 ) then 
       local WorldPositionX, WorldPositionY = getScreenFromWorldPosition( x, y, z + zUP, 0.07 ) 
        if ( WorldPositionX and WorldPositionY ) then 
              dxDrawImage( WorldPositionX, WorldPositionY, WorldPositionX, WorldPositionY, Url ) 
           end 
        end 
      end 
   end 
end ) 

Server Side !

addEventHandler ( "onResourceStart", resourceRoot, function (  ) 
  for _,players in ipairs ( getElementsByType ( "player" ) ) do 
    if  ( getPlayerAccount( players ) and not isGuestAccount( getPlayerAccount( players ) ) ) then 
     if ( isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( players ) ), aclGetGroup ( "V.I.P" ) ) ) then 
             setElementData ( players, "VIPData", true ) 
          end 
       end 
    end 
end )    
  
  
addEventHandler ( "onPlayerLogin", root, function ( _,acc ) 
  if ( isObjectInACLGroup ( "user."..getAccountName( acc ), aclGetGroup ( "V.I.P" ) ) ) then 
       setElementData ( source, "VIPData", true ) 
    end 
end ) 
  
addEventHandler ( "onPlayerLogout", root, function ( acc ) 
  if ( isObjectInACLGroup ( "user."..getAccountName( acc ), aclGetGroup ( "V.I.P" ) ) ) then 
       removeElementData ( source, "VIPData" ) 
    end 
end ) 
Link to comment

كلينت

local Url = "3.png" 
local zUP = 10 
      
addEventHandler( "onClientRender", root, function (  ) 
 for _,v in ipairs ( getElementsByType ( "player" ) ) do 
  if ( getElementData ( v, "VIPData" ) == true ) then 
    local x, y, z = getElementPosition( v ) 
    local Mx, My, Mz = getCameraMatrix(   ) 
    if ( getDistanceBetweenPoints3D( x, y, z, Mx, My, Mz ) <= 15 ) then 
       local WorldPositionX, WorldPositionY = getScreenFromWorldPosition( x, y, z + zUP, 0.07 ) 
        if ( WorldPositionX and WorldPositionY ) then 
              dxDrawImage( WorldPositionX, WorldPositionY, WorldPositionX, WorldPositionY, Url ) 
           end 
        end 
      end 
   end 
end ) 

سيرفر

addEventHandler ( "onResourceStart", resourceRoot, function (  ) 
  for _,players in ipairs ( getElementsByType ( "player" ) ) do 
    if  ( getPlayerAccount( players ) and not isGuestAccount( getPlayerAccount( players ) ) ) then 
     if ( isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( players ) ), aclGetGroup ( "Console" ) ) ) then 
             setElementData ( players, "VIPData", true ) 
          end 
       end 
    end 
end )   
  
  
addEventHandler ( "onPlayerLogin", root, function ( _,acc ) 
  if ( isObjectInACLGroup ( "user."..getAccountName( acc ), aclGetGroup ( "Console" ) ) ) then 
       setElementData ( source, "VIPData", true ) 
    end 
end ) 
  
addEventHandler ( "onPlayerLogout", root, function ( acc ) 
  if ( isObjectInACLGroup ( "user."..getAccountName( acc ), aclGetGroup ( "Console" ) ) ) then 
       removeElementData ( source, "VIPData" ) 
    end 
end ) 

Link to comment

عندي مشكله انا سويت كود يجي صوره ل واحد معاه رتبة فيب

بس يوم اسجل ما يجي التاج فوق راسي يجي فوق الاعبين

Client

local tag = dxCreateTexture("img/crown.png") 
  
addEventHandler("onClientPreRender", root, 
function() 
 for i, player in ipairs ( getElementsByType ( "player" ) ) do 
 --for i, player in ipairs(getElementsByType("player")) do 
   if player ~= localPlayer and ( getElementData ( localPlayer, "VIPData" ) == true ) then 
   local x, y, z = getPedBonePosition(player, 5) 
   dxDrawMaterialLine3D(x, y, z+0.5, x, y, z+0.3, tag, 0.7, tocolor(255,255,255,255)) 
  end 
 end 
 end 
 ) 

Server

addEventHandler ( "onResourceStart", resourceRoot, function (  ) 
  for _,players in ipairs ( getElementsByType ( "player" ) ) do 
    if  ( getPlayerAccount( players ) and not isGuestAccount( getPlayerAccount( players ) ) ) then 
     if ( isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( players ) ), aclGetGroup ( "VIP" ) ) ) then 
             setElementData ( players, "VIPData", true ) 
          end 
       end 
    end 
end )   
  
  
addEventHandler ( "onPlayerLogin", root, function ( _,acc ) 
  if ( isObjectInACLGroup ( "user."..getAccountName( acc ), aclGetGroup ( "VIP" ) ) ) then 
       setElementData ( source, "VIPData", true ) 
    end 
end ) 

Link to comment

طيب وش مشكلة

عندي مشكله انا سويت كود يجي صوره ل واحد معاه رتبة فيب

بس يوم اسجل ما يجي التاج فوق راسي يجي فوق الاعبين

Client

local tag = dxCreateTexture("img/crown.png") 
  
addEventHandler("onClientPreRender", root, 
function() 
 for i, player in ipairs ( getElementsByType ( "player" ) ) do 
 --for i, player in ipairs(getElementsByType("player")) do 
   if player ~= localPlayer and ( getElementData ( localPlayer, "VIPData" ) == true ) then 
   local x, y, z = getPedBonePosition(player, 5) 
   dxDrawMaterialLine3D(x, y, z+0.5, x, y, z+0.3, tag, 0.7, tocolor(255,255,255,255)) 
  end 
 end 
 end 
 ) 

Server

addEventHandler ( "onResourceStart", resourceRoot, function (  ) 
  for _,players in ipairs ( getElementsByType ( "player" ) ) do 
    if  ( getPlayerAccount( players ) and not isGuestAccount( getPlayerAccount( players ) ) ) then 
     if ( isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( players ) ), aclGetGroup ( "VIP" ) ) ) then 
             setElementData ( players, "VIPData", true ) 
          end 
       end 
    end 
end )   
  
  
addEventHandler ( "onPlayerLogin", root, function ( _,acc ) 
  if ( isObjectInACLGroup ( "user."..getAccountName( acc ), aclGetGroup ( "VIP" ) ) ) then 
       setElementData ( source, "VIPData", true ) 
    end 
end ) 

-
Link to comment

ما ادري عن الكود لو في اخطاء ثانية لكن جرب :

local tag = dxCreateTexture("img/crown.png") 
  
addEventHandler("onClientPreRender", root, 
function() 
 for i, player in ipairs ( getElementsByType ( "player" ) ) do 
 --for i, player in ipairs(getElementsByType("player")) do 
   if ( getElementData ( player, "VIPData" ) == true ) then 
   local x, y, z = getPedBonePosition(player, 5) 
   dxDrawMaterialLine3D(x, y, z+0.5, x, y, z+0.3, tag, 0.7, tocolor(255,255,255,255)) 
  end 
 end 
 end 
 ) 

انا جربت الكود وشغال بس ما ادري صراحة يمكن المشكلة من عندك xb0 بالنسبة لـ

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...