Jump to content

طلب كود


Recommended Posts

سلام عليكم

 

اريد طلب بسيط

 

انا سويت ايديت بوكس اكتب فيها الفلوس

ابي لما اكتب الفلوس فيها تشتغل ميزانيه توزع الفلوس اللي كتبتها بالتساوي على اللاعبين كل 5 دقايق توزع جزء

 

فهمتوني ؟

Link to comment

شوف اخي سوي فنكشن يطلع الاعبين المتواجدين بسيرفر حالياً

وبعدها سوي 

local Money = المبلغ الي باليدت اربطو 
local OnlinePlayer = الفنكشن حق الاعبين المتواجدين 
local MoneyPerOnline = math.floor((Money*X)/#OnlinePlayer);

 givePlayerMoney(root, MoneyPerOnline)

outputChatBox(root, " لقد حصلت على " .. MoneyPerOnline .. "", 255, 255, 255)

 

Edited by iyaad
Link to comment
51 minutes ago, Source|> said:

سلام عليكم

 

اريد طلب بسيط

 

انا سويت ايديت بوكس اكتب فيها الفلوس

ابي لما اكتب الفلوس فيها تشتغل ميزانيه توزع الفلوس اللي كتبتها بالتساوي على اللاعبين كل 5 دقايق توزع جزء

 

فهمتوني ؟

guiGetText
setTimer
getElementsByType
getPlayerCount
givePlayerMoney

 

Link to comment
1 hour ago, iyaad said:

شوف اخي سوي فنكشن يطلع الاعبين المتواجدين بسيرفر حالياً

وبعدها سوي 


local Money = المبلغ الي باليدت اربطو 
local OnlinePlayer = الفنكشن حق الاعبين المتواجدين 
local MoneyPerOnline = math.floor((Money*X)/#OnlinePlayer);

 givePlayerMoney(root, MoneyPerOnline)

outputChatBox(root, " لقد حصلت على " .. MoneyPerOnline .. "", 255, 255, 255)

 

كذا ؟

addEventHandler("mezstart", root,
	function( mz )
	local Money = mz
	local OnlinePlayer = getElementsByType( 'player' )
	local MoneyPerOnline = math.floor((Money*X)/#OnlinePlayer);
		playSoundFrontEnd( root, 45 )
		outputChatBox( " #00ffff[ Money System ] #ffff00 Admin [ #ffffff".. getPlayerName( source ) .." #ffff00] Set Budget [#00ff00 ".. mz .." $#ffff00 ] ", root, 0, 0, 0, true )
		setTimer( function()
		givePlayerMoney( root, MoneyPerOnline )
		outputChatBox( " #00ffff[ Money System ] #ffff00 Budget Gave All [ #00ff00".. mz .." $ #ffff00 ] !", root, 0, 0, 0, true )
		end, 5000, 1 )
	end
)

 

49 minutes ago, -Le[3]bA. said:

guiGetText
setTimer
getElementsByType
getPlayerCount
givePlayerMoney

 

كيف ض؟

Link to comment
addEvent("mezstart", true)
addEventHandler("mezstart", root,
	function(Amount)
		local Amount = tonumber(Amount)
		local OnlinePlayer = #getElementsByType("player")
		local Money = math.floor(Amount/OnlinePlayer)
		playSoundFrontEnd(root, 45)
		outputChatBox( " #00ffff[ Money System ] #ffff00 Admin [ #ffffff".. getPlayerName( source ) .." #ffff00] Set Budget [#00ff00 "..Amount.." $#ffff00 ] ", root, 0, 0, 0, true )
		if isTimer(BudgetTimer) then killTimer(BudgetTimer) end
		BudgetTimer = setTimer(function()
			for _,player in ipairs(getElementsByType("player")) do
				givePlayerMoney(player, Money)
				outputChatBox( " #00ffff[ Money System ] #ffff00 Budget Gave All [ #00ff00".. Money .." $ #ffff00 ] !", player, 0, 0, 0, true)
			end
		end, 5*60000, 0)
	end
)

للأخ اياد وين تعريف X 

و وش فايدتها اصلا

لصاحب الموضوع تفضل

Edited by #x1AhMeD,-09
Timer's looptime
Link to comment
13 hours ago, #x1AhMeD,-09 said:

addEvent("mezstart", true)
addEventHandler("mezstart", root,
	function(Amount)
		local Amount = tonumber(Amount)
		local OnlinePlayer = #getElementsByType("player")
		local Money = math.floor(Amount/OnlinePlayer)
		playSoundFrontEnd(root, 45)
		outputChatBox( " #00ffff[ Money System ] #ffff00 Admin [ #ffffff".. getPlayerName( source ) .." #ffff00] Set Budget [#00ff00 "..Amount.." $#ffff00 ] ", root, 0, 0, 0, true )
		if isTimer(BudgetTimer) then killTimer(BudgetTimer) end
		BudgetTimer = setTimer(function()
			for _,player in ipairs(getElementsByType("player")) do
				givePlayerMoney(player, Money)
				outputChatBox( " #00ffff[ Money System ] #ffff00 Budget Gave All [ #00ff00".. Money .." $ #ffff00 ] !", player, 0, 0, 0, true)
			end
		end, 5*60000, 0)
	end
)

للأخ اياد وين تعريف X 

و وش فايدتها اصلا

لصاحب الموضوع تفضل

يعطيك العافيه

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