Jump to content

طلب كود تاج الاعب


Recommended Posts

Server Side !
function 
getPlayerAccount 
isGuestAccount  
isObjectInACLGroup 
setElementData 

Client Side !

'onClientRender' 
getElementPosition 
getScreenFromWorldPosition 
getCameraMatrix 
getDistanceBetweenPoints3D 
dxDrawText 

قال صورة

وناقصك كم فنشكن

  
"onResourceStart" -- حدث اول مايتشغل المود 
getElementsByType -- نسوي لوب لجميع الاعبين ونتحقق انهم بقروب الاسل ونحط لهم الدتا 
"onPlayerLogin" -- عند تسجيل دخول الاعب ونتحقق ان معه القروب ونسوي له الداتا 
dxDrawImage -- لصنع الصورة 
Link to comment

الكود مطروح سابقـأ .. :

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

Client Side !

local Url = "crown.png" --- اسسم الصورة هنا 
local zUP = 10 ---- ارتفأع الصورة 
      
addEventHandler( "onClientRender", root, function (  ) 
  if ( getElementData ( localPlayer, "VIPData" ) == true ) then 
    local x, y, z = getElementPosition( localPlayer ) 
    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 ) 

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 ) 
Link to comment
الكود مطروح سابقـأ .. :

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

Client Side !

local Url = "crown.png" --- اسسم الصورة هنا 
local zUP = 10 ---- ارتفأع الصورة 
      
addEventHandler( "onClientRender", root, function (  ) 
  if ( getElementData ( localPlayer, "VIPData" ) == true ) then 
    local x, y, z = getElementPosition( localPlayer ) 
    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 ) 

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 ) 

ذا يبين بس للاعب الي معاه الرتبه اما ل باقي الاعبين ما يبين

Link to comment
لا للاعبين جميعهم .. عشان الصورة تجي ع اللاعب نفسه

استخدم لوب عشان تظهر للكل

لان طريقتك راح تكون الصورة تطلع حق اللاعب الي عنده الداتا فقط

Link to comment

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 ) 
Edited by Guest
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...