Machine Posted August 11, 2012 Share Posted August 11, 2012 is there any function to set player frozen but still can shoot and sniper around him self Link to comment
Castillo Posted August 11, 2012 Share Posted August 11, 2012 setElementFrozen It won't disable controls, just freeze him. Link to comment
Machine Posted August 11, 2012 Author Share Posted August 11, 2012 whats wrong in this code local marker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) addEventHandler("onClientMarkerHit",root, function(h) if h == localPlayer and source == marker then addEventHandler("onClientRender",root,drawText) setElementFrozen ( player, true ) end end ) function drawText() dxDrawText("Prees F To Exit!",423.0,601.0,623.0,637.0,tocolor(255,255,255,255),2.0,"clear","left","top",false,false,false) end addEventHandler("onClientMarkerLeave",root, function(h) if h == localPlayer and source == marker then removeEventHandler("onClientRender", root,drawText) setElementFrozen ( player, false ) end end ) Link to comment
Guest Guest4401 Posted August 11, 2012 Share Posted August 11, 2012 local marker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) addEventHandler("onClientMarkerHit",root, function(h) if h == localPlayer and source == marker then addEventHandler("onClientRender",root,drawText) setElementFrozen ( h, true ) end end ) function drawText() dxDrawText("Prees F To Exit!",423.0,601.0,623.0,637.0,tocolor(255,255,255,255),2.0,"clear","left","top",false,false,false) end addEventHandler("onClientMarkerLeave",root, function(h) if h == localPlayer and source == marker then removeEventHandler("onClientRender", root,drawText) setElementFrozen ( h, false ) end end ) Link to comment
Machine Posted August 11, 2012 Author Share Posted August 11, 2012 local marker = createMarker(-2596.625, 579.358, 14, 'cylinder', 2.0, 255, 0, 0, 150) addEventHandler("onClientMarkerHit",root, function(h) if h == localPlayer and source == marker then addEventHandler("onClientRender",root,drawText) setElementFrozen ( h, true ) end end ) function drawText() dxDrawText("Prees F To Exit!",423.0,601.0,623.0,637.0,tocolor(255,255,255,255),2.0,"clear","left","top",false,false,false) end addEventHandler("onClientMarkerLeave",root, function(h) if h == localPlayer and source == marker then removeEventHandler("onClientRender", root,drawText) setElementFrozen ( h, false ) bindKey ( "f", "down", h ) end end ) i just added bindkey so when you prees f quit from marker so forzen must be false and text disapear but didnt work Link to comment
GTX Posted August 11, 2012 Share Posted August 11, 2012 You're now binding key to a non-existing function/command "h". I just don't get you, what are you trying to do? EDIT: That maybe? local marker = createMarker(-2596.625, 579.358, 14, 'cylinder', 2.0, 255, 0, 0, 150) addEventHandler("onClientMarkerHit",root, function(h) if h == localPlayer and source == marker then addEventHandler("onClientRender",root,drawText) setElementFrozen ( h, true ) end end ) function drawText() dxDrawText("Prees F To Exit!",423.0,601.0,623.0,637.0,tocolor(255,255,255,255),2.0,"clear","left","top",false,false,false) end function h() removeEventHandler("onClientRender", root,drawText) setElementFrozen ( localPlayer, false ) end bindKey ( "f", "down", h ) Link to comment
Machine Posted August 11, 2012 Author Share Posted August 11, 2012 its exactly what i want but is it possible to make player get gun when he hit marker and when he out from it(preesed f) hes gun taken i think i must use giveWeapon ( thePlayer, 31, 200 ) takeWeapon ( thePlayer, 31, 5 ) but i tired didnt work! Link to comment
TAPL Posted August 11, 2012 Share Posted August 11, 2012 its exactly what i want but is it possible to make player get gun when he hit marker and when he out from it(preesed f) hes gun takeni think i must use giveWeapon ( thePlayer, 31, 200 ) takeWeapon ( thePlayer, 31, 5 ) but i tired didnt work! i guess you use it client side, and these functions is server side. Link to comment
Machine Posted August 11, 2012 Author Share Posted August 11, 2012 but i really need it is there any server side? or i must trigger to client event Link to comment
Machine Posted August 11, 2012 Author Share Posted August 11, 2012 so how can i make it its impossible right? Link to comment
Dev Posted August 12, 2012 Share Posted August 12, 2012 Nope, like you said, trigger a server side event from client side to use the giveWeapon and takeWeapon functions. 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