Moderators IIYAMA Posted February 17, 2012 Moderators Posted February 17, 2012 (edited) Hey, I got a question: What is onClientRender ? = when you spawn you load objects? or = on join server and downloading scripts? I am using a script that dissable the normal gta hud...but when you get killed, the normal gta san hud come back somehow.. Because I have a hud and it have sometimes a bug. You see two hud's when you die. I use onGameModeStart, ongameModeMapStart and onPlayerJoin to dissable the gta san hud. Do I need on ClientRender to?? Gamemode: Stealth. pls tell me what I need. Edited February 17, 2012 by Guest Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Kenix Posted February 17, 2012 Posted February 17, 2012 I not understand you. You need draw hud? http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Agon Posted February 17, 2012 Posted February 17, 2012 He draws hud but when you die, 2 hud appears (one of them is gta's original hud and the other is his hud i think.)
Moderators IIYAMA Posted February 17, 2012 Author Moderators Posted February 17, 2012 I am using a script that dissable the normal gta hud... but when you get killed, the normal gta san hud come back somehow.. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
drk Posted February 17, 2012 Posted February 17, 2012 Use onPlayerWasted or create a timer to disable hud. EPT Team Server Development: 0% Learning C++ | C++ is amazing
Moderators IIYAMA Posted February 17, 2012 Author Moderators Posted February 17, 2012 Use onPlayerWasted or create a timer to disable hud. Maybe onPlayerSpawn and timer.. because there is the problem. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
drk Posted February 17, 2012 Posted February 17, 2012 Why use the two options? Only use a timer... setTimer( function() showPlayerHudComponent('all',false) end end,500,0) EPT Team Server Development: 0% Learning C++ | C++ is amazing
Moderators IIYAMA Posted February 17, 2012 Author Moderators Posted February 17, 2012 that makes lagg.. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
drk Posted February 17, 2012 Posted February 17, 2012 Not for me. And my computer is a shit.. But you can use onPlayerWasted or onPlayerSpawn. onPlayerWasted addEventHandler('onPlayerWasted',root, function() showPlayerHudComponent('all',false) end) For onPlayerSpawn, the same, only change event name. EPT Team Server Development: 0% Learning C++ | C++ is amazing
Castillo Posted February 17, 2012 Posted February 17, 2012 You forgot about 'source'. addEventHandler('onPlayerWasted',root, function() showPlayerHudComponent(source,'all',false) end) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
drk Posted February 17, 2012 Posted February 17, 2012 My bad ~~ EPT Team Server Development: 0% Learning C++ | C++ is amazing
Moderators IIYAMA Posted February 17, 2012 Author Moderators Posted February 17, 2012 but what is: onClientRender ?? Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Castillo Posted February 17, 2012 Posted February 17, 2012 onClientRender is a event handler. https://wiki.multitheftauto.com/wiki/OnClientRender San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Moderators IIYAMA Posted February 17, 2012 Author Moderators Posted February 17, 2012 yes I know... But I don't understand the meaning of this: This event is triggered every time GTA renders a new frame. It is required for the DirectX drawing functions, and also useful for other clientside operations that have to be applied repeatedly with very short time differences between them. So If I play my mta at 70 frames, will this script activated every 70 times in a frame? It sounds terible laggy... Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
drk Posted February 17, 2012 Posted February 17, 2012 It not lags the game.. Not for me. EPT Team Server Development: 0% Learning C++ | C++ is amazing
karlis Posted February 18, 2012 Posted February 18, 2012 well, it is kind of resource intensive, but not very laggy. after all there's thousands calculations to be done for each frame. you can take look at my ivhud how things are done, its kind of hard to read though. [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
Moderators IIYAMA Posted February 19, 2012 Author Moderators Posted February 19, 2012 yes I saw the resource.. But I want the lagg so low as possible. So my choose is: OnClientPlayerSpawn, "gamemode" and "map" Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
karlis Posted February 19, 2012 Posted February 19, 2012 its impossible that way, everything has to be drawn onClientRender.That is, unless you use GUI, but they still are drawn same way, just you don't see that. [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
Moderators IIYAMA Posted February 19, 2012 Author Moderators Posted February 19, 2012 yes that is right, but this is about deactivate the gta san hud. It is not about showing up the GCC hud GCC = clan Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
karlis Posted February 19, 2012 Posted February 19, 2012 ah then just set a timer on a resource start to remove the hud again, AND TIMERS ARE NOT LAGGING, 1 timer wont change anything performance wise. alternatively in next mta versions you will be able to just set event priority to low without timer. [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
Moderators IIYAMA Posted February 19, 2012 Author Moderators Posted February 19, 2012 timer don't lagg, but I think what I did is also good. But maybe you know the game age of empire 3? Well I made a map with arround 1200 scripts and it is crashing in mutiplayer I love the game but I hate the out of sync Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
karlis Posted February 19, 2012 Posted February 19, 2012 well just hide it on timer after resource start cant get any more optimized atm. [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
Moderators IIYAMA Posted March 3, 2012 Author Moderators Posted March 3, 2012 Well onclient render does lagg a little. I can feel it, when my hud is running. I have still the max frames, but the smooth movements are gone -_-' Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Evil-Cod3r Posted March 3, 2012 Posted March 3, 2012 why dont you use this https://wiki.multitheftauto.com/wiki/OnClientPreRender My in-game nick is |['Dev-PoinT_SA']| addEventHandler ( "onPlayerSpawn", getRootElement(), function() if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then triggerClientEvent("BlaBlaBla",getRootElement()) DxDrawText("Hi Dev-PoinT") end end)
Moderators IIYAMA Posted March 3, 2012 Author Moderators Posted March 3, 2012 or maybe I can try this... https://wiki.multitheftauto.com/wiki/OnClientHUDRender Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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