Arsilex Posted January 20, 2013 Posted January 20, 2013 Why this not work --Server enter= 0 bindKey ( thePlayer, "enter", "down", function () unbindKey ( thePlayer, "enter", "down" ) enter = enter +1 triggerClientEvent ( thePlayer, "onEnterCount", getRootElement(), enter ) setElementPosition (thePlayer, 0,0,5) end) --CLient function getEnterCount(enter) if enter then return enter else return 55 end end addEvent( "onEnterCount", true ) addEventHandler( "onEnterCount", getRootElement(), getEnterCount) not put enter value put 55 why
mjau Posted January 20, 2013 Posted January 20, 2013 i dont get what u are trying to do but there is one clear error in your script which i will mention. "enter= 0" should be "enter = 0"
csiguusz Posted January 20, 2013 Posted January 20, 2013 thePlayer is not defined in your script. And I also don't know what is this supposed to do.
Arsilex Posted January 20, 2013 Author Posted January 20, 2013 thePlayer is not defined in your script.And I also don't know what is this supposed to do. is defined function hill_Enter ( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then if Hit == 0 then triggerClientEvent ( thePlayer, "onEnterZonaPed", thePlayer ) Hit = 1 bindKey ( thePlayer, "enter", "down", function () unbindKey ( thePlayer, "enter", "down" ) enter = enter +1 triggerClientEvent ( thePlayer, "onEnterCount", getRootElement(), enter ) setElementPosition (thePlayer, 0,0,5) bindKey ( thePlayer, "i", "down", function() setElementPosition (thePlayer, -702.09185791016, 965.79370117188, 12.384881973267) end ) end ) end end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter )
csiguusz Posted January 20, 2013 Posted January 20, 2013 Try this: function hill_Enter ( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then if Hit == 0 then triggerClientEvent ( thePlayer, "onEnterZonaPed", thePlayer ) Hit = 1 bindKey ( thePlayer, "enter", "down", function ( thePlayer ) unbindKey ( thePlayer, "enter", "down" ) enter = enter + 1 triggerClientEvent ( thePlayer, "onEnterCount", getRootElement(), enter ) setElementPosition (thePlayer, 0,0,5) bindKey ( thePlayer, "i", "down", function( thePlayer ) setElementPosition (thePlayer, -702.09185791016, 965.79370117188, 12.384881973267) end ) end ) end end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter )
Arsilex Posted January 20, 2013 Author Posted January 20, 2013 Try this: function hill_Enter ( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then if Hit == 0 then triggerClientEvent ( thePlayer, "onEnterZonaPed", thePlayer ) Hit = 1 bindKey ( thePlayer, "enter", "down", function ( thePlayer ) unbindKey ( thePlayer, "enter", "down" ) enter = enter + 1 triggerClientEvent ( thePlayer, "onEnterCount", getRootElement(), enter ) setElementPosition (thePlayer, 0,0,5) bindKey ( thePlayer, "i", "down", function( thePlayer ) setElementPosition (thePlayer, -702.09185791016, 965.79370117188, 12.384881973267) end ) end ) end end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) 55 Again
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