Jump to content

Play gamemode


monamour

Recommended Posts

hello everybody,

am trying to edit the [play] gamemode to force the players to press "R" for example to spawn after they wasted.

what should i do here:

addEventHandler("onPlayerWasted", root,
    function()
        setTimer(spawn, 1800, 1, source)
    end
)

i understand that i should replace setTimer with   bindkey(spawn , "R", "source" ) bit it still doesnt work.

can anybody help me please?

Link to comment

Not tested, if you get any errors. just reply.

function respawnHandler(keyPresser)
	spawn(keyPresser)
	unbindKey(keyPresser, "r", "down", respawnHandler) 
end

addEventHandler("onPlayerWasted", root,
	function()
		bindKey(source, "r", "down", respawnHandler)
	end
)

 

  • Thanks 1
Link to comment
33 minutes ago, NeXuS™ said:

Not tested, if you get any errors. just reply.


function respawnHandler(keyPresser)
	spawn(keyPresser)
	unbindKey(keyPresser, "r", "down", respawnHandler) 
end

addEventHandler("onPlayerWasted", root,
	function()
		bindKey(source, "r", "down", respawnHandler)
	end
)

 

it's works perfectly!! @NeXuS™

Thank you so much for the help you gave me in this script. I greatly appreciate the assistance you have provided me.

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