Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Chatroom help
#1
Hey guys this does not really fit here but I don't want to waste posts in Advanced... but I started making a code for a chat room, I have gotten some of the code to work. Though I am kind of lost in a direction to go as far as getting the system to invite more then one player to the room, could someone give me an idea on how to work out the handling for more than one player.
Reply
#2
Well first of all your current system allows the reqruiting of 1 person. So you probably have a text box where you type the name to invite. A simple way would be to make it kind of like a guild. Where you have a array with the players in the chat/guild. So when you invite someone, you add his name to the array. Like:

Code:
Name(1 to 5)

Now when adding it, you need to check what array slot is clear.

Code:
for i =1 to 5
  if Player(index).ChatName(i) = vbnullstring then
    Player(index).ChatName(i) = Parse(1)
  end if
next i

Now he has been added to your list, but he also need the full current list of the owner.

Code:
for i =1 to 5
  if Player(index).ChatName(i) = vbnullstring then
    Player(index).ChatName(i) = Player(owner).ChatName(i)
  end if
next i

And then you need to add a leave button on the chat so if a person leaves the chat, his name is cleared.

Code:
for i =1 to 5
  if Player(index).ChatName(i) = getplayername(index) then
    Player(index).ChatName(i) = vbnullstring
  end if
next i

Well this was just a scetch, and it's not going to work in anyway. There are some problems with what I wrote. But I just tried to open your eyes for a easy way to do it. Of course you need to know some general programming to actually finish it.
Reply
#3
It does not matter if the code does not work, it gives me a idea to create a project to work on for the system. I am just modifing it anyway to where, there is a start IM and start ChatRoom, thanks for the help william.
Reply
#4
No problem Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)