Jump to content

برمجة جريد ليست داخل شات سبورت


Recommended Posts

Posted (edited)

        local unmuteTimer = ( (tonumber(guiComboBoxGetItemText(GUIEditor.combobox[2],sel_c)) * 60) * 1000) 

وش به اغلاط؟

 

Edited by KonaaaN200
Link to post
GUIEditor.window[1] = guiCreateWindow(365, 108, 571, 518, "SupportChat", false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetVisible(GUIEditor.window[1], false)

        GUIEditor.gridlist[1] = guiCreateGridList(9, 20, 553, 416, false, GUIEditor.window[1])
        guiGridListAddColumn(GUIEditor.gridlist[1], "الرسالة", 0.9)
        GUIEditor.edit[1] = guiCreateEdit(9, 438, 462, 21, "", false, GUIEditor.window[1])
        GUIEditor.button[1] = guiCreateButton(471, 438, 91, 21, "إرسال", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[3] = guiCreateButton(471, 490, 91, 19, "إغلاق", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFAAAAAA")
        GUIEditor.checkbox[2] = guiCreateCheckBox(11, 462, 134, 22, "أنا مساعد", true, false, GUIEditor.window[1])--149, 462, 80, 22,
        GUIEditor.label[1] = guiCreateLabel(237, 493, 94, 15, "By: KonaaaN200", false, GUIEditor.window[1])
        guiLabelSetColor(GUIEditor.label[1], 231, 233, 21)
        GUIEditor.button[4] = guiCreateButton(11, 490, 91, 18, "إسكات", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFFD0000")
        GUIEditor.button[5] = guiCreateButton(107, 490, 91, 18, "فك الإسكات", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FF4EFE00")
        --GUIEditor.checkbox[3] = guiCreateCheckBox(229, 462, 80, 22, "غير مساعد", false, false, GUIEditor.window[1])    


        GUIEditor.window[2] = guiCreateWindow(555, 187, 200, 302, "لوحة الميوت", false)
        guiWindowSetSizable(GUIEditor.window[2], false)
        guiSetVisible(GUIEditor.window[2], false)

        GUIEditor.combobox[1] = guiCreateComboBox(9, 22, 69, 217, "240", false, GUIEditor.window[2])
        guiComboBoxAddItem(GUIEditor.combobox[1], "1200")
        guiComboBoxAddItem(GUIEditor.combobox[1], "1200")
        guiComboBoxAddItem(GUIEditor.combobox[1], "600")
        guiComboBoxAddItem(GUIEditor.combobox[1], "600")
        guiComboBoxAddItem(GUIEditor.combobox[1], "240")
        guiComboBoxAddItem(GUIEditor.combobox[1], "240")
        guiComboBoxAddItem(GUIEditor.combobox[1], "120")
        guiComboBoxAddItem(GUIEditor.combobox[1], "120")
        guiComboBoxAddItem(GUIEditor.combobox[1], "60")
        guiComboBoxAddItem(GUIEditor.combobox[1], "30")
        guiComboBoxAddItem(GUIEditor.combobox[1], "30")
        guiComboBoxAddItem(GUIEditor.combobox[1], "15")
        guiComboBoxAddItem(GUIEditor.combobox[1], "1")
        GUIEditor.label[2] = guiCreateLabel(78, 43, 117, 23, "نشر متعمد________", false, GUIEditor.window[2])
        GUIEditor.label[3] = guiCreateLabel(78, 56, 117, 23, "سب+18__________", false, GUIEditor.window[2])
        GUIEditor.label[4] = guiCreateLabel(78, 69, 117, 23, "تخريب متعمد_______", false, GUIEditor.window[2])
        GUIEditor.label[5] = guiCreateLabel(78, 82, 117, 23, "نشر غير متعمد_____", false, GUIEditor.window[2])
        GUIEditor.label[6] = guiCreateLabel(78, 95, 117, 23, "سب خفيف________", false, GUIEditor.window[2])
        GUIEditor.label[7] = guiCreateLabel(78, 115, 117, 23, "تخريب غير متعمد____", false, GUIEditor.window[2])
        GUIEditor.label[8] = guiCreateLabel(78, 128, 117, 23, "إستهبال__________", false, GUIEditor.window[2])
        GUIEditor.label[9] = guiCreateLabel(78, 141, 117, 23, "السواليف__________", false, GUIEditor.window[2])
        GUIEditor.label[10] = guiCreateLabel(78, 154, 117, 23, "المساعدة الخاطئة___", false, GUIEditor.window[2])
        GUIEditor.label[11] = guiCreateLabel(78, 170, 117, 23, "طلب إنضمام+فلوس__", false, GUIEditor.window[2])
        GUIEditor.label[12] = guiCreateLabel(78, 183, 117, 23, "تكرار السؤال_______", false, GUIEditor.window[2])
        GUIEditor.label[13] = guiCreateLabel(78, 196, 117, 23, "النداء___________", false, GUIEditor.window[2])
        GUIEditor.label[14] = guiCreateLabel(78, 206, 117, 23, "تنبيه المستجد_____", false, GUIEditor.window[2])
        guiLabelSetVerticalAlign(GUIEditor.label[14], "center")
        GUIEditor.button[6] = guiCreateButton(115, 274, 76, 19, "إغلاق", false, GUIEditor.window[2])
        guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[7] = guiCreateButton(9, 274, 76, 19, "إسكات", false, GUIEditor.window[2])
        guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FFFD0000")

addEventHandler("onClientGUIClick",GUIEditor.button[8],
function()
	local sel_g = guiGridListGetSelectedItem(GUIEditor.gridlist[1])
	local sel_c = guiComboBoxGetSelected(GUIEditor.combobox[1])
    if sel_g ~= -1 and sel_c ~= -1 then
    	local theName = guiGridListGetItemText(GUIEditor.gridlist[1] ,sel_g,1)
    	local thePlr = getPlayerFromName (theName)
		local time = tonumber(guiComboBoxGetItemText(GUIEditor.combobox[1],sel_c))
		local unmuteTimer =  (time * 60) * 1000
    	triggerServerEvent("MUTE",localPlayer,thePlr,theName,unmuteTimer)
    end
end)

addEventHandler("onClientGUIClick",GUIEditor.button[1],
function ()
	if getElementData(localPlayer,"MUTED") then
		outputChatBox ("You are muted.",255,5,5) 
	end
end)
    

 

 

--server

local muted_players = {}

addEvent ("MUTE",true)
addEventHandler("MUTE",root,
function(plr,name,time)
    if not isTimer (muted_players[plr]) and not getElementData(plr,"MUTED") then
		setElementData(plr,"MUTED",true)
		muted_players[plr] = setTimer (
		function ()
			muted_players[plr] = nil
			removeElementData(plr,"MUTED")
			outputChatBox ("UNMUTED SUCCESSFUL",plr,5,255,5)
		end,time,1,plr,muted_players)
    else
		outputChatBox(""..name.." is already muted.",source,255,5,5)
    end
end)

 

Link to post
Posted (edited)

 

 

 

addEventHandler("onClientGUIClick",GUIEditor.button[7],
function()
    local sel_g = guiGridListGetSelectedItem(GUIEditor.gridlist[1])
    local sel_c = guiComboBoxGetSelected(GUIEditor.combobox[1])
    if sel_g ~= -1 and sel_c ~= -1 then
        local theName = guiGridListGetItemText(GUIEditor.gridlist[1] ,sel_g,1)
        local thePlr = getPlayerFromName (theName)
        local time = tonumber(guiComboBoxGetItemText(GUIEditor.combobox[1],sel_c))
        local unmuteTimer =  (time * 60) * 1000
        triggerServerEvent("MUTE",localPlayer,thePlr,theName,unmuteTimer)
    end
end)

addEventHandler("onClientGUIClick",GUIEditor.button[1],
function ()
    if getElementData(localPlayer,"MUTED") then
        outputChatBox ("You are muted.",255,5,5) 
    end
end)

 

--server

 

local muted_players = {}

addEvent ("MUTE",true)
addEventHandler("MUTE",root,
function(plr,name,time)
    if not isTimer (muted_players[plr]) and not getElementData(plr,"MUTED") then
        setElementData(plr,"MUTED",true)
        muted_players[plr] = setTimer (
        function ()
            muted_players[plr] = nil
            removeElementData(plr,"MUTED")
            outputChatBox ("UNMUTED SUCCESSFUL",plr,5,255,5)
        end,time,1,plr,muted_players)
    else
        outputChatBox(""..name.." is already muted.",source,255,5,5)
    end
end)
 

 

Edited by KonaaaN200
Link to post
5 minutes ago, KonaaaN200 said:

ERROR: support1\server.Lua:27: Bad argument @'setElementData'[Expected element at argument 1,got boolean] دي بق

وش مكتوب في ذا السطر ؟

Link to post
GUIEditor.window[1] = guiCreateWindow(365, 108, 571, 518, "SupportChat", false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetVisible(GUIEditor.window[1], false)

        GUIEditor.gridlist[1] = guiCreateGridList(9, 20, 553, 416, false, GUIEditor.window[1])
        guiGridListAddColumn(GUIEditor.gridlist[1], "الرسالة", 0.9)
        GUIEditor.edit[1] = guiCreateEdit(9, 438, 462, 21, "", false, GUIEditor.window[1])
        GUIEditor.button[1] = guiCreateButton(471, 438, 91, 21, "إرسال", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[3] = guiCreateButton(471, 490, 91, 19, "إغلاق", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFAAAAAA")
        GUIEditor.checkbox[2] = guiCreateCheckBox(11, 462, 134, 22, "أنا مساعد", true, false, GUIEditor.window[1])--149, 462, 80, 22,
        GUIEditor.label[1] = guiCreateLabel(237, 493, 94, 15, "By: KonaaaN200", false, GUIEditor.window[1])
        guiLabelSetColor(GUIEditor.label[1], 231, 233, 21)
        GUIEditor.button[4] = guiCreateButton(11, 490, 91, 18, "إسكات", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFFD0000")
        GUIEditor.button[5] = guiCreateButton(107, 490, 91, 18, "فك الإسكات", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FF4EFE00")
        --GUIEditor.checkbox[3] = guiCreateCheckBox(229, 462, 80, 22, "غير مساعد", false, false, GUIEditor.window[1])    


        GUIEditor.window[2] = guiCreateWindow(555, 187, 200, 302, "لوحة الميوت", false)
        guiWindowSetSizable(GUIEditor.window[2], false)
        guiSetVisible(GUIEditor.window[2], false)

        GUIEditor.combobox[1] = guiCreateComboBox(9, 22, 69, 217, "240", false, GUIEditor.window[2])
        guiComboBoxAddItem(GUIEditor.combobox[1], "1200")
        guiComboBoxAddItem(GUIEditor.combobox[1], "1200")
        guiComboBoxAddItem(GUIEditor.combobox[1], "600")
        guiComboBoxAddItem(GUIEditor.combobox[1], "600")
        guiComboBoxAddItem(GUIEditor.combobox[1], "240")
        guiComboBoxAddItem(GUIEditor.combobox[1], "240")
        guiComboBoxAddItem(GUIEditor.combobox[1], "120")
        guiComboBoxAddItem(GUIEditor.combobox[1], "120")
        guiComboBoxAddItem(GUIEditor.combobox[1], "60")
        guiComboBoxAddItem(GUIEditor.combobox[1], "30")
        guiComboBoxAddItem(GUIEditor.combobox[1], "30")
        guiComboBoxAddItem(GUIEditor.combobox[1], "15")
        guiComboBoxAddItem(GUIEditor.combobox[1], "1")
        GUIEditor.label[2] = guiCreateLabel(78, 43, 117, 23, "نشر متعمد________", false, GUIEditor.window[2])
        GUIEditor.label[3] = guiCreateLabel(78, 56, 117, 23, "سب+18__________", false, GUIEditor.window[2])
        GUIEditor.label[4] = guiCreateLabel(78, 69, 117, 23, "تخريب متعمد_______", false, GUIEditor.window[2])
        GUIEditor.label[5] = guiCreateLabel(78, 82, 117, 23, "نشر غير متعمد_____", false, GUIEditor.window[2])
        GUIEditor.label[6] = guiCreateLabel(78, 95, 117, 23, "سب خفيف________", false, GUIEditor.window[2])
        GUIEditor.label[7] = guiCreateLabel(78, 115, 117, 23, "تخريب غير متعمد____", false, GUIEditor.window[2])
        GUIEditor.label[8] = guiCreateLabel(78, 128, 117, 23, "إستهبال__________", false, GUIEditor.window[2])
        GUIEditor.label[9] = guiCreateLabel(78, 141, 117, 23, "السواليف__________", false, GUIEditor.window[2])
        GUIEditor.label[10] = guiCreateLabel(78, 154, 117, 23, "المساعدة الخاطئة___", false, GUIEditor.window[2])
        GUIEditor.label[11] = guiCreateLabel(78, 170, 117, 23, "طلب إنضمام+فلوس__", false, GUIEditor.window[2])
        GUIEditor.label[12] = guiCreateLabel(78, 183, 117, 23, "تكرار السؤال_______", false, GUIEditor.window[2])
        GUIEditor.label[13] = guiCreateLabel(78, 196, 117, 23, "النداء___________", false, GUIEditor.window[2])
        GUIEditor.label[14] = guiCreateLabel(78, 206, 117, 23, "تنبيه المستجد_____", false, GUIEditor.window[2])
        guiLabelSetVerticalAlign(GUIEditor.label[14], "center")
        GUIEditor.button[6] = guiCreateButton(115, 274, 76, 19, "إغلاق", false, GUIEditor.window[2])
        guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[7] = guiCreateButton(9, 274, 76, 19, "إسكات", false, GUIEditor.window[2])
        guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FFFD0000")

addEventHandler("onClientGUIClick",GUIEditor.button[8],
function()
	local sel_g = guiGridListGetSelectedItem(GUIEditor.gridlist[1])
	local sel_c = guiComboBoxGetSelected(GUIEditor.combobox[1])
    if sel_g ~= -1 and sel_c ~= -1 then
    	local theName = guiGridListGetItemText(GUIEditor.gridlist[1] ,sel_g,1)
		local time = tonumber(guiComboBoxGetItemText(GUIEditor.combobox[1],sel_c))
		local unmuteTimer =  (time * 60) * 1000
    	triggerServerEvent("MUTE",localPlayer,theName,unmuteTimer)
    end
end)

addEventHandler("onClientGUIClick",GUIEditor.button[1],
function ()
	if getElementData(localPlayer,"MUTED") then
		outputChatBox ("You are muted.",255,5,5) 
	end
end)
    

 

 

--server

local muted_players = {}

addEvent ("MUTE",true)
addEventHandler("MUTE",root,
function(name,time)
	local plr = getPlayerFromName(name)
    if not isTimer (muted_players[plr]) and not getElementData(plr,"MUTED") then
		setElementData(plr,"MUTED",true)
		muted_players[plr] = setTimer (
		function ()
			muted_players[plr] = nil
			removeElementData(plr,"MUTED")
			outputChatBox ("UNMUTED SUCCESSFUL",plr,5,255,5)
		end,time,1,plr,muted_players)
    else
		outputChatBox(""..name.." is already muted.",source,255,5,5)
    end
end)

 

Link to post

نفس المشكلة  ERROR: support1\server.Lua:28: Bad argument @'setElementData'[Expected element at argument 1,got boolean]

 

        setElementData(plr,"MUTED",true)

Link to post

إذا طلع لك بالشات

there is no player with that name.

هذا يعني ان مافيه لاعب بذا الاسم تأكد من اسم اللاعب اللي في القريد لست وانك مو شايل اكواد الالوان من اللاعب !

ركز لي على اكواد الالوان 

زي كذا :

#03ffab

إذا موجوده بإسم اللاعب ومو موجوده بالقريد لست اللي جبت منها الاسم كذا ماراح تجيك قيمة اللاعب صحيحه

SERVER SIDE :

local muted_players = {}

addEvent ("MUTE",true)
addEventHandler("MUTE",root,
function(name,time)
	local plr = getPlayerFromName(name)
	if plr and isElement(plr) and getElementType(plr)=="player" then
		if not isTimer (muted_players[plr]) and not getElementData(plr,"MUTED") then
			setElementData(plr,"MUTED",true)
			muted_players[plr] = setTimer (
			function ()
				muted_players[plr] = nil
				removeElementData(plr,"MUTED")
				outputChatBox ("UNMUTED SUCCESSFUL",plr,5,255,5)
			end,time,1,plr,muted_players)
		else
			outputChatBox(""..name.." is already muted.",source,255,5,5)
		end
	else
		outputChatBox("there is no player with that name.",source);
	end
end)

 

توضيح أكثر ..

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

اللاعب يحطها عشان يغير لون اسمه في الشات

اذا كان اللاعب حاطها

وانت اضفته للقائمة (القريد لست اقصد) فتأكد هل اللاعب اسمه كامل مع اكواد الالوان

ولا اسمه مختصر يعني مستخدم 

string.gsub 

قبل لا تحط اسمه في القائمة ؟

اذا مختصر هنا المشكله لازم تشوف حل يا تحط اسمه كامل مع اكواد الالوان

يا تحط داتا بإسم اللاعب كامل بدون اختصار وتجيب الاسم عن طريق الداتا مو عن طريق القريد لست

Edited by VenomNX
Link to post

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