Jump to content

x[استفسار]xبخصوص الداتا


Recommended Posts

8 hours ago, Master_MTA said:

اخوي معليش الان وش الغلط

@N3xT


setTimer(function()
 
 
for k,v in ipairs(getElementsByType('player'))do
local g1 = getElementData(v,"pointplayer")
taple={gi}
if getElementData(v,"pointplayer") then
if getPlayerTeam(v)then
if table.sort(taple)==1 then
setElementData(v,"bestplr",getPlayerName(v))
end
end
end
end
 end,250,0)

 

كودك كله كله غلط

Link to comment
setTimer(function()
 
 
for k,v in ipairs(getElementsByType('player'))do
local g1 = getElementData(v,"pointplayer")
taple={g1}
if getElementData(v,"pointplayer") then
if getPlayerTeam(v)then
if table.sort(taple)==1 then
setElementData(v,"bestplr",getPlayerName(v))
end
end
end
end
 end,250,0)

جرب كذا

@Kara

اتوقع الغلط عندك في ذا انت كاتبه كذا

taple={gi}

بدل

taple={g1}

 

Edited by MR.Mosa
Link to comment
5 minutes ago, said:

جرب عيد اضافة الاعبين في جدول

ما فهمت عليك جربت اكثر من مره

كذا صحيح؟

setTimer(function()
 
  local bestplayer = table.sort(getElementsByType("player"), function(a, b)
    return 

	(getElementData(a, "pointplayer")or 0) > (getElementData(b, "pointplayer")or 0)
	
end)[1]
for k,v in ipairs(getElementsByType('player'))do
if getElementData(v,"pointplayer") == bestplayer then
setElementData(resourceRoot,"bestplr",getPlayerName(v))
 end
end

 end,250,0)

@</Mr.Tn6eL>

Edited by Master_MTA
Link to comment
setTimer(function()
	local bestplayer = table.sort(getElementsByType("player"), function(a, b)
	return (getElementData(a, "النقاط")or 0) > (getElementData(b, "النقاط")or 0)
end)[1]
setElementData(resourceRoot,"bestPlayer",bestplayer)
end,250,0)

عدل كلمة النقاط إلى الداتا حق نقاط اللاعب

وعشان تجيب أفضل لاعب جيب الداتا bestPlayer

Link to comment
36 minutes ago, N3xT said:

setTimer(function()
	local bestplayer = table.sort(getElementsByType("player"), function(a, b)
	return (getElementData(a, "النقاط")or 0) > (getElementData(b, "النقاط")or 0)
end)[1]
setElementData(resourceRoot,"bestPlayer",bestplayer)
end,250,0)

عدل كلمة النقاط إلى الداتا حق نقاط اللاعب

وعشان تجيب أفضل لاعب جيب الداتا bestPlayer

ما زبط نفس الشي

Link to comment

@Master_MTA

 

جرب هذا وعدل اسم داتا القتل او النقاط باول شيء :

 

aKillsData = 'داتا النقاط'

function aUpdateKiller ( 		)
	aTopKiller = {		};
	for _,v in ipairs( getElementsByType ( 'player') ) do 
		if getElementData ( v,aKillsData ) then
  		  table.insert ( aTopKiller,{ ['aName'] = getPlayerName ( v ),['aScore'] = getElementData ( v,aKillsData ) } );
  		end;
	end;
	table.sort ( aTopKiller, function ( a,b )  return a.aScore > b.aScore end ); 
end;
aUpdateKiller ( 		);

addEventHandler ( 'onClientElementDataChange',root,
	function (	aD )
		if aD == aKillsData then
			aUpdateKiller ( 		);
		end
	end
);

local aX,aY = guiGetScreenSize ( ) 
addEventHandler ( 'onClientRender',root,
function  ( )
	if #aTopKiller > 0 then
   		 dxDrawText ( 'Top Player is : '..aTopKiller[1].aName..' and His score is : '..aTopKiller [1].aScore..'', 44, aY - 43, aX, aY, tocolor ( 255, 255, 255, 255 ), 1 ) 
   	end
end
)

 

  • Like 1
Link to comment
15 minutes ago, iPrestege said:

@Master_MTA

 

جرب هذا وعدل اسم داتا القتل او النقاط باول شيء :

 


aKillsData = 'داتا النقاط'

function aUpdateKiller ( 		)
	aTopKiller = {		};
	for _,v in ipairs( getElementsByType ( 'player') ) do 
		if getElementData ( v,aKillsData ) then
  		  table.insert ( aTopKiller,{ ['aName'] = getPlayerName ( v ),['aScore'] = getElementData ( v,aKillsData ) } );
  		end;
	end;
	table.sort ( aTopKiller, function ( a,b )  return a.aScore > b.aScore end ); 
end;
aUpdateKiller ( 		);

addEventHandler ( 'onClientElementDataChange',root,
	function (	aD )
		if aD == aKillsData then
			aUpdateKiller ( 		);
		end
	end
);

local aX,aY = guiGetScreenSize ( ) 
addEventHandler ( 'onClientRender',root,
function  ( )
	if #aTopKiller > 0 then
   		 dxDrawText ( 'Top Player is : '..aTopKiller[1].aName..' and His score is : '..aTopKiller [1].aScore..'', 44, aY - 43, aX, aY, tocolor ( 255, 255, 255, 255 ), 1 ) 
   	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...