Jump to content

Mode Supports || تصحيح اكواد


D7mas

Recommended Posts

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

كيف حال الشباب ان شاء الله طيبين 

اليوم انا طالب شي منكم 

شوفو في جدول تختار منو خاصية للوحة المساعدة اما تختار 

  1. supports
  2. offline
  3. help

طبعاً في جريد ليست للاعبين الي بسيرفر 

تختار لاعب وتدوس 

زر تغير تجيه الحالة الي اخترتها من فوق

بس الكود في خطأ والدي بق ما يطلع شي 

Help Me Please

addEventHandler("onClientGUIClick", resourceRoot,
function()

	if source == Change and guiComboBoxGetSelected(StatBox) ~= -1 then
		local Stat = guiComboBoxGetItemText(StatBox, guiComboBoxGetSelected(StatBox))
		local playerName = guiGridListGetItemText(PlayersGridList, guiGridListGetSelectedItem(PlayersGridList), 1)
		triggerServerEvent("SupportSystem:adminSetStat", localPlayer, getPlayerFromName(playerName), Stat)
		refreshSupportList()
	end
end
)

function refreshSupportList()
	guiGridListClear(SupportList)
	for _,players in ipairs(getElementsByType("player")) do
		local row = guiGridListAddRow(SupportList)
		if getElementData(players, "stat") == "support" then
			guiGridListSetItemText(SupportList, row, 1, getPlayerName(players), false, false)
			guiGridListSetItemColor(SupportList, row, 1, 0, 255, 0)
		end
	end
end


--- # server Code 

addEvent("SupportSystem:adminSetStat", true)
addEventHandler("SupportSystem:adminSetStat", root, 
function(player, Stat)
	setElementData(player, "stat", Stat)
	exports["guimessages"]:outputServer(player, "#FFFFFF[ #e1e1e1Support Chat #FFFFFF] : #00ff00"..getPlayerName(source).." has changed your support states to #ff0000"..Stat)
	exports["guimessages"]:outputServer(player, "#FFFFFF[ #e1e1e1Support Chat #FFFFFF] : #00ff00"..getPlayerName(player).." states changed to #ff0000"..Stat)
	sendMessageToLogs(getPlayerName(source).." changed "..getPlayerName(player).." support states to "..Stat)
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...