Jump to content

SetTimer


Recommended Posts

galera tem algum limite para usar o set timer ? pq eu n to conseguindo colocar tres vezes

eu quero fazer que depois que faça o primeiro settimer ele demore mais 30 segundos pra fechar o portão 

function comandohacker (source)
if isElementWithinMarker (source, hackear ) then
setElementPosition ( lojasair1, 834.66760, 7.45359, 1010)
setElementPosition ( hackear, 822.74316, -0.47490, 1010)
outputChatBox("#000000[#00FF00 Prisao System #000000] -#00FF7F Atenção todas as Unidades !!",root,255,255,255,true)
outputChatBox("#000000[#00FF00 Prisao System #000000] -#00FF7F O Hacker [#FF0000 " .. getPlayerName(source) .. " #00FF7F]#00FF7F está Invadindo o Prisao System de #00FF00Los Santos #00FF7F!!",root,255,255,255,true)
outputChatBox ('#FF0000- Fazendo upload do virus... Aguarde 30seg...',source,255,255,255,true)
setPedAnimation(source, "CASINO", "Slot_bet_01", 30000, true, false, false, false)
setPedRotation(source,270 )
setPedAnimation( ped, "SHOP", "SHP_Rob_HandsUp")
triggerClientEvent ( root, "roubar", root)
setElementVisibleTo ( blipalarme, root, true )
setTimer ( function()
outputChatBox ('#FF0000- Upload do Virus Finalizado com Sucesso... Portao Sera aberto!',source,255,255,255,true)
	moveObject(portaointer, 4000, -487.599609375,-514, 19.89999961853)
    moveObject(portaoexter, 4000, -487.60000610352,-524.29998779297,19.89999961853)
setElementPosition(dinheiro1,2192.26684, 1625.1552, 1000.8)
setElementPosition ( lojasair1, 2163.7546, 1618.1488, 1000.9724)
setElementInterior ( hackear, 1)
setPedAnimation(ped,false)
setElementPosition ( ped, 2186.8, 1619.1047, 999.97656)
pos = 0
	end, 30000, 1 )

setTimer ( function()
outputChatBox ('#FF0000- Portao Fechado!',source,255,255,255,true)
	moveObject(portaointer, 4000, -487.599609375,-514, 27.89999961853)
    moveObject(portaoexter, 4000, -487.599609375,-524.2998046875,27.89999961853)
	end, 30000, 1 )

setTimer ( function()
   setElementVisibleTo ( blipalarme, root, false )
   setElementPosition( hackear, 2194.3000488281, 1623.1999511719, 999.1)
outputChatBox("#000000[#00FF00 Prisao System #000000] -#00FF7F O Prisao System se recuperou do ultimo ataque Hacker",root,255,255,255,true)
	end, 1000000, 1 )

 end
end
addCommandHandler ( "hackear", comandohacker )











 

Edited by MRXBBC
Link to comment
  • Other Languages Moderators

Os dois primeiros timers estão executando ao mesmo tempo (30 segundos depois).

Coloque um dentro do outro, assim o timer vai iniciar só depois que o outro for executado.

  • Thanks 1
Link to comment
1 minute ago, Lord Henry said:

Os dois primeiros timers estão executando ao mesmo tempo (30 segundos depois).

Coloque um dentro do outro, assim o timer vai iniciar só depois que o outro for executado.

function comandohacker (source)
if isElementWithinMarker (source, hackear ) then
setElementPosition ( lojasair1, 834.66760, 7.45359, 1010)
setElementPosition ( hackear, 822.74316, -0.47490, 1010)
outputChatBox("#000000[#00FF00 Prisao System #000000] -#00FF7F Atenção todas as Unidades !!",root,255,255,255,true)
outputChatBox("#000000[#00FF00 Prisao System #000000] -#00FF7F O Hacker [#FF0000 " .. getPlayerName(source) .. " #00FF7F]#00FF7F está Invadindo o Prisao System de #00FF00Los Santos #00FF7F!!",root,255,255,255,true)
outputChatBox ('#FF0000- Fazendo upload do virus... Aguarde 30seg...',source,255,255,255,true)
setPedAnimation(source, "CASINO", "Slot_bet_01", 30000, true, false, false, false)
setPedRotation(source,270 )
setPedAnimation( ped, "SHOP", "SHP_Rob_HandsUp")
triggerClientEvent ( root, "roubar", root)
setElementVisibleTo ( blipalarme, root, true )
setTimer ( function()
outputChatBox ('#FF0000- Upload do Virus Finalizado com Sucesso... Portao Sera aberto!',source,255,255,255,true)
	moveObject(portaointer, 4000, -487.599609375,-514, 19.89999961853)
    moveObject(portaoexter, 4000, -487.60000610352,-524.29998779297,19.89999961853)
setElementPosition(dinheiro1,2192.26684, 1625.1552, 1000.8)
setElementPosition ( lojasair1, 2163.7546, 1618.1488, 1000.9724)
setElementInterior ( hackear, 1)
setPedAnimation(ped,false)
setElementPosition ( ped, 2186.8, 1619.1047, 999.97656)

setTimer ( function()
outputChatBox ('#FF0000- Portao Fechado!',source,255,255,255,true)
	moveObject(portaointer, 4000, -487.599609375,-514, 27.89999961853)
    moveObject(portaoexter, 4000, -487.599609375,-524.2998046875,27.89999961853)
	end, 30000, 1 )

	end, 30000, 1 )

desta forma?

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...