verdao Posted August 26, 2013 Posted August 26, 2013 Gostaria de Saber Como Coloca tempo para usar 1 comando ja procurei na net nao achei o comando se passar o comando ja fico agradecido se puder editar fico mais agradecido ainda comessei a mecher com lua hj estou aprendendo function kitarmas ( source ) accountname = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup("user." .. accountname, aclGetGroup("VIP")) then giveWeapon(source, 24, 50, true) giveWeapon(source, 27, 50, true) giveWeapon(source, 30, 30, true) giveWeapon(source, 31, 30, true) giveWeapon(source, 34, 5, true) outputChatBox("#00ff00[KitVIP]: Você pegou o Kit VIP", source, 255, 255, 255, true) outputChatBox("#00f5ff[KitVIP]:#ffffff O jogador #00ff00 "..getPlayerName(source).." #ffffff Acaba de pegar o KITVIP , Seja você tambem VIP por Apenas 10 Reais Mensais", getRootElement(source), 255, 255, 255, true) end end addCommandHandler("kitvip", kitarmas)
DNL291 Posted August 27, 2013 Posted August 27, 2013 Tente isto: local allowKitarmas = {} local tempo = 120000 function kitarmas ( source ) if (allowKitarmas[source] == false) then return end local accountname = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup("user." .. accountname, aclGetGroup("VIP")) then giveWeapon(source, 24, 50, true) giveWeapon(source, 27, 50, true) giveWeapon(source, 30, 30, true) giveWeapon(source, 31, 30, true) giveWeapon(source, 34, 5, true) outputChatBox("#00ff00[KitVIP]: Você pegou o Kit VIP", source, 255, 255, 255, true) outputChatBox("#00f5ff[KitVIP]:#ffffff O jogador #00ff00 "..getPlayerName(source).." #ffffff Acaba de pegar o KITVIP , Seja você tambem VIP por Apenas 10 Reais Mensais", root, 255, 255, 255, true) allowKitarmas[source] = false setTimer( function() allowKitarmas[source] = true end, tempo, 1 ) end end addCommandHandler("kitvip", kitarmas) addEventHandler("onPlayerQuit", root function() if allowKitarmas[source] then allowKitarmas[source] = nil end end) O tempo para o jogador usar esse comando está definido na variável tempo (é em milisegundos).
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