Jump to content

Help


Ahmed Eka

Recommended Posts

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
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...