Jump to content

Play gamemode


monamour

Recommended Posts

Posted

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?

Posted
22 minutes ago, NeXuS™ said:

bindKey has different arguments. Check the wiki page.

i've already read them but still confused which arguments should i use , can you please correct the bindkey line for me?

Posted

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

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