Author Topic: How would I make a messagebox only for that client.  (Read 1583 times)

bassically the title, this is just a example of what i have.

function servercmdblah(%client)
{
   messageBoxOK("MessageBOX", "This is a message from the box" );
}


thanks.

CommandToClient(%client,'messageBoxOk',"head","body");
« Last Edit: August 19, 2012, 01:46:11 AM by elm »

If I'm understanding you correctly you just want to give the client a messagebox? (by the way, that's default. to do it to all you would loop through the clients, unless there's a function I don't know about.)

commandtoclient(%client,'MessageBoxOK',"Your title goes here.","Your message goes here.");

First argument is the client target, second is the command to give to the client (in this case, MessageBoxOK), 3rd is the title, and 4th is the message.

@placid
thanks, it works now.

@elm
yeah you forgot the commandtoclient part but that's fine.
« Last Edit: August 18, 2012, 11:21:30 PM by wound »

unless there's a function I don't know about
commandtoall


And thank you wound for unlocking it. I didn't have anything to say directed to you, but I just wanted you to be aware of it, since I've noticed you've locked some topics previously

@elm
yeah you forgot the commandtoclient part but that's fine.


no, it is a different way to do the same thing.

If you want to do it to everyone without looping, you can do messageall or commandtoall


no, it is a different way to do the same thing.

If you want to do it to everyone without looping, you can do messageall or commandtoall
really because when I did it elm's way the message wasn't even working.

no, it is a different way to do the same thing.

If you want to do it to everyone without looping, you can do messageall or commandtoall
I'm pretty sure that was directed at the fact that elm was missing the "to" between command and client. Unless the bolded characters are for something else.

I'm pretty sure that was directed at the fact that elm was missing the "to" between command and client. Unless the bolded characters are for something else.

No, i had a brain fart and put messageClient, lol.

doesnt commandtoall do nothing else than looping throuch clients and sending them a command

doesnt commandtoall do nothing else than looping throuch clients and sending them a command
It's hard coded into the engine, so a C++ loop is much faster than a TS loop. However, yes, they're essentially the same thing. And yes, the difference is negligible.

It's hard coded into the engine, so a C++ loop is much faster than a TS loop. However, yes, they're essentially the same thing. And yes, the difference is negligible.
Arguably there's a scenario where the difference will not be negligible. The best coding method should always be used because it's just good practice