+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: private chatting e2

  1. #1
    Wirererer jesse1412's Avatar
    Join Date
    Sep 2009
    Location
    in your basement
    Posts
    315

    Default private chatting e2

    i got bored so i made a chat e2 i know its been done once or twice before but i personalised mine so that the commands are easy to use and understand

    Code:
    @name chat
    @inputs 
    @outputs 
    @persist Color:vector [CA LS2 LS3 WNames LSA ReceiveStr]:array [Chatroom SendStr SendPM PM RecievePm Name LS]:string A
    @trigger 
    runOnChat(1)
    gShare(1)
    O=owner()
    LSA=O:lastSaid():explode("")
    LS=O:lastSaid()
    LS2=owner():lastSaid():explode(" ")
    if(first()){
        Color=vec(255,255,255)
        A=1
        Chatroom="chat"
        gSetGroup("chatterboxernators")
        printColor(vec(150,0,255),"made by bulletBlr-rpj. Contact jesse1412 on the wm(wire-mod) forums for help.")
    }
    if(first()|LS=="@help"){
        hideChat(1)
        hint("type @help to open these hints",7)
        hint("type @(Message goes here)",7)
        hint("to type in a chatroom",7)
        hint(" ",7)
        hint("type @join (chatroom-name)",7)
        hint("to join a chatroom",7)
        hint(" ",7)
        hint("type @pm (there name)",7)
        hint("to pm some1",7)
        hint(" ",7)
        hint("type @color N,N,N",7)
        hint("to set your chat color",7)
    }
    
    if(LS2:string(1)=="@join"&chatClk(O)){
        hideChat(1)
        Chatroom=LS2:string(2)
        hint("you are in chatroom "+Chatroom+"!",5)
        hint("re-join the public chat",5)
        hint("by typing[ @join chat]",5)
    }
    
    if(LS2:string(1)=="@pm"&chatClk(O)){
        hideChat(1)
        Name=findPlayerByName(LS2:string(2)):name()
        hint("PM sent to "+Name,5)
        LS3=LS2
        LS3:setString(1,"PM from "+O:name()+":")
        LS3:setString(2," ")
        SendPM=LS3:concat(" ")
        gSetStr(Name,SendPM)
        hint(SendPM,10)
    }    
      
    if(LSA:string(1)=="/"&chatClk(O)){
        hideChat(1)
        LSA:setString(1,"")
        SendStr=LSA:concat("")
        WNames:setString(1,O:name()+": ")
        WNames:setString(2,SendStr)
        gSetStr(Chatroom,glonEncode(WNames))
    }
    
    if(LS2:string(1)=="@color"&chatClk(O)){
       hideChat(1)
       CA=LS2:string(2):explode(",")
       Color=vec(CA:string(1):toNumber(),CA:string(2):toNumber(),CA:string(3):toNumber())
    }
    
    if(chatClk()&A){
        gSetStr(O:name(),"")
        gSetStr(Chatroom,"")
        A=!A
    }
    
        RecieveStr=glonDecode(gGetStr(Chatroom))
        RecievePm=gGetStr(O:name())
    
    if(changed(RecieveStr:string(2))&lastSaid():explode(""):string(1)=="/"){
        printColor(teamColor(lastSpoke():team()),Chatroom+", "+RecieveStr:string(1),Color,RecieveStr:string(2))
    }
    if(changed(RecievePm)&chatClk()&lastSaid():explode(""):string(1)=="@pm"){
        printColor(vec(150,0,255),RecievePm)
    }
    the commands are quite simple:
    / is the chat room talk key, typing / at the start of what u type will make it only appear in the chat room you are currently using

    @join typing @join then a word will create/join a chatroom with that name

    @pm typing @pm (player name here) will send a message to only that player

    @help typing @help will show u a list of commands and meanings

    @color type[ @color N,N,N ] to set color of messages you see

    to use it simply get you and another person(s) to spawn the chip, no need for anything else

    not much to show so no screenys/videos unless some1 really wants pictures of people talking

    NOTE players must have the expression spawned to use the chat rooms and receive/send pms

    need more ideas for this chip people XD

    PS. code runs at around 20 ops every time some1 types and only executes with runOnChat(1)
    Last edited by jesse1412; 11-27-2009 at 09:50 AM. Reason: updated code

  2. #2
    Wire Sofaking feha's Avatar
    Join Date
    Sep 2009
    Location
    Here
    Posts
    1,156

    Default Re: private chatting e2

    Yo me it looks like all players not only need it to use chatrooms, but that they also need it to receive pms. You *could* solve that using concmd ulx pm... But that is not the point, right ? The best solution would be to edit post saying "NOTE players must have the expression spawned to use the chat rooms and pm eachothers".

  3. #3
    Wirererer jesse1412's Avatar
    Join Date
    Sep 2009
    Location
    in your basement
    Posts
    315

    Default Re: private chatting e2

    hehe you really do like everything completely perfect don't you XD
    done it :P

  4. #4
    Mario, hard at work Filipe's Avatar
    Join Date
    Jun 2007
    Location
    Portugal - Lisbon
    Posts
    401
    Blog Entries
    1

    Default Re: private chatting e2

    I remember doing this some time ago! I really like the extra effort you've put into it, tho. May I recommend, if you're up for some extra work, change the text to print, and use printColor, allowing clients to choose their name color?

    So it'd be like:

    Filipe: bacon is awesome and everyone who disagrees is a rapist
    beep boop

  5. #5
    Wire Noob magnushj's Avatar
    Join Date
    Sep 2009
    Posts
    22

    Default Re: private chatting e2

    its not private when you type in chat:S

  6. #6
    No u Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    4,582

    Default Re: private chatting e2

    I've made something like this, only mine didn't use gvars ^^ It used a very different system...

    Quote Originally Posted by magnushj View Post
    its not private when you type in chat:S
    Code:
    hideChat(1)
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

  7. #7
    Wirererer jesse1412's Avatar
    Join Date
    Sep 2009
    Location
    in your basement
    Posts
    315

    Default Re: private chatting e2

    thx for replies guys

    EDIT:
    code updated!
    please tell me if u find any glitches or have anything u want me to add
    EDIT EDIT(aka 2nd edit):
    code updated again now shows what chatroom your in when some1 types
    Last edited by jesse1412; 11-27-2009 at 09:53 AM.

  8. #8
    Wirererer NikoKun's Avatar
    Join Date
    May 2008
    Posts
    124

    Default Re: private chatting e2

    Doesn't lastSaid() still display all chat messages, even those hidden with hideChat(1)?
    ------------------------------------
    aka "Nik of the Wired" in gmod.

  9. #9
    Wire Sofaking Solece's Avatar
    Join Date
    Jul 2008
    Location
    Pittsburgh, PA
    Posts
    673

    Default Re: private chatting e2

    Quote Originally Posted by NikoKun View Post
    Doesn't lastSaid() still display all chat messages, even those hidden with hideChat(1)?
    Yep :S, even those sent with !p, the pm for ulx.

  10. #10
    Wirererer jesse1412's Avatar
    Join Date
    Sep 2009
    Location
    in your basement
    Posts
    315

    Default Re: private chatting e2

    lol unless u want to pre write ure messages in the e2 i dont think il be changing that

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Private Military Companies
    By Mechanical433 in forum Off-Topic
    Replies: 3
    Last Post: 07-30-2008, 01:27 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots