Jump to content

مساعدة دنميشن


Recommended Posts

8 minutes ago, MR.Nour said:

ماعرفت وين احط رقم الدنميشن + ماعرفت ادمجها مع الكتابة الي تظهر على الشاشة

تقدر تستخدم السكريبت دا 

-- Server
addCommandHandler('Dim',
function(player,command,...)
for i,v in ipairs(getElementsByType('player')) do
if (getElementDimension(v) == رقم الدمينشن اللي تبيه) then
Msg = {...}
outputChatBox(tostring(table.concat(Msg," ")),v,255,0,0,true)
end
end
end
)

-- Client
bindKey('f2','down','chatbox','Dim')

@MR.Nour

Edited by KillerX
Link to comment
20 minutes ago, Mr.Mostafa said:

مآ بتظهر غير للي بعآلم 2 فقط :D


function getElementsInDimension(theType,dimension)
    local elementsInDimension = { }
      for key, value in ipairs(getElementsByType(theType)) do
        if getElementDimension(value)==dimension then
        table.insert(elementsInDimension,value)
        end
      end
      return elementsInDimension
end

function draw(	)
	if getElementDimension(localPlayer, 2) then
	dxDrawText( "players in Dim : " .. tostring ( #getElementsInDimension ( "player" , 0 ) ) , 421, 454, 888, 539, tocolor(255, 255, 255, 255), 1, "default", "left", "top", false, false, true, false, false)
    end
end
addEventHandler ( "onClientRender" , root , draw )

 

كودك خطأ, مافيه غير ارقمنت 1 للفنكشن

getElementDimension

استعمل الرمزين ==

Link to comment
Just now, N3xT said:

كودك خطأ, مافيه غير ارقمنت 1 للفنكشن


getElementDimension

استعمل الرمزين ==

يب صح مآ آنتبهت , شكرآ علي آلتنبيه

تلخبطت مع set

 
function getElementsInDimension(theType,dimension)
    local elementsInDimension = { }
      for key, value in ipairs(getElementsByType(theType)) do
        if getElementDimension(value)==dimension then
        table.insert(elementsInDimension,value)
        end
      end
      return elementsInDimension
end

function draw(	)
	if ( getElementDimension ( localPlayer ) == 2 ) then
	dxDrawText( "players in Dim : " .. tostring ( #getElementsInDimension ( "player" , 0 ) ) , 421, 454, 888, 539, tocolor(255, 255, 255, 255), 1, "default", "left", "top", false, false, true, false, false)
    end
end
addEventHandler ( "onClientRender" , root , draw )

 

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