Ahmed Eka Posted September 24, 2016 Share Posted September 24, 2016 Hello Guys, I made a mode but I can't complete it I don't know where is the bug .. addEvent("setNukes",true) local img = dxCreateTexture("nucklear.png"); dxSetTextureEdge(img,"mirror"); function setNuke() x, y, z = getElementPosition(marker[localPlayer]) radius = 3; for i = 1, 1 do x = x + math.cos(math.rad((1/1)-i))*radius; y = y + math.sin(math.rad((1/1)-i))*radius; xr = x + math.cos(math.rad((1/1)-(i)))*radius; yr = y + math.sin(math.rad((1/1)-(i)))*radius; dxDrawMaterialLine3D(x, y, z-2, xr, yr, z+150, img, 250) end end addEventHandler("onClientRender", getRootElement(), setNuke ) addEventHandler( "setNukes", getRootElement(), setNuke ) addCommandHandler ( "nuke", function ( player ) local x,y,z = getElementPosition ( player ) setElementData(player,"NukePlayer",true) setElementAlpha( marker [ player ], 0 ) triggerClientEvent(root, "startAlarmnuke", root) triggerClientEvent(root, "setNukes", root) end ) when I write "nuke" the photo come to my position when any player write the command the photo disappeared from me .. I don't Know Why .. What Can i do ? Help Please .. Thanks All Link to comment
!#NssoR_) Posted September 24, 2016 Share Posted September 24, 2016 Server Side , Change the line number 8 to : triggerClientEvent(root, "setNukes", player) Untested Link to comment
Ahmed Eka Posted September 24, 2016 Author Share Posted September 24, 2016 14 hours ago, NssoR said: Server Side , Change the line number 8 to : triggerClientEvent(root, "setNukes", player) Untested Okey , Thanks I'll Test it now I set TImer for It 10 Seconds When 10 sec End the photo disappeared from the player who wrote the command not all players .. what is the problem ? Link to comment
!#NssoR_) Posted September 24, 2016 Share Posted September 24, 2016 I can't say anything as long as you didn't show me your code. Link to comment
Ahmed Eka Posted September 24, 2016 Author Share Posted September 24, 2016 12 hours ago, NssoR said: I can't say anything as long as you didn't show me your code. local TimerOfPlayer = 0 function setTimerForPlayer() if getElementData(localPlayer,"NukePlayer") then TimerOfPlayer = TimerOfPlayer + 1 outputChatBox(TimerOfPlayer) if TimerOfPlayer == 10 then TimerOfPlayer = 0 removeEventHandler("onClientRender", getRootElement(), setNuke ) removeEventHandler( "setNukes", getRootElement(), setNuke ) setElementData(localPlayer,"NukePlayer",false) end end end setTimer(setTimerForPlayer,1000,0) Here You are .. The Event of the Photo is ( "onClientRender" , "setNukes" ) when player write command set his data ( "NukePlayer" ) Link to comment
Gravestone Posted September 24, 2016 Share Posted September 24, 2016 1 hour ago, M[A]X said: now I set TImer for It 10 Seconds When 10 sec End the photo disappeared from the player who wrote the command not all players .. what is the problem ? Is the timer supposed to be for everyone or does it trigger for every player? Link to comment
Ahmed Eka Posted September 24, 2016 Author Share Posted September 24, 2016 (edited) 5 hours ago, Gravestone said: Is the timer supposed to be for everyone or does it trigger for every player? Nor for a player who wrote the command.. If 2 players wrote it every one from him has a timer for he Edited September 24, 2016 by M[A]X 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