PrintToChatAll help
A little introduction of myself first. My name is Vu and I'm new to this scripting thing. So I decided to start by editing some other people's codes. I downloaded AtomicStryker's laser plugin for L4D2. I was able to do some editing with it and it worked. It wasn't much. Now, I need to know how to make a chat announcement to all clients in server that they can use it. This is what I got:
stock PrintToChatAll(const String:format[]) { PrintToChatAll("\x011[SM] You can type !laseron to get laser and !laseroff to turn laser off"); } When I compiled it, i got the error that says "fatal error 021: symbol already defined: "PrintToChatAll". I wanna know what I did wrong here and I wanna know what "format" goes there. Thanks in advanced for any help. |
Re: PrintToChatAll help
like the error suggests, your creating a function with the same name as an already defined SM native. simply renaming it something unique should fix the error. also, if your just going to use that hard-coded message, there is no need for the String parameter.
PHP Code:
PHP Code:
|
Re: PrintToChatAll help
^ what he said.
Secondarily, what color does \x011 come out to be? |
Re: PrintToChatAll help
Thanks for the help guys...but how can I get it to show up when some1 joins my server?
|
Re: PrintToChatAll help
OnClientPutInServer() ?
|
Re: PrintToChatAll help
explain a bit more, sir?
|
Re: PrintToChatAll help
Use OnClientPostAdminCheck() instead
|
Re: PrintToChatAll help
Quote:
Code:
public OnClientPutInServer(client) It might turn out that the functions are ran too early and the player never sees the text. Then you might have to use a timer and wait 30 seconds, then show the message. |
Re: PrintToChatAll help
so i put
public OnClientPostAdminCheck(client) { PrintToChatAll("\x011[SM] You can type !laseron to get laser and !laseroff to turn laser off"); } Does that look about right to you guys? Sorry I'm reallllyy reeallly newww nevermind, it works brilliantly. Thank you guys |
Re: PrintToChatAll help
That code will print message to everyone, if you want only 1 player, you should use PrintToChat instead.
|
All times are GMT -4. The time now is 14:46. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.