Jump to content

DarkLink

Members
  • Posts

    610
  • Joined

  • Last visited

Everything posted by DarkLink

  1. Thanks . Bro I did what u recommend, and I guess this DxDrawText is bugged When I put this : outputChatBox("okay working") at here function hideDX () outputChatBox("okay working", getRootElement()) removeEventHandler ( "onClientRender", getRootElement(), drawDX) end addEvent ( "hideDX ", true ) addEventHandler ( "hideDX ", getRootElement(), hideDX ) I dont even can see the timer starting.. from 30 to 0.. I restart gamemode, I restart server.. I restart gta.. Nothing.. Can someone tell me the problems of this event? onClientRender? Thanks!
  2. Thanks for ur reply I though that too, but It will cause some lag I thing. because the event will always triggered.. onClientRender, causing some lags ? Thanks!! EDIT: It should work removeEventHandler, and I dont know why is not working
  3. I tryed that too when u told me, cos it wasnt making sense to me. But also didnt worked.. Any clue? The zero keeps there in the monitor.. :c
  4. Thanks for ur reply, but still not working. And I dont get it, why u do this if segundos >= 0 then triggerClientEvent ( "hideDX", getRootElement() ) timerEnabled = false end So would hide it before reach zero. the condition on IF is >= 0 . So why? Thanks, and sorry about ur time .
  5. Thanks alot solid Its working with the two options, in the second option just had to change from .. if getPlayerCount ( ) >= 2 then escreve() end end .. to .. if getPlayerCount ( ) >= 2 then setTimer(escreve, 50,1) end end .. but there is only a little problem, the removeEventHandler is not working segundos will reach 0 but it doesnt trigger the event hideDX, I guess.. and dont know why the zero keeps there on the screen.. Thanks bro
  6. Thanks SolidSnake, it does the job I guess, didnt tryed yet. But in this case I had to write that command every time I want to run this gamemode. Is there a way to start it write after 2 players online ? Thanks.
  7. Hey CowTurbo I have been working on these but isnt working.. Your solution, doesnt work too CowTurbo. I made it showing numbers from 30 to ( - infinite ), but the numbers are going to fast, not in each second . So I made the corrections to ur code: CLIENT function showDX (segundos) sec = segundos addEventHandler ( "onClientRender", getRootElement(), drawDX ) end addEvent ( "showDX", true ) addEventHandler ( "showDX", getRootElement(), showDX ) function drawDX () X,Y = guiGetScreenSize () X = X * (2.5/3) Y = Y * (1/4) dxDrawText ( sec, X, Y, X, Y, tocolor(255, 255, 255, 255), 5) end function hideDX () removeEventHandler ( "onClientRender", getRootElement(), drawDX ) end addEvent ( "hideDX ", true ) addEventHandler ( "hideDX ", getRootElement(), hideDX ) SERVER segundos = "30" function onJoin () if not( timerValue == true )then timerValue = true getTimerValue () end end addEventHandler ( "onPlayerJoin", getRootElement(), onJoin ) function getTimerValue () if ( timerValue == true ) then setTimer(escreve, 1000, 30) setTimer ( setValue, 30000,1 ) elseif (timerValue == false) then triggerClientEvent ( getRootElement(), "hideDX", getRootElement() ) end end function escreve () triggerClientEvent ( getRootElement(), "showDX", getRootElement(), segundos ) newnumber = (tonumber(segundos)-1) segundos = tostring(newnumber) --triggerClientEvent ( getRootElement(), "hideDX", getRootElement(), segundos ) end function setValue () timerValue = false getTimerValue () end function onStart () timerValue = false setTimer ( getTimerValue, 50,0) end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onStart ) This is the hardest things of MTA Scripting that I cant understand much. Handlers, Events, and Sync beetween client and server functions. So I would appreciate some help from pros Thanks alot guys ! I really want to know how to this , I want to learn it. Thanks
  8. Thanks for ur reply, but where is the segundos decreasing ? I mean the segundos-- ? so will go drawing 30, then 29 .. to 0 ? ty again
  9. Hi guys, I want to put a timer using dxDrawText. I could do it, when I was using for client.. But there would be a timer different for each player that connects server, and thats not what I need I need a timer to be set by server when first player log in, then wait 30 secs . ( this timer would appear on that client 30..29..28...) And if another player would log in while the timer was decreasing, his timer (another player), would also continue decreasing, not starting from 30 again. U guys can understand? If dxDrawText worked via server side, would work .. but no My friend told me to use triggerClientEvent and setTimer, communicating server with client . So I managed to do this, but I dont understand much the addEvent and his trigger, if u guys could give me some hints server: local sec = "30" function onPlayerJoinBind () bindKey ( source, "l", "down", VehicleLights ) setTimer(triggerClientEvent, 1000, 30, "mostrarSegundos", root, sec) end addEventHandler ( "onPlayerJoin", getRootElement(), onPlayerJoinBind ) client: function createText() if (tonumber(segundos)==0) then return end X,Y = guiGetScreenSize () X = X * (2.5/3) Y = Y * (1/4) dxDrawText ( segundos, X, Y, X, Y, tocolor(255, 255, 255, 255), 5) end addEvent( "mostrarSegundos", true ) addEventHandler( "mostrarSegundos", getRootElement(), mostrarSegundos ) function mostrarSegundos (sec) segundos = sec addEventHandler("onClientRender",rootElement, createText) end btw I know I have to decrease the sec to print it on dxDrawText, but I dont know where Thanks guys, and sorry for asking
  10. I want a GUI like and there will be the timer. Numbers changing like 30sec, 29secs, 28secs. do u get it? Thanks! EDIT: ye will brings is right, how I can set that? Thanks.
  11. thanks alot, thats what I was looking for! but didnt know a way to make it. Thanks!! Btw I take this topic to ask another thing, how can I set a gui with numbers changing ? So I could make the timer? ty
  12. Okay, hi again, this is very hard to explain. But I will try to do it, and I would appreciate some help guys. My gamemode spawn is like: Player join server then appear gui to choose team then spawn on a random spawnpoint defined by spawnpoints on map file . Now I want my gamemode spawn like this: Player join server then active timer with 30 seconds then player choose team then will not spawn at that time (but spawn details saved), he wait the 30 seconds timer to finish, and in this time, there would be occasionally another player choosing a team and also saving his spawn details saved. the cycle would continue if more players would log in and chose team. WHEN 30 seconds go 0 , all the players that had chosen his team, would spawn in their spawnpoints respectively. And gamemode started, and if player would enter after the gamemode started would wait for the gamemode has finished. So guys I hope u understand my idea. I guess u know how I can settle this. Tell me functions and ideas. Thanks alot!
  13. LOL, that will give alot of work But thanks
  14. LoL forget my question ofc is that, u are right . i am stupid x) and btw look, its possible to place a circle of light on the ground that a lighthouse is pointing ? Edit: I think I didnt was understandble.. I want this: You know what is lighthouse ? that structures that are near the sea ? So I want to create an object, and then attach a light to it. u see? the light moves, and when these light point to the ground it illuminate that spot of ground. U get it? sorry if I didnt explain me better. Thanks!!
  15. Thanks for ur reply Its possible to apply this functionality MTA Team ? Thanks.
  16. is it possible to set the radar on the mini-map with a circle ? instead of rectangle/square? Thanks!
  17. hmm and how can I transform a colShape on a marker ? not possible right ? eheh
  18. circle = createElement(...) and the element circle will be the wall ? If I set alpha of that element ? Thanks for ur reply
  19. I mean u know RGBA right ? the alpha thing, i want a wall with a color, but not with much opacity, not 255 alpha!! Like make a wall almost invisible ? but with a bit color of white ? u see ? its possible to make that? I would be really happy Thanks in advance!
  20. didnt know sorry eheh I see :b
  21. he can make the + 2 inside the function
  22. Hm okay, If car is 3 points of distance then I am enlightened . Fine, thanks bro
×
×
  • Create New...