Jump to content

x[ مساعدة ]x Button في فانكشن


Recommended Posts

السلام عليكم
كيف الحال؟

مود الراديو حق العقر
ب

لتشغيل المود اضغط حرف  ' ة ' ض  ,, المود يفتح للكل !! أريد اسوى اضافة واخلى المود فقط يظهر على 2 سريال

-سيرفر

--======== Settings ========--

theKey = "M" -- The key will toggle radio

texts = { -- the texts of the radio sounds
[1] = "Go Go Go !",
[2] = "Need Backup !",
[3] = "Cover Me !",
[4] = "Follow Me !",
[5] = "In Postition !",
[6] = "Need Assistance !",
[7] = "Sector Clear !",
[8] = "Stick Together !",
[9] = "Negative !",
}

RadioText = "|| Radio - Press Number:" -- first label text

FloodTime = 20 --- how much is flood time [ in seconds ]

c11,c12,c13 = 255,255,0 -- first color [ yellow ]

c21,c22,c23 = 0,255,255 -- second color [ green ]

--======== Settings ========--


GUIEditor_Label = {}
GUIEditor_Label[1] = guiCreateLabel(19,193-5,235,16,RadioText,false)
GUIEditor_Label[2] = guiCreateLabel(19,193+20,235,16,"1 : Go GO Go",false)
GUIEditor_Label[3] = guiCreateLabel(19,193+20+20,235,16,"2 : Go GO Go",false)
GUIEditor_Label[4] = guiCreateLabel(19,193+20+20+20,235,16,"3 : Go GO Go",false)
GUIEditor_Label[5] = guiCreateLabel(19,193+20+20+20+20,235,16,"4 : Go GO Go",false)
GUIEditor_Label[6] = guiCreateLabel(19,193+20+20+20+20+20,235,16,"5 : Go GO Go",false)
GUIEditor_Label[7] = guiCreateLabel(19,193+20+20+20+20+20+20,235,16,"6 : Go GO Go",false)
GUIEditor_Label[8] = guiCreateLabel(19,193+20+20+20+20+20+20+20,235,16,"7 : Go GO Go",false)
GUIEditor_Label[9] = guiCreateLabel(19,193+20+20+20+20+20+20+20+20,235,16,"8 : Go GO Go",false)
GUIEditor_Label[10] = guiCreateLabel(19,193+20+20+20+20+20+20+20+20+20,235,16,"9 : Go GO Go",false)

for k,v in ipairs (GUIEditor_Label) do
	guiSetFont(v,"default-bold-small")
end

function bind()
can = true
	for i,v in ipairs ( GUIEditor_Label ) do
		for k,m in ipairs ( texts ) do
			if k == i then
			guiSetText(GUIEditor_Label[i+1],""..k.." : "..m.."")
		end
	end
		guiSetVisible(v,false)
		guiLabelSetColor(v,0,255,0)
		bindKey(tostring(theKey),"down",function() 
			if guiGetVisible(v) == true then
				guiSetVisible(v,false) 
				unbindKey(""..i.."","down",function() guiLabelSetColor(GUIEditor_Label[i+1],c11,c12,c13) end )
				unbindKey(""..i.."","up",function() guiLabelSetColor(GUIEditor_Label[i+1],c21,c22,c23) end )
			else
				guiSetVisible(v,true) 
					bindKey(""..i.."","down",function() 
						if can then
							can = false
							setTimer(function() can = true end,FloodTime * 1000 , 1 )
							guiLabelSetColor(GUIEditor_Label[i+1],c11,c12,c13) 
							triggerServerEvent("playIT",getLocalPlayer(),getLocalPlayer(),i)
						end
					end )
				bindKey(""..i.."","up",function() guiLabelSetColor(GUIEditor_Label[i+1],0,255,0) end )
			end
	end  )

end
end
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),bind)

addEvent("playITc",true)
addEventHandler("playITc",root,function(who,what)
	outputChatBox("[RADIO] "..getPlayerName(who).." : "..texts[what].."",c21,c22,c23,true)
	playSound(""..what..".mp3")
end )

 

-كلينت

addEvent("playIT",true)
addEventHandler("playIT",root,function(who,what)
for k,v in ipairs ( getElementsByType("player") ) do
if getPlayerTeam(v) == getPlayerTeam(who) then
	triggerClientEvent(v,"playITc",v,who,what)
end
end
end )

 

شكراً

Link to comment

انت ملخبط ض الاول كلينت والثاني سيرفر

سوي الزر بسيرفر وتحقق من السريالات باستخدام

getPlayerSerial

وسوي ترايقر للكلينت عشان يفتح اللوحة

Link to comment
35 minutes ago, #BrosS said:

انت ملخبط ض الاول كلينت والثاني سيرفر

سوي الزر بسيرفر وتحقق من السريالات باستخدام


getPlayerSerial

وسوي ترايقر للكلينت عشان يفتح اللوحة

اى صح اتخبرطو ههههههههههههه , آسف
 


تجربة ضض

 

-سيرفر

addEvent("playIT",true)
addEventHandler("playIT",root,function(who,what)
for k,v in ipairs ( getElementsByType("player") ) do
if getPlayerTeam(v) == getPlayerTeam(who) then
	triggerClientEvent(v,"playITc",v,who,what)
end
end
end )

local allowedAccountSerials = 
{
   { "9C9F3B55D9D7BB7135FF274D3BF444E4" },
   { "2C9F3B55D9D7BB7135FF274D3BF444E4" },
}

addEventHandler("onPlayerLogin", root,
    function(_, account)
        local playerSerial, allowedSerials = getPlayerSerial(source), allowedAccountSerials[(serial)] or ""
        for i = 1, #allowedSerials do
            if allowedSerials[i] == playerSerial then
                return
            end
        end
        outputChatBox("Not Allow",root,0,0,0, true)
    end
)

-كلينت

--======== Settings ========--

theKey = "M" -- The key will toggle radio

texts = { -- the texts of the radio sounds
[1] = "Go Go Go !",
[2] = "Need Backup !",
[3] = "Cover Me !",
[4] = "Follow Me !",
[5] = "In Postition !",
[6] = "Need Assistance !",
[7] = "Sector Clear !",
[8] = "Stick Together !",
[9] = "Negative !",
}

RadioText = "|| Radio - Press Number:" -- first label text

FloodTime = 20 --- how much is flood time [ in seconds ]

c11,c12,c13 = 255,255,0 -- first color [ yellow ]

c21,c22,c23 = 0,255,255 -- second color [ green ]

--======== Settings ========--


GUIEditor_Label = {}
GUIEditor_Label[1] = guiCreateLabel(19,193-5,235,16,RadioText,false)
GUIEditor_Label[2] = guiCreateLabel(19,193+20,235,16,"1 : Go GO Go",false)
GUIEditor_Label[3] = guiCreateLabel(19,193+20+20,235,16,"2 : Go GO Go",false)
GUIEditor_Label[4] = guiCreateLabel(19,193+20+20+20,235,16,"3 : Go GO Go",false)
GUIEditor_Label[5] = guiCreateLabel(19,193+20+20+20+20,235,16,"4 : Go GO Go",false)
GUIEditor_Label[6] = guiCreateLabel(19,193+20+20+20+20+20,235,16,"5 : Go GO Go",false)
GUIEditor_Label[7] = guiCreateLabel(19,193+20+20+20+20+20+20,235,16,"6 : Go GO Go",false)
GUIEditor_Label[8] = guiCreateLabel(19,193+20+20+20+20+20+20+20,235,16,"7 : Go GO Go",false)
GUIEditor_Label[9] = guiCreateLabel(19,193+20+20+20+20+20+20+20+20,235,16,"8 : Go GO Go",false)
GUIEditor_Label[10] = guiCreateLabel(19,193+20+20+20+20+20+20+20+20+20,235,16,"9 : Go GO Go",false)

for k,v in ipairs (GUIEditor_Label) do
	guiSetFont(v,"default-bold-small")
end

function bind()
can = true
	for i,v in ipairs ( GUIEditor_Label ) do
		for k,m in ipairs ( texts ) do
			if k == i then
			guiSetText(GUIEditor_Label[i+1],""..k.." : "..m.."")
		end
	end
		guiSetVisible(v,false)
		guiLabelSetColor(v,0,255,0)
		bindKey(tostring(theKey),"down",function() 
			if guiGetVisible(v) == true then
				guiSetVisible(v,false) 
				unbindKey(""..i.."","down",function() guiLabelSetColor(GUIEditor_Label[i+1],c11,c12,c13) end )
				unbindKey(""..i.."","up",function() guiLabelSetColor(GUIEditor_Label[i+1],c21,c22,c23) end )
			else
				guiSetVisible(v,true) 
					bindKey(""..i.."","down",function() 
						if can then
							can = false
							setTimer(function() can = true end,FloodTime * 1000 , 1 )
							guiLabelSetColor(GUIEditor_Label[i+1],c11,c12,c13) 
							triggerServerEvent("playIT",getLocalPlayer(),getLocalPlayer(),i)
						end
					end )
				bindKey(""..i.."","up",function() guiLabelSetColor(GUIEditor_Label[i+1],0,255,0) end )
			end
	end  )

end
end
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),bind)

addEvent("playITc",true)
addEventHandler("playITc",root,function(who,what)
	outputChatBox("[RADIO] "..getPlayerName(who).." : "..texts[what].."",c21,c22,c23,true)
	playSound(""..what..".mp3")
end )

 

Link to comment
16 hours ago, Mr.OppS said:

السلام عليكم
كيف الحال؟

مود الراديو حق العقر
ب

لتشغيل المود اضغط حرف  ' ة ' ض  ,, المود يفتح للكل !! أريد اسوى اضافة واخلى المود فقط يظهر على 2 سريال

-كلينت


--======== Settings ========--

theKey = "M" -- The key will toggle radio

texts = { -- the texts of the radio sounds
[1] = "Go Go Go !",
[2] = "Need Backup !",
[3] = "Cover Me !",
[4] = "Follow Me !",
[5] = "In Postition !",
[6] = "Need Assistance !",
[7] = "Sector Clear !",
[8] = "Stick Together !",
[9] = "Negative !",
}

RadioText = "|| Radio - Press Number:" -- first label text

FloodTime = 20 --- how much is flood time [ in seconds ]

c11,c12,c13 = 255,255,0 -- first color [ yellow ]

c21,c22,c23 = 0,255,255 -- second color [ green ]

--======== Settings ========--


GUIEditor_Label = {}
GUIEditor_Label[1] = guiCreateLabel(19,193-5,235,16,RadioText,false)
GUIEditor_Label[2] = guiCreateLabel(19,193+20,235,16,"1 : Go GO Go",false)
GUIEditor_Label[3] = guiCreateLabel(19,193+20+20,235,16,"2 : Go GO Go",false)
GUIEditor_Label[4] = guiCreateLabel(19,193+20+20+20,235,16,"3 : Go GO Go",false)
GUIEditor_Label[5] = guiCreateLabel(19,193+20+20+20+20,235,16,"4 : Go GO Go",false)
GUIEditor_Label[6] = guiCreateLabel(19,193+20+20+20+20+20,235,16,"5 : Go GO Go",false)
GUIEditor_Label[7] = guiCreateLabel(19,193+20+20+20+20+20+20,235,16,"6 : Go GO Go",false)
GUIEditor_Label[8] = guiCreateLabel(19,193+20+20+20+20+20+20+20,235,16,"7 : Go GO Go",false)
GUIEditor_Label[9] = guiCreateLabel(19,193+20+20+20+20+20+20+20+20,235,16,"8 : Go GO Go",false)
GUIEditor_Label[10] = guiCreateLabel(19,193+20+20+20+20+20+20+20+20+20,235,16,"9 : Go GO Go",false)

for k,v in ipairs (GUIEditor_Label) do
	guiSetFont(v,"default-bold-small")
end

function bind()
can = true
	for i,v in ipairs ( GUIEditor_Label ) do
		for k,m in ipairs ( texts ) do
			if k == i then
			guiSetText(GUIEditor_Label[i+1],""..k.." : "..m.."")
		end
	end
		guiSetVisible(v,false)
		guiLabelSetColor(v,0,255,0)
		bindKey(tostring(theKey),"down",function() 
			if guiGetVisible(v) == true then
				guiSetVisible(v,false) 
				unbindKey(""..i.."","down",function() guiLabelSetColor(GUIEditor_Label[i+1],c11,c12,c13) end )
				unbindKey(""..i.."","up",function() guiLabelSetColor(GUIEditor_Label[i+1],c21,c22,c23) end )
			else
				guiSetVisible(v,true) 
					bindKey(""..i.."","down",function() 
						if can then
							can = false
							setTimer(function() can = true end,FloodTime * 1000 , 1 )
							guiLabelSetColor(GUIEditor_Label[i+1],c11,c12,c13) 
							triggerServerEvent("playIT",getLocalPlayer(),getLocalPlayer(),i)
						end
					end )
				bindKey(""..i.."","up",function() guiLabelSetColor(GUIEditor_Label[i+1],0,255,0) end )
			end
	end  )

end
end
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),bind)

addEvent("playITc",true)
addEventHandler("playITc",root,function(who,what)
	outputChatBox("[RADIO] "..getPlayerName(who).." : "..texts[what].."",c21,c22,c23,true)
	playSound(""..what..".mp3")
end )

 

-سيرفر


addEvent("playIT",true)
addEventHandler("playIT",root,function(who,what)
for k,v in ipairs ( getElementsByType("player") ) do
if getPlayerTeam(v) == getPlayerTeam(who) then
	triggerClientEvent(v,"playITc",v,who,what)
end
end
end )

 

شكراً

 

Link to comment

local allowedAccountSerials = 
{
   [ "9C9F3B55D9D7BB7135FF274D3BF444E4" ] = true,
   [ "2C9F3B55D9D7BB7135FF274D3BF444E4" ] = true
}

addEventHandler("onPlayerLogin", root,
    function(_, account)
        local playerSerial = getPlayerSerial(source)
            if allowedAccountSerials[playerSerial] then
      			-- code ..
                return
            end
        outputChatBox("Not Allow",root,0,0,0, true)
    end
)

 

Link to comment
16 minutes ago, iMr.WiFi..! said:

local allowedAccountSerials = {   [ "9C9F3B55D9D7BB7135FF274D3BF444E4" ] = true,   [ "2C9F3B55D9D7BB7135FF274D3BF444E4" ] = true}addEventHandler("onPlayerLogin", root,    function(_, account)        local playerSerial = getPlayerSerial(source)            if allowedAccountSerials[playerSerial] then      			-- code ..                return            end        outputChatBox("Not Allow",root,0,0,0, true)    end)

 

اي ماضبطط:o

Link to comment
13 hours ago, Mr.OppS said:

 

 

On ٢٤‏/٧‏/٢٠١٧ at 20:04, Mr.OppS said:

السلام عليكم
كيف الحال؟

مود الراديو حق العقر
ب

لتشغيل المود اضغط حرف  ' ة ' ض  ,, المود يفتح للكل !! أريد اسوى اضافة واخلى المود فقط يظهر على 2 سريال

-كلينت


--======== Settings ========--

theKey = "M" -- The key will toggle radio

texts = { -- the texts of the radio sounds
[1] = "Go Go Go !",
[2] = "Need Backup !",
[3] = "Cover Me !",
[4] = "Follow Me !",
[5] = "In Postition !",
[6] = "Need Assistance !",
[7] = "Sector Clear !",
[8] = "Stick Together !",
[9] = "Negative !",
}

RadioText = "|| Radio - Press Number:" -- first label text

FloodTime = 20 --- how much is flood time [ in seconds ]

c11,c12,c13 = 255,255,0 -- first color [ yellow ]

c21,c22,c23 = 0,255,255 -- second color [ green ]

--======== Settings ========--


GUIEditor_Label = {}
GUIEditor_Label[1] = guiCreateLabel(19,193-5,235,16,RadioText,false)
GUIEditor_Label[2] = guiCreateLabel(19,193+20,235,16,"1 : Go GO Go",false)
GUIEditor_Label[3] = guiCreateLabel(19,193+20+20,235,16,"2 : Go GO Go",false)
GUIEditor_Label[4] = guiCreateLabel(19,193+20+20+20,235,16,"3 : Go GO Go",false)
GUIEditor_Label[5] = guiCreateLabel(19,193+20+20+20+20,235,16,"4 : Go GO Go",false)
GUIEditor_Label[6] = guiCreateLabel(19,193+20+20+20+20+20,235,16,"5 : Go GO Go",false)
GUIEditor_Label[7] = guiCreateLabel(19,193+20+20+20+20+20+20,235,16,"6 : Go GO Go",false)
GUIEditor_Label[8] = guiCreateLabel(19,193+20+20+20+20+20+20+20,235,16,"7 : Go GO Go",false)
GUIEditor_Label[9] = guiCreateLabel(19,193+20+20+20+20+20+20+20+20,235,16,"8 : Go GO Go",false)
GUIEditor_Label[10] = guiCreateLabel(19,193+20+20+20+20+20+20+20+20+20,235,16,"9 : Go GO Go",false)

for k,v in ipairs (GUIEditor_Label) do
	guiSetFont(v,"default-bold-small")
end

function bind()
can = true
	for i,v in ipairs ( GUIEditor_Label ) do
		for k,m in ipairs ( texts ) do
			if k == i then
			guiSetText(GUIEditor_Label[i+1],""..k.." : "..m.."")
		end
	end
		guiSetVisible(v,false)
		guiLabelSetColor(v,0,255,0)
		bindKey(tostring(theKey),"down",function() 
			if guiGetVisible(v) == true then
				guiSetVisible(v,false) 
				unbindKey(""..i.."","down",function() guiLabelSetColor(GUIEditor_Label[i+1],c11,c12,c13) end )
				unbindKey(""..i.."","up",function() guiLabelSetColor(GUIEditor_Label[i+1],c21,c22,c23) end )
			else
				guiSetVisible(v,true) 
					bindKey(""..i.."","down",function() 
						if can then
							can = false
							setTimer(function() can = true end,FloodTime * 1000 , 1 )
							guiLabelSetColor(GUIEditor_Label[i+1],c11,c12,c13) 
							triggerServerEvent("playIT",getLocalPlayer(),getLocalPlayer(),i)
						end
					end )
				bindKey(""..i.."","up",function() guiLabelSetColor(GUIEditor_Label[i+1],0,255,0) end )
			end
	end  )

end
end
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),bind)

addEvent("playITc",true)
addEventHandler("playITc",root,function(who,what)
	outputChatBox("[RADIO] "..getPlayerName(who).." : "..texts[what].."",c21,c22,c23,true)
	playSound(""..what..".mp3")
end )

 

-سيرفر


addEvent("playIT",true)addEventHandler("playIT",root,function(who,what)for k,v in ipairs ( getElementsByType("player") ) doif getPlayerTeam(v) == getPlayerTeam(who) then	triggerClientEvent(v,"playITc",v,who,what)endendend )

 

شكراً

 

Link to comment
13 hours ago, Mr.OppS said:

اي ماضبطط:o

الديبق ؟

وجرب ذ :
 

local allowedAccountSerials = {
   "9C9F3B55D9D7BB7135FF274D3BF444E4",
   "2C9F3B55D9D7BB7135FF274D3BF444E4"
}
addEventHandler("onPlayerLogin", root,
    function(_, account)
        local playerSerial = getPlayerSerial(source)
    	for _,v in ipairs ( allowedAccountSerials ) do
            if v == playerSerial then
      			-- code 
        		else
                outputChatBox("Not Allow",root,0,0,0, true)
            end
      	 end
    end
)

 

Link to comment
3 hours ago, iMr.WiFi..! said:

الديبق ؟

وجرب ذ :
 


local allowedAccountSerials = {   "9C9F3B55D9D7BB7135FF274D3BF444E4",   "2C9F3B55D9D7BB7135FF274D3BF444E4"}addEventHandler("onPlayerLogin", root,    function(_, account)        local playerSerial = getPlayerSerial(source)    	for _,v in ipairs ( allowedAccountSerials ) do            if v == playerSerial then      			-- code         		else                outputChatBox("Not Allow",root,0,0,0, true)            end      	 end    end)

 

 

 

 

-- code 

ما اعرف احط الكود

:(:$ حاولت ولكن فشلت

 

Link to comment
9 hours ago, Mr.OppS said:

 

 

 


-- code 


ما اعرف احط الكود

:(:$ حاولت ولكن فشلت

 

جرب :

#Server : 
 

local Serials_ = {
["9C9F3B55D9D7BB7135FF274D3BF444E4"] = true,
["2C9F3B55D9D7BB7135FF274D3BF444E4"] = true,
}

function(Player_)
	local GetSerial = getPlayerSerial(Player_)
	    if Serials_[GetSerial] then
            triggerClientEvent( Player_ , 'TriggerName' , root , true )
       else
        outputChatBox( '* Not Allow' , Player_ , 255 , 0 , 0 , true )
    end
end
)

#Client :

addEvent( 'TriggerName' , true )
addEventHandler( 'TriggerName' , root ,
function ()
guiSetVisible ( YourWindowName , not guiGetVisible ( YourWindowName ) )
showCursor ( guiGetVisible ( YourWindowName ) )
end
)

@Mr.OppS

إستبدل YourWindowName ,
بأسم اللوحة .. 
بالتوفيق

Link to comment
local Serials_ = {
["9C9F3B55D9D7BB7135FF274D3BF444E4"] = true,
["2C9F3B55D9D7BB7135FF274D3BF444E4"] = true,
}
function(Player_)
	local GetSerial = getPlayerSerial(Player_)
	    if Serials_[GetSerial] then
            triggerClientEvent( Player_ , 'TriggerName' , root , true )
       else
        outputChatBox( '* Not Allow' , Player_ , 255 , 0 , 0 , true )
    end
end

 

3 hours ago, Abdul KariM said:

@MR.StoRm راجع اكوادك

شكرا للتنبيه 

Link to comment
11 minutes ago, Abdul KariM said:

ماسويت شي قصدي انك ماضفت الكوماند + عدل ع الترايقر

كنت ضايف كوماند لكن شلته لان هو قايل انه لوحته تفتح ب حرف ة 

local Serials_ = {
["9C9F3B55D9D7BB7135FF274D3BF444E4"] = true,
["2C9F3B55D9D7BB7135FF274D3BF444E4"] = true,
}
addCommandHandler ( 'Open' ,
function(Player_)
	local GetSerial = getPlayerSerial(Player_)
	    if Serials_[GetSerial] then
            triggerClientEvent( Player_ , 'TriggerName', Player_ )
       else
        outputChatBox( '* Not Allow' , Player_ , 255 , 0 , 0 , true )
    end
end
)

 

Link to comment
2 hours ago, MR.StoRm said:

كنت ضايف كوماند لكن شلته لان هو قايل انه لوحته تفتح ب حرف ة 


local Serials_ = {["9C9F3B55D9D7BB7135FF274D3BF444E4"] = true,["2C9F3B55D9D7BB7135FF274D3BF444E4"] = true,}addCommandHandler ( 'Open' ,function(Player_)	local GetSerial = getPlayerSerial(Player_)	    if Serials_[GetSerial] then            triggerClientEvent( Player_ , 'TriggerName', Player_ )       else        outputChatBox( '* Not Allow' , Player_ , 255 , 0 , 0 , true )    endend)

 

ضـفـت الأكود ! بس ماضبطط

الوحة تفتح لكل ! و هذا الامر مايضبط

Link to comment

function Open ()
if getPlayerSerial(player) == "Serials" or getPlayerSerial(player) == "Serials" then
if (guiGetVisible (window) == true) then
guiSetVisible (window, false)
showCursor (false)
else
outputChatBox( "The Window Open",0,255,255, true )
guiSetVisible (window, true)
showCursor (true)
end
else
outputChatBox( "* Not Allow",0,255,255, true )
end
end
addCommandHandler ( "Open", Open )

جرب

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