Author Topic: Custom Server Message GUI  (Read 808 times)

Hey guys I need some help I am currently working on a Message GUI for my server but I dont know how to make the message edit ctrl go to the main message window if someone could help me on this I would really appreciate it

What do you want your custom server message gui to do?  Is it like a PM?  Is it an alternative for the chat?  I am having a little trouble picturing your idea.

Well its going to be like a PM yes but like IRC but for my clan and well you know how in IRC theres the message Bar where you can type your message then send it and it shows up well thats what I need sorry if its confusing hard to explain



He is asking about the GUI aspect of it.  That doesnt involve a GUI.
What Nexus Said.

Maybe use servercommands and clientcommands for a second chat window.

I don't know a lot about server-client relations but I tried:
Code: [Select]
function SendToPrivateChat(%c, %text) { //(servercmd, maybe)
     //Send the line to every client in the server.
     //Probably something like this:
     for(%i=0;%i<clientgroup.getcount();%i++) {
          clientgroup.getobject(%i).clientCmdRecieveFromPrivateChat(%text);
     }
}

function clientCmdRecieveFromPrivateChat(%text) {
     if(the client's clanprefix $= "whatyouwanttorestrict" || the client's clansuffix $= "whatyouwanttorestrict") {
     //You don't REALLY have to use clansuffix/prefix if you don't want to. You can use something else, like a whitelist.
          //Add the line to the main chatbox.
          //I don't know what type of chatbox you're using so you figure this out.
     }
}

//When the "send" button is pressed, call SendToPrivateChat(the client pressing send, the text of the chatbox);

I really think I messed up the clientgroup stuff.

Code: [Select]
clientgroup.getobject(%i).clientCmdRecieveFromPrivateChat(%text);
Code: [Select]

     if(the client's clanprefix $= "whatyouwanttorestrict" || the client's clansuffix $= "whatyouwanttorestrict") {
wtf
« Last Edit: August 27, 2011, 02:41:56 PM by Scars75 »

wtf
It's called psuedo-code. He knows the logic of what he wants to do, but he doesn't know exactly how do obtain the variables needed



clientgroup.getobject(%i).clientCmdRecieveFromPrivateC hat(%text);
This would be:
commandtoclient(clientgroup.getobject(%i),'RecieveFromPrivateChat',%text);
Or just get rid of the loop completely and you can do:
commandToAll('RecieveFromPrivateChat',%text);

Though it's not much of a private chat if you send it to every client in the server.


Honestly though I'd just wait for RTB4 and use the chat rooms

Honestly though I'd just wait for RTB4 and use the chat rooms