imCEASER Posted December 13, 2014 Share Posted December 13, 2014 Hello, for starters I have used the search, but found nothing to help me. I wanted to make a counter with 7 pictures, I made a code, but not worked. I wanted all the server saw the images Link to comment
myonlake Posted December 13, 2014 Share Posted December 13, 2014 Please post your code so we can have a look at it. And if any errors, write them up here as well. Link to comment
imCEASER Posted December 14, 2014 Author Share Posted December 14, 2014 Sorry, I forgot to put the code function Contar ( source ) guiSetVisible ( imgcontador, true ) imgcontador = guiCreateStaticImage( 305, 119, 110, 190, "imagens/contador1/1.png", false ) setTimer ( Contar1, 1000, 1 ) end function Contar1 ( source ) guiSetVisible ( imgcontador, true ) imgcontador = guiCreateStaticImage( 305, 119, 110, 190, "imagens/contador1/2.png", false ) setTimer ( Contar2, 1000, 1 ) end function Contar2 ( source ) guiSetVisible ( imgcontador, true ) imgcontador = guiCreateStaticImage( 305, 119, 110, 190, "imagens/contador1/3.png", false ) setTimer ( Contar3, 1000, 1 ) end function Contar3 ( source ) guiSetVisible ( imgcontador, true ) imgcontador = guiCreateStaticImage( 305, 119, 110, 190, "imagens/contador1/4.png", false ) setTimer ( Contar4, 1000, 1 ) end function Contar4 ( source ) guiSetVisible ( imgcontador, true ) imgcontador = guiCreateStaticImage( 305, 119, 110, 190, "imagens/contador1/5.png", false ) setTimer ( Contar5, 1000, 1 ) end function Contar5 ( source ) guiSetVisible ( imgcontador, true ) imgcontador = guiCreateStaticImage( 305, 119, 110, 190, "imagens/contador1/6.png", false ) setTimer ( Contar6, 1000, 1 ) end function Contar6 ( source ) guiSetVisible ( imgcontador, true ) imgcontador = guiCreateStaticImage( 305, 119, 110, 190, "imagens/contador1/7.png", false ) setTimer ( FimContador, 1000, 1 ) end function FimContador ( source ) guiSetVisible ( imgcontador, false ) end addCommandHandler ( "contar1", Contar ) Link to comment
LabiVila Posted December 14, 2014 Share Posted December 14, 2014 You got to write it server-side first, because guiCreateStaticImage isn't server-sided. Then you can edit how they appear client-side Link to comment
manawydan Posted December 16, 2014 Share Posted December 16, 2014 try this: client local startTick = nil local timeToEachCounter = 1000 local imageNumbers = 7 local imageCurrent = 0 function draw() local now = getTickCount() if(now - startTick >= timeToEachCounter)then startTick = now if(imageCurrent == imageNumbers)then removeEventHandler("onClientRender",root,draw) else imageCurrent = imageCurrent +1 end end dxDrawImage(305, 119, 110, 190,"imagens/contador1/"..imageCurrent..".png") end addEvent("onStartCounter",true) addEventHandler("onStartCounter",root, function() startTick = getTickCount() imageCurrent = 0 addEventHandler("onClientRender",root,draw) end) server -- server addCommandHandler("contar1", function(p) triggerClientEvent("onStartCounter",p) end) Link to comment
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