Jump to content

مساعدة في كود


Recommended Posts

 السلام عليكم ، أنا عندي مود للريسباون ، الي هو لما يموت الشخص على طول يطلع له الزر حق الريسباون ويسوي ريسباون ، بس أنا أريد انه الزر يظهر له ويكون مو شغال الا حتى تمر 90 ثانية علشان يشتغل ويقدر يكبس الزر،  يعني مو أول ما يموت يطلع له الزر شغال ويسوي ريسباون ، وشكرا لكم جميعا <3  ، فلو سمحتم زبطولي السكربت، هذا هو السكربت 

local bRespawn = nil
function showRespawnButton(victimDropItem)
    showCursor(true)
    local width, height = 201,54
    local scrWidth, scrHeight = guiGetScreenSize()
    local x = scrWidth/2 - (width/2)
    local y = scrHeight/1.1 - (height/2)
    bRespawn = guiCreateButton(x, y, width, height,"Respawn",false)
        guiSetFont(bRespawn,"sa-header")
    addEventHandler("onClientGUIClick", bRespawn, function () 
        if bRespawn then
            destroyElement(bRespawn)
            bRespawn = nil
            showCursor(false)
            guiSetInputEnabled(false)
        end
        triggerServerEvent("es-system:acceptDeath", getLocalPlayer(), getLocalPlayer(), victimDropItem)
        showCursor(false)
    end, false)
end
addEvent("es-system:showRespawnButton", true)
addEventHandler("es-system:showRespawnButton", getLocalPlayer(),showRespawnButton)


Edited by Stream
Link to comment
local bRespawn = nil
function showRespawnButton(victimDropItem)
	showCursor(true)
	local width, height = 201,54
	local scrWidth, scrHeight = guiGetScreenSize()
	local x = scrWidth/2 - (width/2)
	local y = scrHeight/1.1 - (height/2)
	bRespawn = guiCreateButton(x, y, width, height,"انتهى الوقت",false)
		guiSetFont(bRespawn,"sa-header")
	addEventHandler("onClientGUIClick", bRespawn, function () 
		if bRespawn then
			destroyElement(bRespawn)
			bRespawn = nil
			showCursor(false)
			guiSetInputEnabled(false)
		end
		triggerServerEvent("es-system:acceptDeath", getLocalPlayer(), getLocalPlayer(), victimDropItem)
		showCursor(false)
	end, false)
end
addEvent("es-system:showRespawnButton", true)
addEventHandler("es-system:showRespawnButton", getLocalPlayer(),showRespawnButton)

 

Link to comment
30 minutes ago, Stream said:

local bRespawn = nil
function showRespawnButton(victimDropItem)
	showCursor(true)
	local width, height = 201,54
	local scrWidth, scrHeight = guiGetScreenSize()
	local x = scrWidth/2 - (width/2)
	local y = scrHeight/1.1 - (height/2)
	bRespawn = guiCreateButton(x, y, width, height,"انتهى الوقت",false)
		guiSetFont(bRespawn,"sa-header")
	addEventHandler("onClientGUIClick", bRespawn, function () 
		if bRespawn then
			destroyElement(bRespawn)
			bRespawn = nil
			showCursor(false)
			guiSetInputEnabled(false)
		end
		triggerServerEvent("es-system:acceptDeath", getLocalPlayer(), getLocalPlayer(), victimDropItem)
		showCursor(false)
	end, false)
end
addEvent("es-system:showRespawnButton", true)
addEventHandler("es-system:showRespawnButton", getLocalPlayer(),showRespawnButton)

 

جرب

local bRespawn = nil
function showRespawnButton(victimDropItem)
	showCursor(true)
  	guiSetEnabled( bRespawn, false )
  	setTimer( function()
    guiSetEnabled( bRespawn, true )
    end, 90000, 1 )
	local width, height = 201,54
	local scrWidth, scrHeight = guiGetScreenSize()
	local x = scrWidth/2 - (width/2)
	local y = scrHeight/1.1 - (height/2)
	bRespawn = guiCreateButton(x, y, width, height,"انتهى الوقت",false)
		guiSetFont(bRespawn,"sa-header")
	addEventHandler("onClientGUIClick", bRespawn, function () 
		if bRespawn then
			destroyElement(bRespawn)
			bRespawn = nil
			showCursor(false)
			guiSetInputEnabled(false)
		end
		triggerServerEvent("es-system:acceptDeath", getLocalPlayer(), getLocalPlayer(), victimDropItem)
		showCursor(false)
	end, false)
end
addEvent("es-system:showRespawnButton", true)
addEventHandler("es-system:showRespawnButton", getLocalPlayer(),showRespawnButton)

 

Link to comment
2 hours ago, +Source|> said:

جرب


local bRespawn = nil
function showRespawnButton(victimDropItem)
	showCursor(true)
  	guiSetEnabled( bRespawn, false )
  	setTimer( function()
    guiSetEnabled( bRespawn, true )
    end, 90000, 1 )
	local width, height = 201,54
	local scrWidth, scrHeight = guiGetScreenSize()
	local x = scrWidth/2 - (width/2)
	local y = scrHeight/1.1 - (height/2)
	bRespawn = guiCreateButton(x, y, width, height,"انتهى الوقت",false)
		guiSetFont(bRespawn,"sa-header")
	addEventHandler("onClientGUIClick", bRespawn, function () 
		if bRespawn then
			destroyElement(bRespawn)
			bRespawn = nil
			showCursor(false)
			guiSetInputEnabled(false)
		end
		triggerServerEvent("es-system:acceptDeath", getLocalPlayer(), getLocalPlayer(), victimDropItem)
		showCursor(false)
	end, false)
end
addEvent("es-system:showRespawnButton", true)
addEventHandler("es-system:showRespawnButton", getLocalPlayer(),showRespawnButton)

 

-____________-

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