Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • Emulous: Come check out Emulous: [link]
      Today at 03:37:19 PM
    • Emulous:[link]
      Today at 03:37:00 PM
    • Travas: ur mom
      July 21, 2018, 06:04:50 PM
    • YNRDAB: Watcha big ballers up too?
      July 20, 2018, 11:01:06 AM
    • dark250: i need help for coding client
      July 19, 2018, 08:27:37 AM
    • Travas: yes
      July 14, 2018, 02:19:44 PM
    • drubrkletern: lmao racist and sexist much?
      July 14, 2018, 01:11:52 PM
    • Cole1497: yeah i got you lil boat give me a second
      July 13, 2018, 03:19:35 AM
    • B0ATY.: yo can anyone unban my ip, i got banned for saying i hope someone gets aids :p
      July 12, 2018, 09:16:00 PM
    • jme: ziplock this domain belongs to the kremlin now
      July 12, 2018, 06:54:31 PM
    • Pure_: lol
      July 12, 2018, 01:37:47 PM
    • ziplock: wtf is this forum? Haven't checked in in 4 years lmao
      July 11, 2018, 10:26:03 AM
    • ziplock: Idk
      July 11, 2018, 10:25:41 AM
    • _^_: guys is anyone still even here
      July 11, 2018, 01:54:43 AM
    • Travas: gay
      July 08, 2018, 02:00:14 PM
    • CheapOnlineHost: Hosting starting at $0.75 hostcheap.io
      July 08, 2018, 09:35:20 AM
    • q1w1e1r1t1y: is the server actually updating or is it down?? trying to log on for the first time in a few months and it says "server updating try again in 1 minute" for the last 10 minutes now
      July 07, 2018, 11:11:51 PM
    • Cole1497: gamers unite
      July 07, 2018, 04:26:07 PM
    • IamLation: LMFAO @cole
      July 06, 2018, 10:36:52 AM
    • drubrkletern: olfihsouhdiu
      July 04, 2018, 04:25:32 PM

    Author Topic: How do you add login notifications?  (Read 545 times)

    0 Members and 1 Guest are viewing this topic.

    OfflineDivinityrs

    • Member
    • **
    • Posts: 9
    • Thanks: +0/-0
      • View Profile
    How do you add login notifications?
    « on: August 07, 2015, 07:23:09 PM »
    How do you make it so when a staff member or brand new player logs in, it puts a notification in chatbox?
    Runescape Gambling

    OfflineScape-JAVA

    • HEy girls
    • Member
    • ****
    • Posts: 5,259
    • Thanks: +0/-0
      • View Profile
    Re: How do you add login notifications?
    « Reply #1 on: August 07, 2015, 08:23:50 PM »
    Assuming you're using PI, at the end of your player initialization method (I think "initialize" in the client class)

    Code: Java
    1. if(c.playerRights==3){
    2.   for(Player p : PlayerHandler.players){
    3.     ((Client)p).sendMessage("Admin "+ c.playerName+" has logged in.");
    4.   }
    5. }
    6.  

    For a new player it would be a little more complicated.
    Easiest way would probably by checking if the player has a save file already on login,
    and if he hasn't you can set a flag to indicate that it's a new player and do similar as with staff in his initialization.

    Code: [Select]
    public void initialize() {
    Runescape Gambling

    OfflineScape-JAVA

    • HEy girls
    • Member
    • ****
    • Posts: 5,259
    • Thanks: +0/-0
      • View Profile
    Re: How do you add login notifications?
    « Reply #2 on: August 07, 2015, 08:35:15 PM »
    Toy around with it and figure it out or read the original post.
    Runescape Gambling

    Offlinematzie

    • Member
    • ****
    • Posts: 1,013
    • Thanks: +0/-0
      • View Profile
    Re: How do you add login notifications?
    « Reply #3 on: August 09, 2015, 09:29:04 PM »
    If you have tutorial island in your game, you could do it based on its stage.
    smart phones are dumb
    people are smart phones.

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal