Jump to content

[AYUDA] Establecer un SetTime en un comando


P4rano1a

Recommended Posts

Hola gente, soy novato en el mundo del script y no entiendo mucho,  necesito ayuda con para establecer un setTime, quisiera que este comando se pueda utilizar cada 5 minutos, se los agradecería de corazón si puedan coperarme

function getPiezasContrabandistas (player)
	if not exports.factions:isPlayerInFaction(player, 9) then outputChatBox("No eres Contrabandista.", player, 255, 0, 0) return end
	if getElementDimension(player) ~= 97 then outputChatBox("No estás en el desarme.", player, 255, 0, 0) return end
	exports.items:give(player, 34, 20)
	exports.chat:me(player, "toma una caja con piezas.")
	outputChatBox("recibiste 20 piezas", player, 0, 255, 0)
end
addCommandHandler("piezas", getPiezasContrabandistas)
Link to comment

hola amigo @P4rano1a, publiqué un enlace para setTimer, puede consultar este sitio para comprender su problema.

function getPiezasContrabandistas (player)
    if isTimer(timer) then
            outputChatBox("Ya lo has usado una vez.", player, 255, 0, 0)
        return
     end
    if not exports.factions:isPlayerInFaction(player, 9) then outputChatBox("No eres Contrabandista.", player, 255, 0, 0) return end
    if getElementDimension(player) ~= 97 then outputChatBox("No estás en el desarme.", player, 255, 0, 0) return end
    exports.items:give(player, 34, 20)
    timer = setTimer(function() killTimer(timer) end, 300000, 1)
    exports.chat:me(player, "toma una caja con piezas.")
    outputChatBox("recibiste 20 piezas", player, 0, 255, 0)
end
addCommandHandler("piezas", getPiezasContrabandistas)




 

Edited by Shady1
  • Thanks 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...