Jump to content

onResourceStart problem


Hero192

Recommended Posts

Hey guys im making a login system but i stuck on something, i want when i start the resource only people who have no account or they're guest account they who can see the gui ,since the onResourceStart event do not accept 'source' i tried this way but nothing works..

i did trigger from client to server it's for the GUI Visiblity

Here's the code, no error it just doesn't works

addEventHandler( "onResourceStart", root, 
function () 
    checkGuestAccount() 
end)  
  
function checkGuestAccount () 
    local account = getPlayerAccount(source) 
    if not account or isGuestAccount(account) then 
    showPlayerHudComponent ( source, "clock", true ) 
    showPlayerHudComponent ( source, "radar", true ) 
    showPlayerHudComponent ( source, "area_name", true ) 
    showChat ( source, true ) 
    showCursor( source, true ) 
    fadeCamera( source, true, 1 ) 
    setCameraMatrix(source, -1212.281, 185.058, 84.00, -1780, 790, 70)  
    outputChatBox("* Welcome .",source,255,255,0)    
    triggerClientEvent(source,"onJoin",source) 
    else 
    return false 
    end 
end 
  

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...