Mr.Mostafa Posted July 27, 2019 Posted July 27, 2019 سلام عليكم وش الخطا في الكود هادا يكتب لا تكرر والاعب يموت بعد ما يسوي cancelEvent local tapleMrat = {} addEventHandler("onPlayerCommand",root, function(command) local num = tapleMrat[source] or 0 if (command == "kill") then if tapleMrat[source] then cancelEvent() outputChatBox("لا تكرر",source,255,0,0,true) end tapleMrat[source] = true plr = source setTimer(function() tapleMrat[plr] = nil end,8000,1,plr) end end)
nxFairlywell Posted July 27, 2019 Posted July 27, 2019 1 hour ago, Mr.Mostafa said: سلام عليكم وش الخطا في الكود هادا يكتب لا تكرر والاعب يموت بعد ما يسوي cancelEvent local tapleMrat = {} addEventHandler("onPlayerCommand",root, function(command) local num = tapleMrat[source] or 0 if (command == "kill") then if tapleMrat[source] then cancelEvent() outputChatBox("لا تكرر",source,255,0,0,true) end tapleMrat[source] = true plr = source setTimer(function() tapleMrat[plr] = nil end,8000,1,plr) end end) مافيه خطأ , الكود كذا شغلته , انت وش الفكره اللي تبغى توصل لها ؟
Mr.Mostafa Posted July 27, 2019 Author Posted July 27, 2019 (edited) 4 hours ago, NX_CI said: مافيه خطأ , الكود كذا شغلته , انت وش الفكره اللي تبغى توصل لها ؟ 5 hours ago, Mr.Mostafa said: يكتب لا تكرر والاعب يموت بعد ما يسوي cancelEvent ابيه ما يموت Edited July 27, 2019 by Mr.Mostafa
SycroX Posted July 28, 2019 Posted July 28, 2019 local SpamTime = 5000 local SpamTimer = { } local Commands = { [ "kill" ] = true, } addEventHandler ( "onPlayerCommand" , root , function ( Command ) if Commands [ Command ] then if not SpamTimer [ source ] then SpamTimer [ source ] = { } end if SpamTimer [ source ] [ Command ] and isTimer ( SpamTimer [ source ] [ Command ] ) then outputChatBox ( " Please stop spaming " , source , 255 , 0 , 0 , true ) cancelEvent ( ) return end SpamTimer [ source ] [ Command ] = setTimer ( function ( source ) SpamTimer [ source ] [ Command ] = false end , SpamTime , 1 , source ) end end ) not tested
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