aim-killer Posted June 21, 2013 Share Posted June 21, 2013 I want the dxdraw to only show to the player who entered the marker not to all sx,sy = guiGetScreenSize() local marker = createMarker ( 0,0,2, "cylinder", 1, 0,255,255,155 ) function gui () dxDrawRectangle ((sx/2)-50,(sy/2)-50,100,100, tocolor (0,0,0,155), false) addEventHandler ( "onClientRender", getRootElement(), gui ) end addEventHandler ( "onClientMarkerHit", marker, gui ) Link to comment
iPrestege Posted June 21, 2013 Share Posted June 21, 2013 (edited) sx,sy = guiGetScreenSize() local marker = createMarker ( 0,0,2, "cylinder", 1, 0,255,255,155 ) function gui ( ) dxDrawRectangle ((sx/2)-50,(sy/2)-50,100,100, tocolor (0,0,0,155), false) end function aShowDx ( player ) if player == localPlayer then addEventHandler ( "onClientRender", getRootElement(), gui ) end end addEventHandler ( "onClientMarkerHit", marker, aShowDx,false ) function aDestroyDx ( player ) if player == localPlayer then removeEventHandler ( "onClientRender", getRootElement(), gui ) end end addEventHandler ( "onClientMarkerLeave", marker, aDestroyDx,false ) Not tested. Edited June 21, 2013 by Guest Link to comment
aim-killer Posted June 21, 2013 Author Share Posted June 21, 2013 (edited) thanks it works now EDIT: there was a mistake in your script, heres the working one: sx,sy = guiGetScreenSize() local marker = createMarker ( 0,0,2, "cylinder", 1, 0,255,255,155 ) function gui ( ) dxDrawRectangle ((sx/2)-50,(sy/2)-50,100,100, tocolor (0,0,0,155), false) end function aShowDx ( player ) if player == localPlayer then addEventHandler ( "onClientRender", getRootElement(), gui ) end end addEventHandler ( "onClientMarkerHit", marker, aShowDx,false ) function aDestroyDx ( player ) if player == localPlayer then removeEventHandler ( "onClientRender", getRootElement(), gui ) end end addEventHandler ( "onClientMarkerLeave", marker, aDestroyDx,false ) Edited June 21, 2013 by Guest Link to comment
iPrestege Posted June 21, 2013 Share Posted June 21, 2013 (edited) Copy it again i forget something. Edited June 21, 2013 by Guest 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