Jump to content

اين الخطأ؟!


Recommended Posts

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

ومسويها ع الاكس بي وشغاله انما الفلوس لا .. " بنفس الاكواد "َ

 

هذا الكود + الدي بق مايقول انه في خطأ

 

addEvent("SendGiftMoney", true)
addEventHandler("SendGiftMoney", getRootElement(),
function(acc, moneyPlayer)
	local Account = getAccount(acc)
	local thePlayer = getAccountPlayer (Account)
	if isElement(thePlayer) then
		if Account then
	setElementData(acc, "Money", (getElementData(acc, "Money")) + tonumber(moneyPlayer))
			
			outputChatBox( "["..getPlayerName(thePlayer).."] تم إرسال الجائزة الي اللاعب",source, 100, 255, 100, true)
		else
          		outputChatBox("* Account did not exist !", source, 255, 0, 0)
end
       		
       	end

end
)

 

Link to comment
addEvent("SendGiftMoney", true)
addEventHandler("SendGiftMoney", getRootElement(),
function(acc, moneyPlayer)

	local Account = getAccount(acc)
	
	if not Account then
	
		return outputChatBox("* Account did not exist !", source, 255, 0, 0)
	end
	
	local thePlayer = getAccountPlayer (Account)
	
	if not thePlayer then
	
	outputChatBox ( "the player is offline" , source )
		return
	end

	setElementData(thePlayer, "Money", (getElementData(thePlayer, "Money") or 0 ) + tonumber(moneyPlayer))
			
	outputChatBox( "["..getPlayerName(thePlayer).."] تم إرسال الجائزة الي اللاعب",source, 100, 255, 100, true)

	end
	)

 

Link to comment
10 minutes ago, Abdul KariM said:

addEvent("SendGiftMoney", true)
addEventHandler("SendGiftMoney", getRootElement(),
function(acc, moneyPlayer)

	local Account = getAccount(acc)
	
	if not Account then
	
		return outputChatBox("* Account did not exist !", source, 255, 0, 0)
	end
	
	local thePlayer = getAccountPlayer (Account)
	
	if not thePlayer then
	
	outputChatBox ( "the player is offline" , source )
		return
	end

	setElementData(thePlayer, "Money", (getElementData(thePlayer, "Money") or 0 ) + tonumber(moneyPlayer))
			
	outputChatBox( "["..getPlayerName(thePlayer).."] تم إرسال الجائزة الي اللاعب",source, 100, 255, 100, true)

	end
	)

 

مايعطي فلوس يوم اضغط ع زر تسليم الجائزة ,

Link to comment
Just now, Abdul KariM said:

وش الرسالة الي تطلع بالشات ؟

تم اعطاء اللاعب ivor الجائزة 

 

ولكن ماياخذ الفلوس بس ياخذ الاكس بي

 

Link to comment
addEvent("SendGiftMoney", true)
addEventHandler("SendGiftMoney", getRootElement(),
function(acc, moneyPlayer)

	outputChatBox ( tostring ( moneyPlayer ) )

	local Account = getAccount(acc)
	
	if not Account then
	
		return outputChatBox("* Account did not exist !", source, 255, 0, 0)
	end
	
	local thePlayer = getAccountPlayer (Account)
	
	if not thePlayer then
	
	outputChatBox ( "the player is offline" , source )
		return
	end

	setElementData(thePlayer, "Money", (getElementData(thePlayer, "Money") or 0 ) + tonumber(moneyPlayer))
			
	outputChatBox( "["..getPlayerName(thePlayer).."] تم إرسال الجائزة الي اللاعب",source, 100, 255, 100, true)

	end
	)

جرب هذا وعطني وش يطلع لك بالشات

Link to comment
3 minutes ago, Abdul KariM said:

addEvent("SendGiftMoney", true)
addEventHandler("SendGiftMoney", getRootElement(),
function(acc, moneyPlayer)

	outputChatBox ( tostring ( moneyPlayer ) )

	local Account = getAccount(acc)
	
	if not Account then
	
		return outputChatBox("* Account did not exist !", source, 255, 0, 0)
	end
	
	local thePlayer = getAccountPlayer (Account)
	
	if not thePlayer then
	
	outputChatBox ( "the player is offline" , source )
		return
	end

	setElementData(thePlayer, "Money", (getElementData(thePlayer, "Money") or 0 ) + tonumber(moneyPlayer))
			
	outputChatBox( "["..getPlayerName(thePlayer).."] تم إرسال الجائزة الي اللاعب",source, 100, 255, 100, true)

	end
	)

جرب هذا وعطني وش يطلع لك بالشات

مايطلع شي بالشات ولا يعطي فلوس الا لو حطيت قيمة الاكس بي يعطي اكس بي ويطلع بالشات فقط

 

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

 

Error: GivePrizes\server.lua:17: attempt to compare nil with number

 

ومايطلع شي بالشات

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