Poll

Do you think this can get better in the future?

Yes, I can see that this will be successful with the right coding.
1 (100%)
Yes
0 (0%)
Maybe
0 (0%)
No
0 (0%)
No, this might as well be tossed into the failed addons folder left to die
0 (0%)
I can't confirm or deny about this.
0 (0%)

Total Members Voted: 1

Author Topic: Coding issue  (Read 4878 times)

And not everyone has the name %1 so I'm not sure what point you're trying to make
If you type %1 in blockland in the chat, welcome message, etc. it will show the players name.

It maybe my fault...I dunno...

If you type %1 in blockland in the chat, welcome message, etc. it will show the players name.
that only works in a few cases, and for the viewer's own name
for scripting you should use client.name

Could I use it without changing the datablock like:
Code: [Select]
ServerCmdMessageSent(FindClientByName("%client.name"), <bitmap:Add-Ons/Client_Smiley_System/Smileys/cool.png>

Your code isn't going to work.
Can you better explain what you want to do?

I'm trying to make it where when someone says :) it gives the smiley instead...

I'm trying to make it where when someone says :) it gives the smiley instead...
Code: [Select]
function ServerCmdMessageSent(%cl, %msg){
%msg = stripMLControlChars(%msg);
%msg = strReplace(%msg, ":)", "<bitmap:Add-Ons/Script_Smiley_System/Smileys/cool.png>");
messageAll(' ', "<color:666666>" @ %cl.clanPrefix @ "<color:FFFF00>" @ %cl.name @ "<color:666666>" @ %cl.clanSuffix @ "<color:FFFFFF>" @ ": " @ %msg);
}

Good job breaking spam filtering and using messageAll instead of client::chatmessage

Instead of overwriting the function and breaking things, you'd want to package it, parse through the string message and add the bitmap that way.
« Last Edit: December 04, 2012, 04:45:29 PM by elm »

Instead of overwriting the function and breaking things, you'd want to package it, parse through the string message and add the bitmap thay way.
packaging it will filter out the image tags, you'll need to basically remake the function without that one line of code

packaging it will filter out the image tags, you'll need to basically remake the function without that one line of code
What is stopping you from putting it back in after it was removed

packaging it will filter out the image tags, you'll need to basically remake the function without that one line of code

You should learn a bit more TS before trying to help others.

What is stopping you from putting it back in after it was removed
You should learn a bit more TS before trying to help others.
serverCmdMessageSent uses stripMLControlChars on the message before it sends it. if you package it and use parent::serverCmdMessageSent(%cl, %msg);, it will filter out the image tags and send it before it runs the rest of the code in the package.

So, use his/her code?
Code: [Select]
function ServerCmdMessageSent(%cl, %msg){
%msg = stripMLControlChars(%msg);
%msg = strReplace(%msg, ":)", "<bitmap:Add-Ons/Script_Smiley_System/Smileys/cool.png>");
messageAll(' ', "<color:666666>" @ %cl.clanPrefix @ "<color:FFFF00>" @ %cl.name @ "<color:666666>" @ %cl.clanSuffix @ "<color:FFFFFF>" @ ": " @ %msg);
}
« Last Edit: December 04, 2012, 05:47:58 PM by Quinn Mallory »