Ahmed Eka Posted September 23, 2016 Share Posted September 23, 2016 Hello .. I want a help how can I create a marker after 5 min destroy it if any one know please give me the code .. thanks .. Link to comment
Captain Cody Posted September 23, 2016 Share Posted September 23, 2016 createMarker setTimer destroyElement Link to comment
Ahmed Eka Posted September 23, 2016 Author Share Posted September 23, 2016 12 hours ago, CodyL said: createMarker setTimer destroyElement okey what's wrong ? local players = {} function TimerFunc(players) players[player] = 0 if getElementData(players[player],"NukePlayer") then outputChatBox("1") players[player] = players[player] + 1 outputChatBox(players[player]) if players[player] == 10 then setElementData(player,"NukePlayer",false) if isElement(marker [ player ]) then destroyElement(marker [ player ]) if isElement(object [ player ]) then destroyElement(object [ player ]) players[player] = 0 end end end end end setTimer(TimerFunc,1000,0) ?? Link to comment
Captain Cody Posted September 23, 2016 Share Posted September 23, 2016 Player is undefined local players = {} function TimerFunc() players[player] = 0 if getElementData(players[player],"NukePlayer") then outputChatBox("1") players[player] = players[player] + 1 outputChatBox(players[player]) end if players[player] == 10 then setElementData(player,"NukePlayer",false) if isElement(marker [ player ]) then destroyElement(marker [ player ]) end if isElement(object [ player ]) then destroyElement(object [ player ]) players[player] = 0 end end setTimer(TimerFunc,1000,0) Link to comment
Ahmed Eka Posted September 23, 2016 Author Share Posted September 23, 2016 12 hours ago, CodyL said: Player is undefined local players = {} function TimerFunc() players[player] = 0 if getElementData(players[player],"NukePlayer") then outputChatBox("1") players[player] = players[player] + 1 outputChatBox(players[player]) end if players[player] == 10 then setElementData(player,"NukePlayer",false) if isElement(marker [ player ]) then destroyElement(marker [ player ]) end if isElement(object [ player ]) then destroyElement(object [ player ]) players[player] = 0 end end setTimer(TimerFunc,1000,0) debug says the table is nil and the code isn't workin .. the marker and the object isn't hide ,, Link to comment
Gravestone Posted September 24, 2016 Share Posted September 24, 2016 Maybe add this? for i, player in ipairs(getElementsByType("player") do if getElementData(player, "NukePlayer") then -- code here end end Link to comment
!#NssoR_) Posted September 24, 2016 Share Posted September 24, 2016 10 hours ago, M[A]X said: debug says the table is nil and the code isn't workin .. the marker and the object isn't hide ,, it's normal that the debug would show you that error , because ' player ' undefined. and the script in client side? if yes , Nobody will see the marker you've created . Link to comment
Ahmed Eka Posted September 24, 2016 Author Share Posted September 24, 2016 1 hour ago, NssoR said: it's normal that the debug would show you that error , because ' player ' undefined. and the script in client side? if yes , Nobody will see the marker you've created . No It's server side. Link to comment
!#NssoR_) Posted September 24, 2016 Share Posted September 24, 2016 2 hours ago, NssoR said: it's normal that the debug would show you that error , because ' player ' undefined. and the script in client side? if yes , Nobody will see the marker you've created . Link to comment
Ahmed Eka Posted September 24, 2016 Author Share Posted September 24, 2016 12 hours ago, NssoR said: okey 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