Jump to content

طلب مبرمج يصلحلي كود سهل


Recommended Posts

سلام عليكم

الحين انا مسوي لما افوز بالديربي اخد نقطة

لكن المشكلة لما افوز نقاطي تصير من  0 ل 1 ولما افوز تاني نقاط تضل 1 ما تزيد نقطة ليه وش المشكلة ؟؟

الكود

حق الي يعطيني نقطة -

if tonumber(c) == 1 then
local winnerr = winner;
if not isGuestAccount ( getPlayerAccount ( winnerr ) ) then
	setAccountData ( getPlayerAccount ( winnerr ), "mypoi", ( getAccountData ( getPlayerAccount ( winnerr ) ) or 0 ) + 1 )
end

ياريت لو مبرمج يعرف يصلحه لي

وشكرا 

Link to comment

السلام عليكم ورحمة الله وبركاته

 

مافي غيرك بالقسم , عالعموم نسيت ارقمنت خاص ب getAccountData

الي هو الثاني الي يطلب اسم الداتا الي بتجيبها

 

if tonumber(c) == 1 then
local winnerr = winner;
if not isGuestAccount ( getPlayerAccount ( winnerr ) ) then
	setAccountData ( getPlayerAccount ( winnerr ), "mypoi", ( getAccountData ( getPlayerAccount ( winnerr ) , "mypoi" ) or 0 ) + 1 )
end

 

Link to comment
45 minutes ago, LoOs said:

السلام عليكم ورحمة الله وبركاته

 

مافي غيرك بالقسم , عالعموم نسيت ارقمنت خاص ب getAccountData

الي هو الثاني الي يطلب اسم الداتا الي بتجيبها

 


if tonumber(c) == 1 then
local winnerr = winner;
if not isGuestAccount ( getPlayerAccount ( winnerr ) ) then
	setAccountData ( getPlayerAccount ( winnerr ), "mypoi", ( getAccountData ( getPlayerAccount ( winnerr ) , "mypoi" ) or 0 ) + 1 )
end

 

تسلم ما قصرت بس كيف اخلي النقاط تظهر بالسكور بورد

انا سسويت

exports.scoreboard:addScoreboardColumn('mypoi') 

لكن تيجي في السكور بورد لكن ما يجي نقاط

@LoOs

Link to comment
exports['scoreboard']:addScoreboardColumn ( 'Point Derby' ) 

function getPlayerFromAccountName(name) 
    local acc = getAccount (name)
    if name and acc and not isGuestAccount (acc) then
        return getAccountPlayer (acc)
    else
        return false
    end
end

addEventHandler ( 'onAccountDataChange' , root , function ( Element , Key , Value ) 
if ( Key == 'mypoi' ) then 
setElementData ( getPlayerFromAccountName(getAccountName(Element)) , 'Point Derby' , tostring ( Value ) )  
end
end ) ; 

 

Link to comment
7 minutes ago, #Bangladsh said:

exports['scoreboard']:addScoreboardColumn ( 'Point Derby' ) 

function getPlayerFromAccountName(name) 
    local acc = getAccount (name)
    if name and acc and not isGuestAccount (acc) then
        return getAccountPlayer (acc)
    else
        return false
    end
end

addEventHandler ( 'onAccountDataChange' , root , function ( Element , Key , Value ) 
if ( Key == 'mypoi' ) then 
setElementData ( getPlayerFromAccountName(getAccountName(Element)) , 'Point Derby' , tostring ( Value ) )  
end
end ) ; 

 

تمام تسلم

معلش اخر سؤال

هاذا الكود بلوحة اعلي ناس موجودين بالسيرفر عندهم لفل - كيف احولها لاعلي ناس عندهم نقاط 

function getPlayersSortByaScore( )
	local TopScore = { }
	for _, aPlayer in next, getElementsByType 'player' do
		table.insert (
		TopScore,
		{
			player = aPlayer,
			player1 = getElementData ( aPlayer, "NameZarfa") or getPlayerName ( aPlayer ) ,
			aScore = getElementData ( aPlayer, 'Level' ) or 0
		}
	)
	end

 

Link to comment
1 minute ago, #Bangladsh said:

حول Level إلى Point Derby

في سطر 9

تمام تسلم

ومعلش اخر طلب - واسف علي الازعاج

ابي لو كتبت امر مثلا

/give اسم لاعب عدد نقاط احطه انا

يعطي للاعب دا نقاط محدده

وابي لو سويت

/sgive اسم لاعب ونقاط 

يسحب من لاعب النقاط المحدده

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