Author Topic: Client Centerprint  (Read 836 times)

Code: [Select]
commandtoclient(%client,'centerprint',"Hello",1);
Why won't this work?
I input it in the console and it doesn't work!

Does %client exist in the current scope?

That is not the correct usage.
Here is the correct usage:
Code: [Select]
clientCmdCenterPrint("message", time in seconds);To see, try typing clientCmdCenterPrint("I will disapeear in 5 seconds!", 5); into the console.

This is assuming your trying to do it client-sidedly.

Post the entire function that is calling centerprint
Didn't see the "in the console" part
« Last Edit: December 04, 2011, 03:49:27 PM by Headcrab Zombie »

"input it in the console" won't work because %client hasn't been set, so it's not sending the message to anyone.

findClientByName("Aide33").centerPrint("Hello",3); will display that message for one client whose name best matches the one given. This is the same method the Client->CenterPrint event uses.

That is not the correct usage.
Here is the correct usage:
Code: [Select]
clientCmdCenterPrint("message", time in seconds);To see, try typing clientCmdCenterPrint("I will disapeear in 5 seconds!", 5); into the console.

This is assuming your trying to do it client-sidedly.
This works.
"input it in the console" won't work because %client hasn't been set, so it's not sending the message to anyone.

findClientByName("Aide33").centerPrint("Hello",3); will display that message for one client whose name best matches the one given. This is the same method the Client->CenterPrint event uses.
Nvm it works
« Last Edit: December 04, 2011, 06:11:21 PM by Aide33 »