Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function clientWantToCheckHisState()
- local account = getPlayerAccount(source)
- if isGuestAccount(account) then
- local colorCode = get("*race.color") or "#00aaff"
- triggerClientEvent(source,"onServerWantIniteteLoginPanel",getRootElement(),colorCode)
- end
- end
- addEvent("onClientWantCheckHisState",true)
- addEventHandler("onClientWantCheckHisState",getRootElement(),clientWantToCheckHisState)
- function tryToLogInAsClient(theLogin,thePassword)
- if theLogin and thePassword then
- local account = getAccount(theLogin,thePassword)
- if account then
- logIn(source,account,thePassword)
- displayServerMessage(source,"Pomyślnie zalogowano!")
- triggerClientEvent(source,"onClientSuccessfullyLogIn",getRootElement())
- else
- displayServerMessage(source,"Nieprawidłowy login lub hasło!","warning")
- end
- end
- end
- addEvent("onClientWantToLogIn",true)
- addEventHandler("onClientWantToLogIn",getRootElement(),tryToLogInAsClient)
- function tryToRegister(theLogin,thePassword)
- if theLogin and thePassword then
- if not getAccount(theLogin) then
- local newAccount = addAccount(theLogin,thePassword)
- if newAccount then
- displayServerMessage(source,"Pomyślnie stworzyłeś konto! Możesz się zalogować!")
- triggerClientEvent(source,"onClientSuccessfullyRegisterNewAccount",getRootElement())
- else
- displayServerMessage(source,"Błąd podczas tworzenia konta. Spróbuj ponownie później.","warning")
- end
- else
- displayServerMessage(source,"Konto z tą nazwą użytkownika już istnieje!","warning")
- end
- end
- end
- addEvent("onClientWantToRegister",true)
- addEventHandler("onClientWantToRegister",getRootElement(),tryToRegister)
- function displayServerMessage(thePlayer,message,type)
- triggerClientEvent(thePlayer,"onServerWantToShowMessage",getRootElement(),message,type)
- end
Advertisement
Add Comment
Please, Sign In to add comment