aguia Posted September 22, 2015 Share Posted September 22, 2015 Hello everybody, I'm new in the script section and I've starting studying these resources: viewtopic.php?f=108&t=82870 (made by xXMADEXx) Well, I were trying to place a new hud, but it appears while I'm on login panel, how can I let that hud hidden while the login system is working? *I'm also trying to place a new radar (same thing). Link to comment
KariiiM Posted September 22, 2015 Share Posted September 22, 2015 Function: showPlayerHudComponent Example: showPlayerHudComponent ( source, "clock", false ) Link to comment
aguia Posted September 22, 2015 Author Share Posted September 22, 2015 Function: showPlayerHudComponent Example: showPlayerHudComponent ( source, "clock", false ) I didn't understand. Link to comment
Best-Killer1 Posted September 22, 2015 Share Posted September 22, 2015 Function: showPlayerHudComponent Example: showPlayerHudComponent ( source, "clock", false ) I didn't understand. do you can post the code ? Link to comment
Dealman Posted September 23, 2015 Share Posted September 23, 2015 You could use the onPlayerLogin event, and once they have logged in - use triggerClientEvent to make it visible. Link to comment
KariiiM Posted September 23, 2015 Share Posted September 23, 2015 There are 2 events to uses in this situation, first one onPlayerJoin that mean when the player join into the server but his account still guest in this case you can hide it second event is onPlayerLogin as Deelman said, it's about the player who logged in with an account so in this case you can make it visible Link to comment
aguia Posted September 25, 2015 Author Share Posted September 25, 2015 (edited) function toggleRadar() if isVisible then addEventHandler("onPlayerLogin", root, HUDNAME) else removeEventHandler("onPlayerLogin", root, HUDNAME) end isVisible = not isVisible end I made this, going to test in game right now --Not working * A question: If I place the event "onPlayerLogin" there, I must to edit the meta file (exporting something from the Login folder)? Edited September 25, 2015 by Guest Link to comment
TAPL Posted September 25, 2015 Share Posted September 25, 2015 function toggleRadar() if isVisible then addEventHandler("onPlayerLogin", root, HUDNAME) else removeEventHandler("onPlayerLogin", root, HUDNAME) end isVisible = not isVisible end I made this, going to test in game right now --Not working * A question: If I place the function "onPlayerLogin" there, I must to edit the meta file (exporting something from the Login folder)? onPlayerLogin is event not function. Maybe you should spend more time reading the wiki? https://wiki.multitheftauto.com/wiki/Scripting_Introduction Link to comment
aguia Posted September 25, 2015 Author Share Posted September 25, 2015 Anybody to help? Link to comment
Dimos7 Posted September 25, 2015 Share Posted September 25, 2015 function showHud() showPlayerHudComponent(source, "radar", true) end addEventHandler("onPlayerLogin", getRootElement(), showHud) function hideHud() showPlayerHudComponent(source, "radar", false) end addEventHandler("onPlayerConnect", getRootElement(), hideHud) 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