Jump to content

طلب فنشنكات


Recommended Posts

local aTable_ = { 
  { aButton1_ , 23 },
  { aButton2_ , 31 }
--{ button name , weapon id }
} 

addEventHandler ( 'onClientGUIClick' , root ,
  function ( )
    for _ , v in ipairs ( aTable_ ) do
    end
    if ( source == v[1] ) then
      triggerServerEvent ( 'GiveWeapon' , localPlayer , v[2] )
    end
  end
)

كمل الترايقر

Link to comment
1 minute ago, #_iMr.[E]coo said:

local aTable_ = { 
  { aButton1_ , 23 },
  { aButton2_ , 31 }
--{ button name , weapon id }
} 

addEventHandler ( 'onClientGUIClick' , root ,
  function ( )
    for _ , v in ipairs ( aTable_ ) do
    end
    if ( source == v[1] ) then
      triggerServerEvent ( 'GiveWeapon' , localPlayer , v[2] )
    end
  end
)

كمل الترايقر

 

x

  • Like 1
Link to comment
17 minutes ago, #_iMr.[E]coo said:

local aTable_ = { 
  { aButton1_ , 23 },
  { aButton2_ , 31 }
--{ button name , weapon id }
} 

addEventHandler ( 'onClientGUIClick' , root ,
  function ( )
    for _ , v in ipairs ( aTable_ ) do
    end
    if ( source == v[1] ) then
      triggerServerEvent ( 'GiveWeapon' , localPlayer , v[2] )
    end
  end
)

كمل الترايقر

 

11 minutes ago, #_iMr.[E]coo said:

لا ! :(

يعني ما تزبط :(

:|

Edited by #BrosS
Link to comment

شكلها كذا

يمكن انت ما تنبهت وغلطت بمكان الإند

 
local aTable_ = { 
  { aButton1_ , 23 },
  { aButton2_ , 31 }
--{ button name , weapon id }
} 

addEventHandler ( 'onClientGUIClick' , root ,
  function ( )
    for _ , v in ipairs ( aTable_ ) do
    	if ( source == v[1] ) then
    	  triggerServerEvent ( 'GiveWeapon' , localPlayer , v[2] )
    	end
    end
  end
)

 

Link to comment
56 minutes ago, coNolel said:

شكلها كذا

يمكن انت ما تنبهت وغلطت بمكان الإند


 
local aTable_ = { 
  { aButton1_ , 23 },
  { aButton2_ , 31 }
--{ button name , weapon id }
} 

addEventHandler ( 'onClientGUIClick' , root ,
  function ( )
    for _ , v in ipairs ( aTable_ ) do
    	if ( source == v[1] ) then
    	  triggerServerEvent ( 'GiveWeapon' , localPlayer , v[2] )
    	end
    end
  end
)

 

you forgot stop the loop

حط كلمة 

break

بعد سطر التراقر

 

Link to comment

جرب

-- Client
local aTable_ = { 
	{ aButton1_ , 23 },
	{ aButton2_ , 31 }
	--{ button name , weapon id }
} 

addEventHandler ( "onClientGUIClick", resourceRoot,
	function ( )
		for _ , v in ipairs ( aTable_ ) do
			if source == v[1] then
				triggerServerEvent ( 'GiveWeapon' , localPlayer , v[2] )
				break
			end
		end
	end
)

-- Server
addEvent ( 'GiveWeapon', true )
addEventHandler ( 'GiveWeapon', root,
	function (ID)
		giveWeapon(source,ID,200)
	end
)

 

  • Like 1
Link to comment
  • 2 weeks later...

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