Jump to content

محد ناوي يساعدني ؟؟؟


Recommended Posts

ما يشتغل

 

--server

addEvent("weapon", true)
addEventHandler("weapon", root,
	function( action, ID, ammo )
		if ( action == "wpp" ) then
			if tonumber( getPlayerMoney ( source ) ) >= tonumber( mm ) then
				takePlayerMoney( source, tonumber ( mm ) )
				giveWeapon( source, ID, ammo, true )
			else
				outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 أنت لا تملك مـآل كـافي ", source, 0, 0, 0, true )
			end
		end
	end
)

 

local wep = { -- { Weapon / ID / Ammo / Money } --
	{"M4", "31", "1000", 11},
	{"Minigun", "38", "1000", 11},
}

function refreesh ()
	guiGridListClear( wpgrd )
	for i, v in ipairs ( wep ) do
	local rowwp = guiGridListAddRow( wpgrd )
	guiGridListSetItemText( wpgrd, rowwp, 1, tostring( v[1] ), false, false )
	guiGridListSetItemData( wpgrd, rowwp, 1,{ ID = v[2], ammo = v[3], mm = v[4] } )
end
end

addEventHandler("onClientGUIClick", wshroot, 
	function()
	local ss = guiGridListGetSelectedItem( wpgrd )
	local tt = guiGridListGetItemText( wpgrd, ss, 1 )
	local dd = guiGridListGetItemData( wpgrd, ss, 1 )
	local nn = guiGridListGetItemText( wpgrd, guiGridListGetSelectedItem ( wpgrd ), 1 )
		if ( source == GUIEditor.button[1] ) then
			if ( ss ~= -1 ) then
				triggerServerEvent ( "weapon" , localPlayer , localPlayer, "wpp", ss, dd, mm )
			else
				outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 الرجاء اختيار سلاح لشرآئه ", 0, 0, 0, true )
			end
		end
	end
)

 

Link to comment
32 minutes ago, A7MEDENO said:

ما يشتغل

 


--server

addEvent("weapon", true)
addEventHandler("weapon", root,
	function( action, ID, ammo )
		if ( action == "wpp" ) then
			if tonumber( getPlayerMoney ( source ) ) >= tonumber( mm ) then
				takePlayerMoney( source, tonumber ( mm ) )
				giveWeapon( source, ID, ammo, true )
			else
				outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 أنت لا تملك مـآل كـافي ", source, 0, 0, 0, true )
			end
		end
	end
)

 


local wep = { -- { Weapon / ID / Ammo / Money } --
	{"M4", "31", "1000", 11},
	{"Minigun", "38", "1000", 11},
}

function refreesh ()
	guiGridListClear( wpgrd )
	for i, v in ipairs ( wep ) do
	local rowwp = guiGridListAddRow( wpgrd )
	guiGridListSetItemText( wpgrd, rowwp, 1, tostring( v[1] ), false, false )
	guiGridListSetItemData( wpgrd, rowwp, 1,{ ID = v[2], ammo = v[3], mm = v[4] } )
end
end

addEventHandler("onClientGUIClick", wshroot, 
	function()
	local ss = guiGridListGetSelectedItem( wpgrd )
	local tt = guiGridListGetItemText( wpgrd, ss, 1 )
	local dd = guiGridListGetItemData( wpgrd, ss, 1 )
	local nn = guiGridListGetItemText( wpgrd, guiGridListGetSelectedItem ( wpgrd ), 1 )
		if ( source == GUIEditor.button[1] ) then
			if ( ss ~= -1 ) then
				triggerServerEvent ( "weapon" , localPlayer , localPlayer, "wpp", ss, dd, mm )
			else
				outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 الرجاء اختيار سلاح لشرآئه ", 0, 0, 0, true )
			end
		end
	end
)

 

اخوي لما تحط مشكله , اشرح وش المشكله بالضبط عشان نساعدك بها

Link to comment
local wep = { -- { Weapon / ID / Ammo / Money } --
	{"M4", "31", "1000", 11},
	{"Minigun", "38", "1000", 11},
}

function refreesh ()
	guiGridListClear( wpgrd )
	for i, v in ipairs ( wep ) do
	local rowwp = guiGridListAddRow( wpgrd )
	guiGridListSetItemText( wpgrd, rowwp, 1, tostring( v[1] ), false, false )
	guiGridListSetItemData( wpgrd, rowwp, 1,{ ID = v[2], ammo = v[3], mm = v[4] } )
end
end

addEventHandler("onClientGUIClick", root, function()
if ( source == GUIEditor.button[1] ) then
local ss = guiGridListGetSelectedItem( wpgrd )
if ( ss ~= -1 ) then
local tt = guiGridListGetItemText( wpgrd, ss, 1 )
local dd = guiGridListGetItemData( wpgrd, ss, 1 )
triggerServerEvent ( "weapon" , localPlayer , "wpp", dd )
else
outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 الرجاء اختيار سلاح لشرآئه ", 0, 0, 0, true )
end
end
end ) ;

--- Server

addEvent("weapon", true)
addEventHandler("weapon", root,
	function( action , data )
		if ( action == "wpp" ) then
			if tonumber( getPlayerMoney ( source ) ) >= tonumber( data['mm'] ) then
				takePlayerMoney( source, tonumber ( data['mm'] ) )
				giveWeapon( source, data['ID'], data['ammo'], true )
			else
				outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 أنت لا تملك مـآل كـافي ", source, 0, 0, 0, true )
			end
		end
	end
)

 

Edited by Default
Link to comment
4 hours ago, Default said:

local wep = { -- { Weapon / ID / Ammo / Money } --
	{"M4", "31", "1000", 11},
	{"Minigun", "38", "1000", 11},
}

function refreesh ()
	guiGridListClear( wpgrd )
	for i, v in ipairs ( wep ) do
	local rowwp = guiGridListAddRow( wpgrd )
	guiGridListSetItemText( wpgrd, rowwp, 1, tostring( v[1] ), false, false )
	guiGridListSetItemData( wpgrd, rowwp, 1,{ ID = v[2], ammo = v[3], mm = v[4] } )
end
end

addEventHandler("onClientGUIClick", root, function()
if ( source == GUIEditor.button[1] ) then
local ss = guiGridListGetSelectedItem( wpgrd )
if ( ss ~= -1 ) then
local tt = guiGridListGetItemText( wpgrd, ss, 1 )
local dd = guiGridListGetItemData( wpgrd, ss, 1 )
triggerServerEvent ( "weapon" , localPlayer , "wpp", dd )
else
outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 الرجاء اختيار سلاح لشرآئه ", 0, 0, 0, true )
end
end
end ) ;

--- Server

addEvent("weapon", true)
addEventHandler("weapon", root,
	function( action , data )
		if ( action == "wpp" ) then
			if tonumber( getPlayerMoney ( source ) ) >= tonumber( data['mm'] ) then
				takePlayerMoney( source, tonumber ( data['mm'] ) )
				giveWeapon( source, data['ID'], data['ammo'], true )
			else
				outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 أنت لا تملك مـآل كـافي ", source, 0, 0, 0, true )
			end
		end
	end
)

 

شكرا اشتغل

 

4 hours ago, Default said:

local wep = { -- { Weapon / ID / Ammo / Money } --
	{"M4", "31", "1000", 11},
	{"Minigun", "38", "1000", 11},
}

function refreesh ()
	guiGridListClear( wpgrd )
	for i, v in ipairs ( wep ) do
	local rowwp = guiGridListAddRow( wpgrd )
	guiGridListSetItemText( wpgrd, rowwp, 1, tostring( v[1] ), false, false )
	guiGridListSetItemData( wpgrd, rowwp, 1,{ ID = v[2], ammo = v[3], mm = v[4] } )
end
end

addEventHandler("onClientGUIClick", root, function()
if ( source == GUIEditor.button[1] ) then
local ss = guiGridListGetSelectedItem( wpgrd )
if ( ss ~= -1 ) then
local tt = guiGridListGetItemText( wpgrd, ss, 1 )
local dd = guiGridListGetItemData( wpgrd, ss, 1 )
triggerServerEvent ( "weapon" , localPlayer , "wpp", dd )
else
outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 الرجاء اختيار سلاح لشرآئه ", 0, 0, 0, true )
end
end
end ) ;

--- Server

addEvent("weapon", true)
addEventHandler("weapon", root,
	function( action , data )
		if ( action == "wpp" ) then
			if tonumber( getPlayerMoney ( source ) ) >= tonumber( data['mm'] ) then
				takePlayerMoney( source, tonumber ( data['mm'] ) )
				giveWeapon( source, data['ID'], data['ammo'], true )
			else
				outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 أنت لا تملك مـآل كـافي ", source, 0, 0, 0, true )
			end
		end
	end
)

 

ممكن طلب اخر

if ( getPedWeapon( source ) == data['ID'] ) then
	outputChatBox( " لديك هذا السلاح بالفعل ", source, 0, 0, 0, true )
	return end

ما اشتغلت

Link to comment
function getPedWeapons(ped)
	local playerWeapons = {}
	if ped and isElement(ped) and getElementType(ped) == "ped" or getElementType(ped) == "player" then
		for i=2,9 do
			local wep = getPedWeapon(ped,i)
			if wep and wep ~= 0 then
				table.insert(playerWeapons,wep)
			end
		end
	else
		return false
	end
	return playerWeapons
end

سوي لوب قبل لايشتري اللاعب السلآح وتحقق ان الايدي ماهو موجود بالجدول 

حآول وبنسآعدك .

  • Like 1
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...