Jump to content

طلب مساعدة بكود


SAM!!

Recommended Posts

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

ابي اذا  ضغطت زر يسوي تحقق مثلا اني معي 1000 فلوس 

وياخد مني 1000 فلوس 

ويضيفني في الاسل مثلا كونسل

لمدة معينة مثلا ساعة

وبعدين يسحبها مني

ولو انا في الجروب اصلا من قبل

يقولي عذرا انت كونسل

وشكرآآآ

محاولتي

ككلنت

addEventHandler('onClientGUIClick', root, 
	
	function ( ) 
		if source == btn.buyvip then
			guiSetVisible( wnd1, false )
			showCursor( false )
			triggerServerEvent ( "buyvip", localPlayer )
		end
	end
)

سيرفر

addEvent ( "buyvip", true )
addEventHandler ( "buyvip", root,
function (  )
    local Le3bA = getPlayerMoney ( source )
                   if Le3bA > 250000 then
                        takePlayerMoney ( source, 250000 )
        local name = getPlayerName(source)
if accountName then 
		aclGroupAddObject (aclGetGroup("Admin"), "user."..accountName) 
		outputChatBox ("Account '"..accountName.."' succesfully added to the admin group", playerSource)
                            else
        outputChatBox("You don't have $250000 to buy Super Jump", source, 255, 0, 0, true)
                    end
    end
      )

 

Link to post
addEvent("buyvip", true)
addEventHandler("buyvip", root,
function()
	local Le3bA = getPlayerMoney(source)
	if Le3bA >= 250000 then
		local account = getPlayerAccount(source)
		if account and not isGuestAccount(account) then
			local accountName = getAccountName(account)
			if not isObjectInACLGroup("user."..accountName, aclGetGroup("Admin")) then
				takePlayerMoney(source, 250000)
				aclGroupAddObject(aclGetGroup("Admin"), "user."..accountName) 
				outputChatBox "Account '"..accountName.."' succesfully added to the admin group", source)
			else
				outputChatBox("You're already in admin group.", source, 255, 0, 0, true)
			end
		else
			outputChatBox("You're not logged in.", source, 255, 0, 0, true)
		end
	else
		outputChatBox("You don't have $250000 to buy VIP", source, 255, 0, 0, true)
	end
end)

 

Edited by TAPL
  • Like 1
  • Sad 1
Link to post
7 minutes ago, SAM!! said:

TAPL

للأسف الكود مو شغال :)

 

الديبق

يقولي اني سويت ترايقر لbuyvip

للسيرفر ومافي ايفنت بالاسم ذا

لا جيت تكلمني سوي @Rakan#

عشان يطلع لي تنبيه

+ غير اسم الايفنت الى Ranks:Buy1

او اي شي وجرب اشتري

واذا مانفع الخطا منك اطرح اكوادك اقين

Link to post

Rakan#

 @Rakan#

لم تظبط معنا

سيرفر

 

addEvent("Ranks:Buy1", true)
addEventHandler("Ranks:Buy1", root,
function()
	local Le3bA = getPlayerMoney(source)
	if Le3bA >= 250000 then
		local account = getPlayerAccount(source)
		if account and not isGuestAccount(account) then
			local accountName = getAccountName(account)
			if not isObjectInACLGroup("user."..accountName, aclGetGroup("VIP")) then
				takePlayerMoney(source, 250000)
				aclGroupAddObject(aclGetGroup("VIP"), "user."..accountName) 
				outputChatBox "Account '"..accountName.."' succesfully added to the VIP group", source)
outputChatBox("You're in VIP group Now.", source, 255, 0, 0, true)
			else
				outputChatBox("You're already in VIP group.", source, 255, 0, 0, true)
			end
		else
			outputChatBox("You're not logged in.", source, 255, 0, 0, true)
		end
	else
		outputChatBox("You don't have $250000 to buy VIP", source, 255, 0, 0, true)
	end
end)
--------------------------

 

كلنت

addEventHandler('onClientGUIClick', root, 
	
	function ( ) 
		if source == btn.buyvip then
			guiSetVisible( wnd1, false )
			showCursor( false )
			triggerServerEvent ( "Ranks:Buy1", localPlayer )
		end
	end
)

 

Link to post

سيرفر

addEvent("Ranks:Buy1", true)
addEventHandler("Ranks:Buy1", root,
function()
	local Le3bA = getPlayerMoney(source)
	if Le3bA >= 250000 then
		local account = getPlayerAccount(source)
		if account and not isGuestAccount(account) then
			local accountName = getAccountName(account)
			if not isObjectInACLGroup("user."..accountName, aclGetGroup("VIP")) then
				takePlayerMoney(source, 250000)
				aclGroupAddObject(aclGetGroup("VIP"), "user."..accountName) 
				outputChatBox( "Account "..accountName.." succesfully added to the VIP group", source)
				outputChatBox("You're in VIP group Now.", source, 255, 0, 0, true)
			else
				outputChatBox("You're already in VIP group.", source, 255, 0, 0, true)
			end
		else
			outputChatBox("You're not logged in.", source, 255, 0, 0, true)
		end
	else
		outputChatBox("You don't have $250000 to buy VIP", source, 255, 0, 0, true)
	end
end
)

 

  • Thanks 1
Link to post
52 minutes ago, +Source|> said:

سيرفر


addEvent("Ranks:Buy1", true)
addEventHandler("Ranks:Buy1", root,
function()
	local Le3bA = getPlayerMoney(source)
	if Le3bA >= 250000 then
		local account = getPlayerAccount(source)
		if account and not isGuestAccount(account) then
			local accountName = getAccountName(account)
			if not isObjectInACLGroup("user."..accountName, aclGetGroup("VIP")) then
				takePlayerMoney(source, 250000)
				aclGroupAddObject(aclGetGroup("VIP"), "user."..accountName) 
				outputChatBox( "Account "..accountName.." succesfully added to the VIP group", source)
				outputChatBox("You're in VIP group Now.", source, 255, 0, 0, true)
			else
				outputChatBox("You're already in VIP group.", source, 255, 0, 0, true)
			end
		else
			outputChatBox("You're not logged in.", source, 255, 0, 0, true)
		end
	else
		outputChatBox("You don't have $250000 to buy VIP", source, 255, 0, 0, true)
	end
end
)

 

طيب وين التايمر هوة قال بدو لما يعطيعه الزر رتبة يبيه لمدة معينة وينسحب منه الرتبة + الكود لازمني لي كمان وشكرا ذذ

  • Like 1
  • Haha 1
Link to post
11 hours ago, SAM!! said:

MR_Mahmoud

يب صحيح تصدق نسيت ض

addEvent("Ranks:Buy1", true)
addEventHandler("Ranks:Buy1", root,
function()
	local Le3bA = getPlayerMoney(source)
	if Le3bA >= 250000 then
		local account = getPlayerAccount(source)
		if account and not isGuestAccount(account) then
			local accountName = getAccountName(account)
			if not isObjectInACLGroup("user."..accountName, aclGetGroup("VIP")) then
				takePlayerMoney(source, 250000)
				aclGroupAddObject(aclGetGroup("VIP"), "user."..accountName) 
				outputChatBox( "Account "..accountName.." succesfully added to the VIP group", source)
				outputChatBox("You're in VIP group Now.", source, 255, 0, 0, true)
          setTimer( function()
              aclGroupRemoveObject(aclGetGroup("VIP"),"user."..accountName)
end, 60000*5,1)
			else
				outputChatBox("You're already in VIP group.", source, 255, 0, 0, true)
			end
		else
			outputChatBox("You're not logged in.", source, 255, 0, 0, true)
		end
	else
		outputChatBox("You don't have $250000 to buy VIP", source, 255, 0, 0, true)
	end
end
)

يسحب رتبه بعد ٥ دقايق

  • Thanks 2
Link to post
9 hours ago, +Source|> said:

addEvent("Ranks:Buy1", true)
addEventHandler("Ranks:Buy1", root,
function()
	local Le3bA = getPlayerMoney(source)
	if Le3bA >= 250000 then
		local account = getPlayerAccount(source)
		if account and not isGuestAccount(account) then
			local accountName = getAccountName(account)
			if not isObjectInACLGroup("user."..accountName, aclGetGroup("VIP")) then
				takePlayerMoney(source, 250000)
				aclGroupAddObject(aclGetGroup("VIP"), "user."..accountName) 
				outputChatBox( "Account "..accountName.." succesfully added to the VIP group", source)
				outputChatBox("You're in VIP group Now.", source, 255, 0, 0, true)
          setTimer( function()
              aclGroupRemoveObject(aclGetGroup("VIP"),"user."..accountName)
end, 60000*5,1)
			else
				outputChatBox("You're already in VIP group.", source, 255, 0, 0, true)
			end
		else
			outputChatBox("You're not logged in.", source, 255, 0, 0, true)
		end
	else
		outputChatBox("You don't have $250000 to buy VIP", source, 255, 0, 0, true)
	end
end
)

يسحب رتبه بعد ٥ دقايق

غلط استعمالك للتايمر لازم تعرف فيه accountName

setTimer( function(accountName)

end,60000*5,1,accountName)

بتوفيق

Link to post

Rakan#

لا لا مابية لو طفي المود يختفي

addEvent("Ranks:Buy1", true)
addEventHandler("Ranks:Buy1", root,
function()
	local Le3bA = getPlayerMoney(source)
	if Le3bA >= 250000 then
		local account = getPlayerAccount(source)
		if account and not isGuestAccount(account) then
			local accountName = getAccountName(account)
			if not isObjectInACLGroup("user."..accountName, aclGetGroup("VIP")) then
				takePlayerMoney(source, 250000)
				aclGroupAddObject(aclGetGroup("VIP"), "user."..accountName) 
				outputChatBox( "Account "..accountName.." succesfully added to the VIP group", source)
				outputChatBox("You're in VIP group Now.", source, 255, 0, 0, true)
          setTimer( function()
              aclGroupRemoveObject(aclGetGroup("VIP"),"user."..accountName)
setTimer( function(accountName)

end,60000*5,1,accountName)
			else
				outputChatBox("You're already in VIP group.", source, 255, 0, 0, true)
			end
		else
			outputChatBox("You're not logged in.", source, 255, 0, 0, true)
		end
	else
		outputChatBox("You don't have $250000 to buy VIP", source, 255, 0, 0, true)
	end
end
)

صح هيك قصدك؟

Link to post
addEvent("Ranks:Buy1", true)
addEventHandler("Ranks:Buy1", root,
function()
	local Le3bA = getPlayerMoney(source)
	if Le3bA >= 250000 then
		local account = getPlayerAccount(source)
		if account and not isGuestAccount(account) then
			local accountName = getAccountName(account)
			if not isObjectInACLGroup("user."..accountName, aclGetGroup("VIP")) then
				takePlayerMoney(source, 250000)
				aclGroupAddObject(aclGetGroup("VIP"), "user."..accountName) 
				outputChatBox( "Account "..accountName.." succesfully added to the VIP group", source)
				outputChatBox("You're in VIP group Now.", source, 255, 0, 0, true)
setTimer( function(accountName)
              aclGroupRemoveObject(aclGetGroup("VIP"),"user."..accountName)
end,60000*5,1,accountName)
			else
				outputChatBox("You're already in VIP group.", source, 255, 0, 0, true)
			end
		else
			outputChatBox("You're not logged in.", source, 255, 0, 0, true)
		end
	else
		outputChatBox("You don't have $250000 to buy VIP", source, 255, 0, 0, true)
	end
end
)

 

@Rakan#

Link to post
On 7/2/2018 at 17:39, SAM!! said:

addEvent("Ranks:Buy1", true)
addEventHandler("Ranks:Buy1", root,
function()
	local Le3bA = getPlayerMoney(source)
	if Le3bA >= 250000 then
		local account = getPlayerAccount(source)
		if account and not isGuestAccount(account) then
			local accountName = getAccountName(account)
			if not isObjectInACLGroup("user."..accountName, aclGetGroup("VIP")) then
				takePlayerMoney(source, 250000)
				aclGroupAddObject(aclGetGroup("VIP"), "user."..accountName) 
				outputChatBox( "Account "..accountName.." succesfully added to the VIP group", source)
				outputChatBox("You're in VIP group Now.", source, 255, 0, 0, true)
setTimer( function(accountName)
              aclGroupRemoveObject(aclGetGroup("VIP"),"user."..accountName)
end,60000*5,1) ----- 
 			else
				outputChatBox("You're already in VIP group.", source, 255, 0, 0, true)
			end
		else
			outputChatBox("You're not logged in.", source, 255, 0, 0, true)
		end
	else
		outputChatBox("You don't have $250000 to buy VIP", source, 255, 0, 0, true)
	end
end
)

 

في السطر ال16 احسها غلط؟ accountName مدري لو انا غلط او لا بس 

Link to post

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