Blockland Forums > Modification Help
Custom Server Message GUI
yourthatdude:
--- Quote from: Nexus on August 25, 2011, 11:08:27 PM ---He is asking about the GUI aspect of it. That doesnt involve a GUI.
--- End quote ---
What Nexus Said.
ThinkInvisible:
Maybe use servercommands and clientcommands for a second chat window.
I don't know a lot about server-client relations but I tried:
--- Code: ---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);
--- End code ---
I really think I messed up the clientgroup stuff.
Scars75:
--- Quote from: ThinkInvisible on August 27, 2011, 12:54:18 PM ---
--- Code: ---clientgroup.getobject(%i).clientCmdRecieveFromPrivateChat(%text);
--- End code ---
--- Code: ---
if(the client's clanprefix $= "whatyouwanttorestrict" || the client's clansuffix $= "whatyouwanttorestrict") {
--- End code ---
--- End quote ---
wtf
Headcrab Zombie:
--- Quote from: Scars75 on August 27, 2011, 02:38:13 PM ---wtf
--- End quote ---
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
--- Quote from: ThinkInvisible on August 27, 2011, 12:54:18 PM ---clientgroup.getobject(%i).clientCmdRecieveFromPrivateC hat(%text);
--- End quote ---
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
Crown2:
--- Quote from: Headcrab Zombie on August 27, 2011, 02:48:14 PM ---Honestly though I'd just wait for RTB4 and use the chat rooms
--- End quote ---