Jump to content

قيمتها ما تتغير


Recommended Posts

39 minutes ago, MR.StoRm said:

ورني الكود كامل 

local money = math.random( 1000, 3000 )

stat = nil
function A7MEDENO()
	local math = math.random( 1, 10 )
	playSoundFrontEnd( root, 45 )
	outputChatBox("#3B9C9C # Write #00ff00[ " .. que[math] .. "#00ff00 ] #3B9C9C To Get Some Money #3B9C9C [ #00ff00".. money .." $ #3B9C9C]  ! ",root,255,255,0,true)
	stat = ans[math]
end
setTimer( A7MEDENO, 60000, 0 )

 

Link to comment

بما ان القيمه في متغير ثابت , مستحيل تتغير كل مره

الا تغيرها من داخل التايمر , لكن بهذي الحاله كودك يصير كذا:

stat = nil
function A7MEDENO()
    local money = math.random( 1000, 3000 )
	local math = math.random( 1, 10 )
	playSoundFrontEnd( root, 45 )
	outputChatBox("#3B9C9C # Write #00ff00[ " .. que[math] .. "#00ff00 ] #3B9C9C To Get Some Money #3B9C9C [ #00ff00".. money .." $ #3B9C9C]  ! ",root,255,255,0,true)
	stat = ans[math]
end
setTimer( A7MEDENO, 60000, 0 )

 

 

Link to comment
2 minutes ago, A7MEDENO said:

local money = math.random( 1000, 3000 )

stat = nil
function A7MEDENO()
	local math = math.random( 1, 10 )
	playSoundFrontEnd( root, 45 )
	outputChatBox("#3B9C9C # Write #00ff00[ " .. que[math] .. "#00ff00 ] #3B9C9C To Get Some Money #3B9C9C [ #00ff00".. money .." $ #3B9C9C]  ! ",root,255,255,0,true)
	stat = ans[math]
end
setTimer( A7MEDENO, 60000, 0 )

 

وين givePlayerMoney ? 

Link to comment
Just now, MR.StoRm said:

وين givePlayerMoney ? 

في الكود حق الجواب

addEventHandler("onPlayerChat",root,
	function (msg,type)
		if ( type == 0 and msg == stat ) then
			outputChatBox( "#ff0000 [ ".. getPlayerName(source) .."#ff0000 ] #2B60DE Won [ #00ff00 ".. mm .." $ #2B60DE ] ! ",root,0,255,0,true)
			givePlayerMoney(source,money)
			playSoundFrontEnd( root, 30 )
			stat = nil
		end
	end
)

 

Edited by A7MEDENO
Link to comment
1 minute ago, A7MEDENO said:

في الكود حق الجواب


addEventHandler("onPlayerChat",root,
	function (msg,type)
		if ( type == 0 and msg == stat ) then
			outputChatBox( "#ff0000 [ ".. getPlayerName(source) .."#ff0000 ] #2B60DE Won [ #00ff00 ".. mm .." $ #2B60DE ] ! ",root,0,255,0,true)
			givePlayerMoney(source,mm)
			playSoundFrontEnd( root, 30 )
			stat = nil
		end
	end
)

 

mm اجل ؟ 
مو معرفة 

Link to comment
Just now, MR.StoRm said:

عطيني الاكواد كاملة كلها وبعدله لك 

money = math.random( 1000, 3000 )

que = {
	"سبحان الله" ,
	"الحمد لله",
	"الله أكبر",
	"لا اله الا الله",
	"أستغفر الله",
	"الحمد لله على كل حال",
	"لا اله الا هو الحي القيوم",
	"استغفر الله واتوب اليه",
}

ans = {
	"سبحان الله" ,
	"الحمد لله",
	"الله أكبر",
	"لا اله الا الله",
	"أستغفر الله",
	"الحمد لله على كل حال",
	"لا اله الا هو الحي القيوم",
	"استغفر الله واتوب اليه",
}
stat = nil
function A7MEDENO()
	local math = math.random(1,6)
	playSoundFrontEnd( root, 45 )
	outputChatBox("#2B60DE # Write #00ff00[ " .. que[math] .. "#00ff00 ] #2B60DE To Get Some Money #2B60DE [ #00ff00".. money .." $ #2B60DE]  ! ",root,255,255,0,true)
	stat = ans[math]
end
setTimer(A7MEDENO,60000,0) -- مدة بين السؤال والاخر

addEventHandler("onPlayerChat",root,
	function (msg,type)
		if ( type == 0 and msg == stat ) then
			outputChatBox( "#ff0000 [ ".. getPlayerName(source) .."#ff0000 ] #2B60DE Won [ #00ff00 ".. money .." $ #2B60DE ] ! ",root,0,255,0,true)
			givePlayerMoney( source, money )
			playSoundFrontEnd( root, 30 )
			stat = nil
		end
	end
)

 

Link to comment
function aQus()
que = {
	"سبحان الله" ,
	"الحمد لله",
	"الله أكبر",
	"لا اله الا الله",
	"أستغفر الله",
	"الحمد لله على كل حال",
	"لا اله الا هو الحي القيوم",
	"استغفر الله واتوب اليه",
}

ans = {
	"سبحان الله" ,
	"الحمد لله",
	"الله أكبر",
	"لا اله الا الله",
	"أستغفر الله",
	"الحمد لله على كل حال",
	"لا اله الا هو الحي القيوم",
	"استغفر الله واتوب اليه",
}
	math = math.random(1,6)
	money = math.random( 1000, 3000 )
	playSoundFrontEnd( root, 45 )
	outputChatBox("#2B60DE # Write #00ff00[ " .. que[math] .. "#00ff00 ] #2B60DE To Get Some Money #2B60DE [ #00ff00".. money .." $ #2B60DE]  ! ",root,255,255,0,true)
	stat = ans[math]
end
setTimer(aQus,60000,0)


    function aAnswerd(msg,mtype)
		if ( stat ) then
		    if ( msg == stat ) then
			outputChatBox( "#ff0000 [ ".. getPlayerName(source) .."#ff0000 ] #2B60DE Won [ #00ff00 ".. money .." $ #2B60DE ] ! ",root,0,255,0,true)
			givePlayerMoney( source, money )
			playSoundFrontEnd( root, 30 )
			stat = nil
			end
		end
    end
addEventHandler ( 'onPlayerChat' , getRootElement() , aAnswerd )

اسف عالتأخير ,
النت علق 

Link to comment
48 minutes ago, MR.StoRm said:

function aQus()
que = {
	"سبحان الله" ,
	"الحمد لله",
	"الله أكبر",
	"لا اله الا الله",
	"أستغفر الله",
	"الحمد لله على كل حال",
	"لا اله الا هو الحي القيوم",
	"استغفر الله واتوب اليه",
}

ans = {
	"سبحان الله" ,
	"الحمد لله",
	"الله أكبر",
	"لا اله الا الله",
	"أستغفر الله",
	"الحمد لله على كل حال",
	"لا اله الا هو الحي القيوم",
	"استغفر الله واتوب اليه",
}
	math = math.random(1,6)
	money = math.random( 1000, 3000 )
	playSoundFrontEnd( root, 45 )
	outputChatBox("#2B60DE # Write #00ff00[ " .. que[math] .. "#00ff00 ] #2B60DE To Get Some Money #2B60DE [ #00ff00".. money .." $ #2B60DE]  ! ",root,255,255,0,true)
	stat = ans[math]
end
setTimer(aQus,60000,0)


    function aAnswerd(msg,mtype)
		if ( stat ) then
		    if ( msg == stat ) then
			outputChatBox( "#ff0000 [ ".. getPlayerName(source) .."#ff0000 ] #2B60DE Won [ #00ff00 ".. money .." $ #2B60DE ] ! ",root,0,255,0,true)
			givePlayerMoney( source, money )
			playSoundFrontEnd( root, 30 )
			stat = nil
			end
		end
    end
addEventHandler ( 'onPlayerChat' , getRootElement() , aAnswerd )

اسف عالتأخير ,
النت علق 

بجربه

#Edit:

شكرا لكم

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