Jump to content

مطلوب كود


Recommended Posts

الى اسم الصورة vip استبدل

function dxshow() 
    for i, player in ipairs(getElementsByType("player")) do 
    local x, y, z = getPedBonePosition(player, 5) 
    dxDrawMaterialLine3D(x, y, z+0.8, x, y, z+0.3, dxCreateTexture("vip.png"), 0.5, tocolor(255,255,255,255)) 
    end 
end 
addEventHandler("onClientRender", root,dxshow ) 

Link to comment
الى اسم الصورة vip استبدل
function dxshow() 
    for i, player in ipairs(getElementsByType("player")) do 
    local x, y, z = getPedBonePosition(player, 5) 
    dxDrawMaterialLine3D(x, y, z+0.8, x, y, z+0.3, dxCreateTexture("vip.png"), 0.5, tocolor(255,255,255,255)) 
    end 
end 
addEventHandler("onClientRender", root,dxshow ) 

غلط ,

كذا الصورة للكل هو يبي صورة اللي معه

vip

فوقه الصورة ,

'onResourceStart' 
getAccountName 
getPlayerAccount 
isObjectInACLGroup 
aclGetGroup 
setElementData 
triggerClientEvent 
-----Client 
'onClientRender' 
guiGetScreenSize 
getElementData 
getElementPosition  
getScreenFromWorldPosition 
getCameraMatrix 
getDistanceBetweenPoints3D 
dxDrawImage 
Link to comment

^

كلامك صحيح بس هو يحط تحقق اذا كان في اي بي

هاد الكود كامل

سيرفر

local aclGroup = "Vip" 
addEventHandler('onPlayerLogin',root,  
function() 
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)),aclGetGroup(aclGroup)) then 
        setElementData( source, 'vip',true ) 
        else 
        setElementData( source, 'vip',false) 
    end 
end) 
  
  
addEventHandler( "onResourceStart", resourceRoot, function(    ) 
for i,v in ipairs ( getElementsByType("player") ) do 
  if not ( isGuestAccount(getPlayerAccount(v)) ) then 
     if isObjectInACLGroup("user."..getAccountName(getPlayerAccount( v )),aclGetGroup(aclGroup)) then 
               setElementData( v, 'vip',true ) 
               else 
               setElementData( v, 'vip',false )  
            end 
        end 
    end 
end ) 

كلنت

لا تنسا تبدل متغير الصورة

local Image = dxCreateTexture( "vip.png" ) 
addEventHandler("onClientRender", root, 
function () 
    for i, player in ipairs(getElementsByType("player")) do 
        if getElementData( player, "vip" ) then 
            local x, y, z = getPedBonePosition(player, 5) 
            dxDrawMaterialLine3D(x, y, z+0.8, x, y, z+0.3, Image, 0.5, tocolor(255,255,255,255)) 
        end 
    end 
end 
) 

Edited by Guest
Link to comment
^

كلامك صحيح بس هو يحط تحقق اذا كان في اي بي

هاد الكود كامل

سيرفر

local aclGroup = "Vip" 
addEventHandler('onPlayerLogin',root,  
function() 
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)),aclGetGroup(aclGroup)) then 
        setElementData( source, 'vip',true ) 
        else 
        setElementData( source, 'vip',false) 
    end 
end) 
  
  
addEventHandler( "onResourceStart", resourceRoot, function(    ) 
for i,v in ipairs ( getElementsByType("player") ) do 
  if not ( isGuestAccount(getPlayerAccount(v)) ) then 
     if isObjectInACLGroup("user."..getAccountName(getPlayerAccount( v )),aclGetGroup(aclGroup)) then 
               setElementData( v, 'vip',true ) 
               else 
               setElementData( v, 'vip',false )  
            end 
        end 
    end 
end ) 

كلنت

لا تنسا تبدل متغير الصورة

local Image = dxCreateTexture( "vip.png" ) 
addEventHandler("onClientRender", root, 
function () 
    for i, player in ipairs(getElementsByType("player")) do 
        if getElementData( player, "vip" ) then 
            local x, y, z = getPedBonePosition(player, 5) 
            dxDrawMaterialLine3D(x, y, z+0.8, x, y, z+0.3, Image, 0.5, tocolor(255,255,255,255)) 
        end 
    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

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...