Jump to content

تصحيح كود !


Recommended Posts

سلام عليكم ابي تصحيح لدي ابي لما اختار لاعب من قريد ليست واضغط زر يعطي سلاب للي اختارته

--client
     addEventHandler("onClientGUIClick",root,
      function ()
        if source == aAdminButtonTO then
		                local playerSlaper = guiGridListGetItemText ( aTab1.PlayerList, guiGridListGetSelectedItem ( aTab1.PlayerList ), 1 )
			triggerServerEvent("Admin:SlapPlayerNow", localPlayer, playerSlaper)
          end
        end 
    )

-- #server

addEvent("Admin:SlapPlayerNow", true)
addEventHandler("Admin:SlapPlayerNow", root, 
function(playerSlaper)
		killPed ( playerSlaper, playerSlaper )
end)

 

Link to comment
--client
     addEventHandler("onClientGUIClick",root,
      function ()
        if source == aAdminButtonTO then
		                local playerSlaper = guiGridListGetItemText ( aTab1.PlayerList, guiGridListGetSelectedItem ( aTab1.PlayerList ), 1 )
			triggerServerEvent("Admin:SlapPlayerNow", localPlayer, playerSlaper)
          end
        end 
    )

-- #server

addEvent("Admin:SlapPlayerNow", true)
addEventHandler("Admin:SlapPlayerNow", root, 
function(playerSlaper)
    local plr = getPlayerFromName(playerSlaper)
		killPed ( plr, plr )
end)

 

Link to comment

كود هيمو صح | بس انا ضفت له بعض التحققات عشان ما يطلع لك دي بق مثلا لاعب خرج و انت جيت تصكه بيطلع لك انه قيمه اللاعب نيل

او غير اسمه الخ يعني ..

--client
addEventHandler("onClientGUIClick", root,
	function ()
        if source == aAdminButtonTO then
			local selectedRow = guiGridListGetSelectedItem(aTab1.PlayerList)
			if selectedRow and selectedRow ~= -1 then
				local selectedPlayerName = guiGridListGetItemText(aTab1.PlayerList, selectedRow, 1)
				triggerServerEvent("Admin:SlapPlayerNow", localPlayer, selectedPlayerName)
			end
        end
	end
)
-- #server
addEvent("Admin:SlapPlayerNow", true)
addEventHandler("Admin:SlapPlayerNow", root, 
	function(selectedPlayerName)
		local player = getPlayerFromName(selectedPlayerName)
		if player and isElement(player) then
			if not isPedDead(player) then
				killPed(player, player)
			end
		end
	end
)

 

Link to comment
10 minutes ago, #x1AhMeD,-09 said:

كود هيمو صح | بس انا ضفت له بعض التحققات عشان ما يطلع لك دي بق مثلا لاعب خرج و انت جيت تصكه بيطلع لك انه قيمه اللاعب نيل

او غير اسمه الخ يعني ..


--client
addEventHandler("onClientGUIClick", root,
	function ()
        if source == aAdminButtonTO then
			local selectedRow = guiGridListGetSelectedItem(aTab1.PlayerList)
			if selectedRow and selectedRow ~= -1 then
				local selectedPlayerName = guiGridListGetItemText(aTab1.PlayerList, selectedRow, 1)
				triggerServerEvent("Admin:SlapPlayerNow", localPlayer, selectedPlayerName)
			end
        end
	end
)
-- #server
addEvent("Admin:SlapPlayerNow", true)
addEventHandler("Admin:SlapPlayerNow", root, 
	function(selectedPlayerName)
		local player = getPlayerFromName(selectedPlayerName)
		if player and isElement(player) then
			if not isPedDead(player) then
				killPed(player, player)
			end
		end
	end
)

 

killPed(player, client);

كودك مو خطأ بس يفضل تخليه كذا لمعرفة القاتل

Edited by #,+( _xiRoc[K]; >
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...