Tete omar Posted July 23, 2012 Share Posted July 23, 2012 Hello guys i got a problem here , setTimer( bindKey, 5000, 1, source, "F", "down", herewego ) i want to set timer for bindKey , but it doesn't work debugscript : nothing Link to comment
AMARANT Posted July 23, 2012 Share Posted July 23, 2012 Have you put in function "herewego" debug-message? What did it say? Make sure that in client-side version of this function you shouldn't set 'player' argument. Link to comment
Tete omar Posted July 23, 2012 Author Share Posted July 23, 2012 full code function setCameraOnPlayerJoin() fadeCamera(source, true, 1); setCameraMatrix(source, -2135.708984375, -187.71142578125, 157.66786193848, 0, 0, 0); setTimer( bindKey, 5000, 1, source, "F", "down", herewego ) end addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin); function herewego ( thePlayer ) gX, gY, gZ = getElementPosition ( thePlayer ) setCameraTarget ( thePlayer ) setElementPosition ( thePlayer, 2450.7463378906, -1659.6678466797, 13.3046875 ) fadeCamera(source, true, 1); setElementFrozen ( thePlayer, false ) unbindKey( thePlayer, "F", "down", herewego ) end Link to comment
Tete omar Posted July 23, 2012 Author Share Posted July 23, 2012 debug-message? What did it say? debugscript : nothing Link to comment
AMARANT Posted July 23, 2012 Share Posted July 23, 2012 debugscript is not the same thing as debug message. Debug message is just "outputChatBox" function. Try this code: function setCameraOnPlayerJoin() fadeCamera(source, true, 1); setCameraMatrix(source, -2135.708984375, -187.71142578125, 157.66786193848, 0, 0, 0); setTimer( bindKey, 5000, 1, source, "f", "down", herewego, source ) end addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin); function herewego ( thePlayer ) gX, gY, gZ = getElementPosition ( thePlayer ) setCameraTarget ( thePlayer ) setElementPosition ( thePlayer, 2450.7463378906, -1659.6678466797, 13.3046875 ) fadeCamera(source, true, 1); setElementFrozen ( thePlayer, false ) unbindKey( thePlayer, "f", "down", herewego ) end Link to comment
Tete omar Posted July 23, 2012 Author Share Posted July 23, 2012 still doesn't work ... Link to comment
TAPL Posted July 23, 2012 Share Posted July 23, 2012 function setCameraOnPlayerJoin() fadeCamera(source, true, 1) setCameraMatrix(source, -2135.708984375, -187.71142578125, 157.66786193848, 0, 0, 0) setTimer(function(player) bindKey(player, "F", "down", herewego) end,5000,1,source) end addEventHandler("onPlayerJoin", root, setCameraOnPlayerJoin) function herewego(player) local gX, gY, gZ = getElementPosition(player) -- you need this? setCameraTarget(player) setElementPosition(player, 2450.7463378906, -1659.6678466797, 13.3046875) fadeCamera(player, true, 1) setElementFrozen(player, false) unbindKey(player, "F", "down", herewego) end Link to comment
Jaysds1 Posted July 23, 2012 Share Posted July 23, 2012 For some reason when you add any functions to the setTimer which includes a handlingfunction it says that's it's not added, anyways, try this: http://pastebin.com/S6yf2iak Link to comment
Tete omar Posted July 23, 2012 Author Share Posted July 23, 2012 (edited) @TAPL i can spawn my self using F whenever i want, not after 5 sec @jaysds i can't press F anymore lol and thanks for the both of you Edited July 23, 2012 by Guest Link to comment
TAPL Posted July 23, 2012 Share Posted July 23, 2012 For some reason when you add any functions to the setTimer which includes a handlingfunction it says that's it's not added,anyways, try this: http://pastebin.com/S6yf2iak i already post the solution, but still your won't work setTimer(function() bindKey(source, "f", "down", herewego ) end,5000, 1) should be setTimer(function(player) bindKey(player, "f", "down", herewego ) end,5000, 1,source) Link to comment
Jaysds1 Posted July 23, 2012 Share Posted July 23, 2012 sorry, try this now: http://pastebin.com/sCf8hU33 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now