Jump to content

تصحيح كود


Wormen

Recommended Posts

سويت مود مثل التايمر 
سويت لوحة , و سويت Edit
و حطيط يحط عدد الوقت في Edit
و يجيب العدد من 
 

guiGetText

الخطاء في التايمر ممكن تصحوحة و أذا غلط تقدرو تقلولي وش أسوي أو تصححو

الكود : 
 

GUIEditor = {
    label = {},
	window = {},
	edit = {},
    staticimage = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.staticimage[1] = guiCreateStaticImage(0.22, -0.02, 0.55, 0.99, "images/news.png", true)
        guiSetVisible(GUIEditor.staticimage[1],false)
        GUIEditor.staticimage[2] = guiCreateStaticImage(0.17, 0.03, 0.67, 0.97, "images/hand.png", false, GUIEditor.staticimage[1])
        GUIEditor.edit[1] = guiCreateEdit(46, 36, 308, 22, "", false, GUIEditor.window[1])
    end
)



addEventHandler("onClientGUIClick",getRootElement(),
function ( )
    if ( source == GUIEditor.staticimage[2] ) then
	local text = guiGetText(GUIEditor.edit[1])
	setTimer(tr,"..text..",1, " Hello World")
end
end)

function tr ()
    triggerServerEvent("send",getRootElement())
end

 

Edited by Wormen
Link to comment
16 minutes ago, Wormen said:

سويت مود مثل التايمر 
سويت لوحة , و سويت Edit
و حطيط يحط عدد الوقت في Edit
و يجيب العدد من 
 


guiGetText

الخطاء في التايمر ممكن تصحوحة و أذا غلط تقدرو تقلولي وش أسوي أو تصححو

الكود : 
 


GUIEditor = {
    label = {},
	window = {},
	edit = {},
    staticimage = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.staticimage[1] = guiCreateStaticImage(0.22, -0.02, 0.55, 0.99, "images/news.png", true)
        guiSetVisible(GUIEditor.staticimage[1],false)
        GUIEditor.staticimage[2] = guiCreateStaticImage(0.17, 0.03, 0.67, 0.97, "images/hand.png", false, GUIEditor.staticimage[1])
        GUIEditor.edit[1] = guiCreateEdit(46, 36, 308, 22, "", false, GUIEditor.window[1])
    end
)



addEventHandler("onClientGUIClick",getRootElement(),
function ( )
    if ( source == GUIEditor.staticimage[2] ) then
	local text = guiGetText(GUIEditor.edit[1])
	setTimer(tr,"..text..",1, " Hello World")
end
end)

function tr ()
    triggerServerEvent("send",getRootElement())
end

 

setTimer( function name, time in milliseconds, loop time, args... )

الحين

GUIEditor = { label = {}, window = {}, edit = {}, staticimage = {} }

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.staticimage[1] = guiCreateStaticImage(0.22, -0.02, 0.55, 0.99, "images/news.png", true)
        guiSetVisible(GUIEditor.staticimage[1],false)
        GUIEditor.staticimage[2] = guiCreateStaticImage(0.17, 0.03, 0.67, 0.97, "images/hand.png", false, GUIEditor.staticimage[1])
        GUIEditor.edit[1] = guiCreateEdit(46, 36, 308, 22, "", false, GUIEditor.window[1])
    end
)



addEventHandler("onClientGUIClick", guiRoot,
	function()
		if source == GUIEditor.staticimage[2] then
			setTimer(triggerServerEvent, tonumber(guiGetText(GUIEditor.edit[1])), 1, "send", localPlayer)
		end
	end
)

 

Edited by #x1AhMeD,-09
Link to comment
Just now, #x1AhMeD,-09 said:

setTimer( function name, time in milliseconds, loop time, args... )

الحين


GUIEditor = { label = {}, window = {}, edit = {}, staticimage = {} }

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.staticimage[1] = guiCreateStaticImage(0.22, -0.02, 0.55, 0.99, "images/news.png", true)
        guiSetVisible(GUIEditor.staticimage[1],false)
        GUIEditor.staticimage[2] = guiCreateStaticImage(0.17, 0.03, 0.67, 0.97, "images/hand.png", false, GUIEditor.staticimage[1])
        GUIEditor.edit[1] = guiCreateEdit(46, 36, 308, 22, "", false, GUIEditor.window[1])
    end
)



addEventHandler("onClientGUIClick", guiRoot,
	function()
		if source == GUIEditor.staticimage[2] then
			setTimer(triggerServerEvent, tonumber(guiGetText(GUIEditor.edit[1])), 1, "send", localPlayer)
		end
	end
)

 

ما يشتغل 
يقولي في الدي بق 
 

WARNING: bomb/client:4: Bad usage @ 'setTimer' [Interval is below 50]
addEventHandler("onClientGUIClick", getRootElement(),
	function()
		if ( source == GUIEditor.button[1] ) then
			setTimer(triggerServerEvent, tonumber(guiGetText(GUIEditor.edit[1])), 1, "send", localPlayer)
		elseif ( source == GUIEditor.button[2] ) then
		guiSetVisible(GUIEditor.window[1],false)
		showCursor(false)
		end
	end
)

 

Link to comment
GUIEditor = { label = {}, window = {}, edit = {}, staticimage = {} }

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.staticimage[1] = guiCreateStaticImage(0.22, -0.02, 0.55, 0.99, "images/news.png", true)
        guiSetVisible(GUIEditor.staticimage[1],false)
        GUIEditor.staticimage[2] = guiCreateStaticImage(0.17, 0.03, 0.67, 0.97, "images/hand.png", false, GUIEditor.staticimage[1])
        GUIEditor.edit[1] = guiCreateEdit(46, 36, 308, 22, "", false, GUIEditor.window[1])
    end
)



addEventHandler("onClientGUIClick", guiRoot,
	function()
		if source == GUIEditor.staticimage[2] then
			setTimer(triggerServerEvent, 500, 1, "send", resourceRoot, tonumber(guiGetText(GUIEditor.edit[1])))
		end
	end
)

-- server side
addEvent("send", true)
addEventHandler("send", resourceRoot,
  function ( number )
    -- blabla..
  end
)

 

Edited by King12
Link to comment
Just now, King12 said:

GUIEditor = { label = {}, window = {}, edit = {}, staticimage = {} }

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.staticimage[1] = guiCreateStaticImage(0.22, -0.02, 0.55, 0.99, "images/news.png", true)
        guiSetVisible(GUIEditor.staticimage[1],false)
        GUIEditor.staticimage[2] = guiCreateStaticImage(0.17, 0.03, 0.67, 0.97, "images/hand.png", false, GUIEditor.staticimage[1])
        GUIEditor.edit[1] = guiCreateEdit(46, 36, 308, 22, "", false, GUIEditor.window[1])
    end
)



addEventHandler("onClientGUIClick", guiRoot,
	function()
		if source == GUIEditor.staticimage[2] then
			setTimer(triggerServerEvent, 500, 1, "send", resourceRoot, tonumber(guiGetText(GUIEditor.edit[1])))
		end
	end
)

-- server side
addEvent("send", true)
addEventHandler("send", resourceRoot,
  function ( number )
    -- blabla..
  end
)

 

ي أخي أقولك يجيب التايمر من edit
-_-

 

Link to comment
4 minutes ago, Wormen said:

ي أخي أقولك يجيب التايمر من edit
-_-

 

ما أنتبهت لكلامك, تفضل:

GUIEditor = { label = {}, window = {}, edit = {}, staticimage = {} }

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.staticimage[1] = guiCreateStaticImage(0.22, -0.02, 0.55, 0.99, "images/news.png", true)
        guiSetVisible(GUIEditor.staticimage[1],false)
        GUIEditor.staticimage[2] = guiCreateStaticImage(0.17, 0.03, 0.67, 0.97, "images/hand.png", false, GUIEditor.staticimage[1])
        GUIEditor.edit[1] = guiCreateEdit(46, 36, 308, 22, "", false, GUIEditor.window[1])
    end
)



addEventHandler("onClientGUIClick", resourceRoot,
	function()
		if source == GUIEditor.staticimage[2] then
			setTimer(triggerServerEvent, tonumber(guiGetText(GUIEditor.edit[1])) or 100, 1, "send", resourceRoot)
		end
	end
)

-- server side
addEvent("send", true)
addEventHandler("send", resourceRoot,
  function ()
    -- blabla..
  end
)

 

Link to comment
Just now, King12 said:

ما أنتبهت لكلامك, تفضل:


GUIEditor = { label = {}, window = {}, edit = {}, staticimage = {} }

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.staticimage[1] = guiCreateStaticImage(0.22, -0.02, 0.55, 0.99, "images/news.png", true)
        guiSetVisible(GUIEditor.staticimage[1],false)
        GUIEditor.staticimage[2] = guiCreateStaticImage(0.17, 0.03, 0.67, 0.97, "images/hand.png", false, GUIEditor.staticimage[1])
        GUIEditor.edit[1] = guiCreateEdit(46, 36, 308, 22, "", false, GUIEditor.window[1])
    end
)



addEventHandler("onClientGUIClick", resourceRoot,
	function()
		if source == GUIEditor.staticimage[2] then
			setTimer(triggerServerEvent, tonumber(guiGetText(GUIEditor.edit[1])) or 100, 1, "send", resourceRoot)
		end
	end
)

-- server side
addEvent("send", true)
addEventHandler("send", resourceRoot,
  function ()
    -- blabla..
  end
)

 

WARNING: bomb/client:4: Bad usage @ 'setTimer' [Interval is below 50]

نفس المشكلة

Link to comment
1 minute ago, Wormen said:

WARNING: bomb/client:4: Bad usage @ 'setTimer' [Interval is below 50]

نفس المشكلة

GUIEditor = { label = {}, window = {}, edit = {}, staticimage = {} }

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.staticimage[1] = guiCreateStaticImage(0.22, -0.02, 0.55, 0.99, "images/news.png", true)
        guiSetVisible(GUIEditor.staticimage[1],false)
        GUIEditor.staticimage[2] = guiCreateStaticImage(0.17, 0.03, 0.67, 0.97, "images/hand.png", false, GUIEditor.staticimage[1])
        GUIEditor.edit[1] = guiCreateEdit(46, 36, 308, 22, "", false, GUIEditor.window[1])
    end
)



addEventHandler("onClientGUIClick", resourceRoot,
	function()
		if source == GUIEditor.staticimage[2] then
			setTimer(triggerServerEvent, 1000 * tonumber(guiGetText(GUIEditor.edit[1])) or 1, 1, "send", resourceRoot)
		end
	end
)

-- server side
addEvent("send", true)
addEventHandler("send", resourceRoot,
  function ()
    -- blabla..
  end
)

التايمر يبدأ من 50 جزء من الثانية وأنت تحط رقم 1, صححت الكود بحيث أنه لو حطيت رقم 1 راح يخليه ثانيه وكذا..

Edited by King12
Link to comment
Just now, King12 said:

GUIEditor = { label = {}, window = {}, edit = {}, staticimage = {} }

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.staticimage[1] = guiCreateStaticImage(0.22, -0.02, 0.55, 0.99, "images/news.png", true)
        guiSetVisible(GUIEditor.staticimage[1],false)
        GUIEditor.staticimage[2] = guiCreateStaticImage(0.17, 0.03, 0.67, 0.97, "images/hand.png", false, GUIEditor.staticimage[1])
        GUIEditor.edit[1] = guiCreateEdit(46, 36, 308, 22, "", false, GUIEditor.window[1])
    end
)



addEventHandler("onClientGUIClick", resourceRoot,
	function()
		if source == GUIEditor.staticimage[2] then
			setTimer(triggerServerEvent, 1000 * tonumber(guiGetText(GUIEditor.edit[1])) or 1000, 1, "send", resourceRoot)
		end
	end
)

-- server side
addEvent("send", true)
addEventHandler("send", resourceRoot,
  function ()
    -- blabla..
  end
)

التايمر يبدأ من 50 جزء من الثانية وأنت تحط رقم 1, صححت الكود بحيث أنه لو حطيت رقم 1 راح يخليه ثانيه وكذا..

هل ذا فيه أخطاء 
 

addEvent("send",true)
addEventHandler("send",getRootElement(),
function ()
    local x,y,z = getElementPosition ( source )
	createExplosion ( x,y,z,0 )
    createExplosion ( x,y,z,0 )
end)

لن أنا بحط رقم ما يصير شييء في الدي بق 
ولا يحصل أنفجار حتي

Link to comment
Just now, Wormen said:

هل ذا فيه أخطاء 
 


addEvent("send",true)
addEventHandler("send",getRootElement(),
function ()
    local x,y,z = getElementPosition ( source )
	createExplosion ( x,y,z,0 )
    createExplosion ( x,y,z,0 )
end)

لن أنا بحط رقم ما يصير شييء في الدي بق 
ولا يحصل أنفجار حتي

أنت ماعرفت ال source

من راح يكون عليه الانفجار؟

Link to comment
GUIEditor = { label = {}, window = {}, edit = {}, staticimage = {} }

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.staticimage[1] = guiCreateStaticImage(0.22, -0.02, 0.55, 0.99, "images/news.png", true)
        guiSetVisible(GUIEditor.staticimage[1],false)
        GUIEditor.staticimage[2] = guiCreateStaticImage(0.17, 0.03, 0.67, 0.97, "images/hand.png", false, GUIEditor.staticimage[1])
        GUIEditor.edit[1] = guiCreateEdit(46, 36, 308, 22, "", false, GUIEditor.window[1])
    end
)



addEventHandler("onClientGUIClick", resourceRoot,
	function()
		if source == GUIEditor.staticimage[2] then
			setTimer(triggerServerEvent, 1000 * tonumber(guiGetText(GUIEditor.edit[1])) or 1000, 1, "send", localPlayer)
		end
	end
)
addEvent("send",true)
addEventHandler("send",getRootElement(),
function ()
    local x,y,z = getElementPosition ( client )
	createExplosion ( x,y,z,0 )
    createExplosion ( x,y,z,0 )
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...