TorNix~|nR Posted November 12, 2017 Posted November 12, 2017 Hello guys, I want to make a timer for this like the player can not use it, only after 30 seconds, help please! marker = createMarker(1.00, 1.00, 1.00, "cylinder", 0, 0, 0, 0, 0) function teleport(player) local x, y, z = getElementPosition(player) local rotZ = getElementRotation ( player ) local aa = {} if (source == marker and getElementType(player) == "player") then setElementPosition(player, 1.00, 1.00, 1.00) setElementFrozen(player, false) setTimer(setElementFrozen, 1000, 1, player, false) end end addEventHandler("onMarkerHit", root, teleport) ZI ZOMBIE INFECTION: mtasa://5.196.7.163:22003
MaurO^ Posted November 13, 2017 Posted November 13, 2017 htt 9 hours ago, TorNix~|nR said: Hello guys, I want to make a timer for this like the player can not use it, only after 30 seconds, help please! marker = createMarker(1.00, 1.00, 1.00, "cylinder", 0, 0, 0, 0, 0) function teleport(player) local x, y, z = getElementPosition(player) local rotZ = getElementRotation ( player ) local aa = {} if (source == marker and getElementType(player) == "player") then setElementPosition(player, 1.00, 1.00, 1.00) setElementFrozen(player, false) setTimer(setElementFrozen, 1000, 1, player, false) end end addEventHandler("onMarkerHit", root, teleport) marker = createMarker(1.00, 1.00, 1.00, "cylinder", 0, 0, 0, 0, 0) time = 0 function teleport(player) local x, y, z = getElementPosition(player) local rotZ = getElementRotation ( player ) local aa = {} if getTickCount() - time >= 30000 then -- 30 seg if (source == marker and getElementType(player) == "player") then setElementPosition(player, 1.00, 1.00, 1.00) setElementFrozen(player, false) setTimer(setElementFrozen, 1000, 1, player, false) time = getTickCount() end else outputChatBox("You must wait 30 seconds to use this.", player, 255, 0, 0) end end addEventHandler("onMarkerHit", root, teleport) 1
TorNix~|nR Posted November 18, 2017 Author Posted November 18, 2017 @Xero~, thanks it's working But when a player leave the base, and wait for 30 seconds, all the players must wait 30 seconds too, how to make it only for the player? ZI ZOMBIE INFECTION: mtasa://5.196.7.163:22003
Mr.Loki Posted November 19, 2017 Posted November 19, 2017 (edited) Store the timer in a table for each player for example Table[player]= Timer(function ()end,3000,1) And to check you simply do if isTimer(Table[player]) then Output you deny message else Let them in end Edited November 19, 2017 by Mr.Loki I'm on mobile sorry ? 1 [REL]Cinema Experience Beta 2.0 [TUT]Object offsets with OOP. [TUT] Adding a Discord bot to your server. Discord: Loki#7355
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