#nofear Posted May 6, 2023 Posted May 6, 2023 ------- HK 417 ------- mermi = 500 id = 31 addEvent("m4al",true) addEventHandler("m4al",root,function() if getTickCount() - (tick[source] or 0) >= SECONDS * 864000 then giveWeapon(source,id,mermi) tick[source] = getTickCount() outputChatBox("[!]#ff3300 HK 417 Markalı Silahını Kuşandın.",source,0,255,0,true) else outputChatBox("[!]#ff3300 [1 Haftalık Stok] 4 Saat Sonra Tekrar Alabilirsin.",source,0,255,0,true) end end ) ------- SNIPER ------- mermi3 = 15 id3 = 34 addEvent("sniperal",true) addEventHandler("sniperal",root,function() if getTickCount() - (tick[source] or 0) >= SECONDS * 864000 then giveWeapon(source,id3,mermi3) tick[source] = getTickCount() outputChatBox("[!]#ff3300 Bora 12 Markalı Uzun Namlu'lu Silahını Kuşandın.",source,0,255,0,true) else outputChatBox("[!]#ff3300 [1 Haftalık Stok] 4 Saat Sonra Tekrar Alabilirsin.",source,0,255,0,true) end end ) Hi, I can only use one. When I try to use the other, the timer activates and prevents me from picking up the other weapon. I will be glad if you help
Shady1 Posted May 6, 2023 Posted May 6, 2023 41 minutes ago, #nofear said: ------- HK 417 ------- mermi = 500 id = 31 addEvent("m4al",true) addEventHandler("m4al",root,function() if getTickCount() - (tick[source] or 0) >= SECONDS * 864000 then giveWeapon(source,id,mermi) tick[source] = getTickCount() outputChatBox("[!]#ff3300 HK 417 Markalı Silahını Kuşandın.",source,0,255,0,true) else outputChatBox("[!]#ff3300 [1 Haftalık Stok] 4 Saat Sonra Tekrar Alabilirsin.",source,0,255,0,true) end end ) ------- SNIPER ------- mermi3 = 15 id3 = 34 addEvent("sniperal",true) addEventHandler("sniperal",root,function() if getTickCount() - (tick[source] or 0) >= SECONDS * 864000 then giveWeapon(source,id3,mermi3) tick[source] = getTickCount() outputChatBox("[!]#ff3300 Bora 12 Markalı Uzun Namlu'lu Silahını Kuşandın.",source,0,255,0,true) else outputChatBox("[!]#ff3300 [1 Haftalık Stok] 4 Saat Sonra Tekrar Alabilirsin.",source,0,255,0,true) end end ) Hi, I can only use one. When I try to use the other, the timer activates and prevents me from picking up the other weapon. I will be glad if you help I created a piece of code, I did not understand exactly what you want, I did not test it, can you check it and let me know if you want a problem or a different method. NOTE: Türk olduğunuzu anladım, eğer ingilizceniz yeterli değilse türkçede anlatabilirsiniz. ------- HK 417 ------- local mermi = 500 local id = 31 local hkTick = {} addEvent("m4al", true) addEventHandler("m4al", root, function() if getTickCount() - (hkTick[source] or 0) >= SECONDS * 864000 then giveWeapon(source, id, mermi) hkTick[source] = getTickCount() outputChatBox("[!]#ff3300 HK 417 Markalı Silahını Kuşandın.", source, 0, 255, 0, true) else outputChatBox("[!]#ff3300 [1 Haftalık Stok] 4 Saat Sonra Tekrar Alabilirsin.", source, 0, 255, 0, true) end end) ------- SNIPER ------- local mermi3 = 15 local id3 = 34 local sniperTick = {} addEvent("sniperal", true) addEventHandler("sniperal", root, function() if getTickCount() - (sniperTick[source] or 0) >= SECONDS * 864000 then giveWeapon(source, id3, mermi3) sniperTick[source] = getTickCount() outputChatBox("[!]#ff3300 Bora 12 Markalı Uzun Namlu'lu Silahını Kuşandın.", source, 0, 255, 0, true) else outputChatBox("[!]#ff3300 [1 Haftalık Stok] 4 Saat Sonra Tekrar Alabilirsin.", source, 0, 255, 0, true) end end)
#nofear Posted May 6, 2023 Author Posted May 6, 2023 @Shady1 Teşekkür ederim. Aslında yapmak istediğim klan baselerinde bir depo ve oraya silah koyabilmek fakat şimdilik böyle bir şey buldum ve sınırsız değilde kısıtlamak istedim attığın kod işe yaradı tekrar teşekkür ederim.
FLUSHBICEPS Posted May 6, 2023 Posted May 6, 2023 you are using the same table ‘tick’ to track the timer for both the HK 417 and SNIPER
Shady1 Posted May 6, 2023 Posted May 6, 2023 3 hours ago, #nofear said: @Shady1 Teşekkür ederim. Aslında yapmak istediğim klan baselerinde bir depo ve oraya silah koyabilmek fakat şimdilik böyle bir şey buldum ve sınırsız değilde kısıtlamak istedim attığın kod işe yaradı tekrar teşekkür ederim. you're welcome, have a nice day, rica ederim iyi günler dilerim, yorumumu beğenebilirmisiniz, eğer işe yaradıysa
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