SkatCh Posted June 24, 2014 Share Posted June 24, 2014 hi guys please i need some help how can i make players can't see guieds if they didn't login . i'm sorry about my english Link to comment
Castillo Posted June 24, 2014 Share Posted June 24, 2014 What do you mean by "guieds"? you are talking about all GUI's? if so, then you should edit each script and add it a check to see if player is logged in. Link to comment
Max+ Posted June 24, 2014 Share Posted June 24, 2014 you Can do something like this , - onPlayerLogin ---- Event on ServerSide isGuestAccount --- if they are not logged in then triggerClientEvent ( source, 'hideGUI', source ) --- to call the event on Client named hidegui -------------- ClientSide addEvent('hideGUI', true ) addEventHandler('hideGUI', root, function ( ) guiSetVisible ( windowName, false ) showCursor ( false ) -------------------------------------- Link to comment
SkatCh Posted June 24, 2014 Author Share Posted June 24, 2014 What do you mean by "guieds"? you are talking about all GUI's? if so, then you should edit each script and add it a check to see if player is logged in. yes bro exactly i am talking about all GUI's : example players can't use F1 , F2 , F3 ... F7 when they didn't login . Link to comment
Max+ Posted June 24, 2014 Share Posted June 24, 2014 What do you mean by "guieds"? you are talking about all GUI's? if so, then you should edit each script and add it a check to see if player is logged in. yes bro exactly i am talking about all GUI's : example players can't use F1 , F2 , F3 ... F7 when they didn't login . have a look what i post , Link to comment
Max+ Posted June 24, 2014 Share Posted June 24, 2014 impossible , show me , your code, Link to comment
SkatCh Posted June 25, 2014 Author Share Posted June 25, 2014 client side : addEvent('hideGUI', true ) addEventHandler('hideGUI', root, function ( ) guiSetVisible ( window, false ) showCursor ( false ) end) server side: function check() sourceAccount = getPlayerAccount ( source ) if isGuestAccount ( sourceAccount ) then triggerClientEvent ( source, 'hideGUI', source ) end end addEventHandler("onPlayerLogin", root, check) Link to comment
Et-win Posted June 25, 2014 Share Posted June 25, 2014 He wants to hide ALL GUI's in whole MTA, I guess? Link to comment
Moderators IIYAMA Posted June 25, 2014 Moderators Share Posted June 25, 2014 Use onPlayerLogout. https://wiki.multitheftauto.com/wiki/OnPlayerLogout You don't need the isGuestAccount function with those events. onPlayerLogin = account onPlayerLogout = guestAccount Link to comment
#DRAGON!FIRE Posted June 25, 2014 Share Posted June 25, 2014 client side : addEvent('hideGUI', true ) addEventHandler('hideGUI', root, function ( ) guiSetVisible ( window, false ) showCursor ( false ) end) server side: function check() sourceAccount = getPlayerAccount ( source ) if isGuestAccount ( sourceAccount ) then triggerClientEvent ( source, 'hideGUI', source ) end end addEventHandler("onPlayerLogin", root, check) lol ! ? u cheek if Account Guest when player login !! ? Link to comment
SkatCh Posted June 25, 2014 Author Share Posted June 25, 2014 how can i fix it please . Link to comment
Moderators IIYAMA Posted June 25, 2014 Moderators Share Posted June 25, 2014 Use onPlayerLogout.https://wiki.multitheftauto.com/wiki/OnPlayerLogout You don't need the isGuestAccount function with those events. onPlayerLogin = account onPlayerLogout = guestAccount Link to comment
SkatCh Posted June 25, 2014 Author Share Posted June 25, 2014 didn't work just i want when it's a guestAccount account you can't open Gui's that's all . Link to comment
Max+ Posted June 25, 2014 Share Posted June 25, 2014 just Change my post form onPlayerLogin to onPlayerJoin if is GusetAccount , then triggertheHide event else triggerShow event , it's Very Easy . Link to comment
Moderators IIYAMA Posted June 26, 2014 Moderators Share Posted June 26, 2014 didn't work just i want when it's a guestAccount account you can't open Gui's that's all . That is not how I can help you. I am only helping people who are trying to write the code by them self. When they do, I will correct the code and give tips/examples. So give it another try. 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