Jump to content

مساعدة


Outlaw

Recommended Posts

شباب بدي أخلي البيد لما يكون عليه داتا nodm

يقدر يغير الأسلحة بس الموجودة بالتيبل

allowedwps = { [1] = true,
[2] = true,
[3] = true,
[5] = true,
[6] = true,
[7] = true,
[8] = true,
}
function disablenodm (p)
if getPedWeapon(localPlayer, #allowedwps) then
return end
if getElementData(localPlayer,"nodm",true)  then
toggleControl("next_weapon",false)
toggleControl("previous_weapon",false)
else
toggleControl("next_weapon",true)
toggleControl("previous_weapon",true)
end
end
addEventHandler("onClientRender",root,disablenodm)
function changeNodmCheck(bool)
	guiCheckBoxSetSelected(getControl(wndMain, 'No deathmatch'), bool)
end

 

Link to comment
43 minutes ago, Outlaw said:
  1.  
  2.  
  3. شفت الجول ذا؟
  4. allowedwps = { [1] = true,
  5. [2] = true,
  6. [3] = true,
  7. [5] = true,
  8. [6] = true,
  9. [7] = true,
  10. [8] = true,
  11. }
  1. allowedwps = {
  2. [1] = true,
  3. [2] = true,
  4. [3] = true,
  5. [5] = true,
  6. [6] = true,
  7. [7] = true,
  8. [8] = true
  9. }
  10. -- خليه مثل هيك
Link to comment
1 hour ago, Bechi_)!! said:
  1. allowedwps = {
  2. [1] = true,
  3. [2] = true,
  4. [3] = true,
  5. [5] = true,
  6. [6] = true,
  7. [7] = true,
  8. [8] = true
  9. }
  10. -- خليه مثل هيك

مالها دخل, ولصاحب الموضوع اكوادك ملخبطة وغير واضحة وفكرتك غير واضحة ايضاً

Link to comment
16 hours ago, N3xT said:

مالها دخل, ولصاحب الموضوع اكوادك ملخبطة وغير واضحة وفكرتك غير واضحة ايضاً

allowedwps = { [1] = true,
[2] = true,
[3] = true,
[5] = true,
[6] = true,
[7] = true,
[8] = true,
}
function disablenodm (p)
if getPedWeapon(localPlayer, #allowedwps) then
return end
if getElementData(localPlayer,"nodm",true)  then
toggleControl("next_weapon",false)
toggleControl("previous_weapon",false)
else
toggleControl("next_weapon",true)
toggleControl("previous_weapon",true)
end
end

بدي اخلي اللاعب يستطيع أن يغير السلاح عندما يكون معه سلاح من الأسلحة الموجودة بالجدول

Link to comment
allowedwps = { 
	[1] = true,
	[2] = true,
	[3] = true,
	[5] = true,
	[6] = true,
	[7] = true,
	[8] = true,
}

addEventHandler( "onClientPlayerWeaponSwitch", root, 
	function(previous_weapon, next_weapon)
		if getElementData(localPlayer, "nodm") == true then
			local current_weapon = getPedWeapon(localPlayer, next_weapon)
			for i, weapon in ipairs(allowedwps) do
				if current_weapon ~= weapon then
					cancelEvent()
					break
				end
			end
		end
	end
)

 

Edited by PaiN^
Link to comment
6 hours ago, Abdul KariM said:

@PaiN^  وعندك القيمة باللوب ترجع ترو getPedWeapon لو تلاحظ الوظيفة ترجع رقم

باسماء الاسلحة true أنا افترضت ان هذا الجدول مجرد مثال و انه راح يستبدل

 

Link to comment
On 09/09/2019 at 01:11, PaiN^ said:

allowedwps = { 
	[1] = true,
	[2] = true,
	[3] = true,
	[5] = true,
	[6] = true,
	[7] = true,
	[8] = true,
}

addEventHandler( "onClientPlayerWeaponSwitch", root, 
	function(previous_weapon, next_weapon)
		if getElementData(localPlayer, "nodm") == true then
			local current_weapon = getPedWeapon(localPlayer, next_weapon)
			for i, weapon in ipairs(allowedwps) do
				if current_weapon ~= weapon then
					cancelEvent()
					break
				end
			end
		end
	end
)

 

كودك مو شغال و بدون اخطاء ديبق

Link to comment

اتوقع هذا الي تبيه, جرب :

allowedwps = { 
	[1] = true,
	[2] = true,
	[3] = true,
	[5] = true,
	[6] = true,
	[7] = true,
	[8] = true,
}

addEventHandler("onClientPlayerWeaponSwitch", root, function(previous_weapon, next_weapon)
    if getElementData(localPlayer, "nodm") == true then
        if not allowedwps[next_weapon] then
            cancelEvent()
            local current_weapon = (next_weapon+1)%13
            while current_weapon ~= next_weapon do
                if allowedwps[current_weapon] then
                    setPedWeaponSlot(localPlayer, current_weapon)
                    break
                end
                current_weapon = (current_weapon+1)%13
            end
        end
    end
end)

 

Link to comment
On 10/09/2019 at 07:46, Outlaw said:

كودك مو شغال و بدون اخطاء ديبق

ممكن انك ما عدلت التيبل ؟

جرب دا:

allowedwps = { 
	[0] = true,
	[1] = true,
	[2] = true,
	[3] = true,
	[5] = true,
	[6] = true,
	[7] = true,
	[8] = true,
}

addEventHandler( "onClientPlayerWeaponSwitch", root, 
	function(previous_weapon, next_weapon)
		if getElementData(localPlayer, "nodm") == true then
			local current_weapon = getPedWeapon(localPlayer, next_weapon)
			for i, weapon in ipairs(allowedwps) do
				if current_weapon ~= i then
					cancelEvent()
					break
				end
			end
		end
	end
)

 

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