Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • stCky: yeah so at least my mom has a pussy
      Today at 12:29:06 AM
    • Travas: your mom is a faggot
      January 17, 2018, 08:21:57 PM
    • stCky: mom wont let me meet internet strangers
      January 17, 2018, 04:20:53 PM
    • Saltyspade10: Moparmeetupppp
      January 16, 2018, 07:07:04 PM
    • stCky: but my car is japanese
      January 16, 2018, 07:06:25 PM
    • Saltyspade10: Mopar meet up?
      January 16, 2018, 07:05:59 PM
    • stCky: pfft my rb25det cefiro will eat ur tiny 1960s v8 for breakfast kid
      January 16, 2018, 07:01:30 PM
    • Travas: fag
      January 16, 2018, 01:16:43 PM
    • Oblit: ph*
      January 16, 2018, 12:34:04 PM
    • Oblit: pk balance
      January 16, 2018, 12:33:17 PM
    • Travas: racist bigot
      January 15, 2018, 09:33:12 PM
    • stCky: wheres the fun in that you immagint synthesizer
      January 15, 2018, 09:24:14 PM
    • Travas: no trump no kkk no fascist usa
      January 15, 2018, 09:11:29 PM
    • stCky: im lit
      January 15, 2018, 07:49:10 PM
    • Travas: hi
      January 15, 2018, 07:21:21 PM
    • runerunerune: hi
      January 15, 2018, 05:44:20 AM
    • shulker: anyone selling onyx? trade me in game ill negotiate an offer for like 5 trades per person
      January 15, 2018, 12:56:09 AM
    • Travas: o shit wadup
      January 14, 2018, 11:59:49 PM
    • stCky: pass me that blunt boi u know whats up
      January 14, 2018, 06:50:41 PM
    • Travas: TITS and ASS
      January 14, 2018, 02:43:33 PM

    Author Topic: How do you add login notifications?  (Read 503 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?
    RS2Ad banner

    OfflineScape-JAVA

    • HEy girls
    • Member
    • ****
    • Posts: 5,254
    • 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() {
    RS2Ad banner

    OfflineScape-JAVA

    • HEy girls
    • Member
    • ****
    • Posts: 5,254
    • 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.
    RS2Ad banner

    Offlinematzie

    • Member
    • ****
    • Posts: 1,012
    • 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