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 4912 times)

I have a problem. When I do this command:
Code: [Select]
ServerCmdMessageSent(FindClientByName("%1"), "Add-Ons/Script_Smiley_System/Smileys/cool.png");It doesn't show my screen name, and it just shows the path. Help!

Replace %1 with your name
Replace the filepath with <bitmap:Add-Ons/Script_Smiley_System/Smileys/cool.png>

Thanks, but everyone on blockland doesn't have the same name I have.

Thanks, but everyone on blockland doesn't have the same name I have.
Okay, I don't see the issue? What are you trying to do?

Could you please tell us what you're doing? Are you trying to make it so whenever ANYONE talks, it displays a image?

EDIT: Oh, Ipquarx beat me to it.

EDIT EDIT:

Maybe you are trying to do this?

Code: [Select]
for (%a=0; %a < ClientGroup.getcount(); %a++)
{
%cl=ClientGroup.getObject(%a);
        ServerCmdMessageSent(%cl, "<bitmap:Add-Ons/Script_Smiley_System/Smileys/cool.png>");
}

This small script with find everyone client on the server, then force them to say that.
« Last Edit: December 03, 2012, 07:26:24 PM by Honorabl3 »

The issue is solved... But my screen name doesn't show up and I'm sure that everyone doesn't have the same screen name that I have.

Code: [Select]
        ServerCmdMessageSent(%cl, "<bitmap:Add-Ons/Script_Smiley_System/Smileys/cool.png>");
this will not work, you'll have to override serverCmdMessageSent so it doesn't strip ML control chars
thing is, people could abuse that to forget up the chat so..
« Last Edit: December 03, 2012, 07:39:10 PM by Scars75 »


Not sure if this will work, try it out
Code: [Select]
package smileyChat{
function ServerCmdMessageSent(%cl, %msg){
%msg = stripMLControlChars(%msg);
%msg = strReplace(%msg, "8)", "<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);
}
};
activatePackage(smileyChat);
Type 8) in the chat to get the cool smiley

Type 8) in the chat to get the cool smiley
type 8888888 to get cool smiley cool smiley cool smiley cool smiley cool smiley cool smiley cool smiley!

Not sure if this will work, try it out
Code: [Select]
package smileyChat{
function ServerCmdMessageSent(%cl, %msg){
%msg = stripMLControlChars(%msg);
%msg = strReplace(%msg, "8)", "<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);
}
};
activatePackage(smileyChat);
Type 8) in the chat to get the cool smiley

Oh dear God don't butcher the chat system like that.

Do something like this:
Code: [Select]
package smileyChat
{
function serverCmdMessageSent(%cl, %msg)
{
%msg = strReplace(%msg, "8)", "<bitmap:Add-Ons/Script_Smiley_System/Smileys/cool.png>");
parent::serverCmdMessageSent(%cl,%msg);
}
};
activatePackage(smileyChat);

Edit: Sorry, forgot that the parent::serverCmdMessageSent will filter out the image tags, but still, don't do what you had earlier.
« Last Edit: December 03, 2012, 08:28:23 PM by Greek2me »

Oh dear God don't butcher the chat system like that.

Do something like this:
Code: [Select]
package smileyChat
{
function serverCmdMessageSent(%cl, %msg)
{
%msg = strReplace(%msg, "8)", "<bitmap:Add-Ons/Script_Smiley_System/Smileys/cool.png>");
parent::serverCmdMessageSent(%cl,%msg);
}
};
activatePackage(smileyChat);

Edit: Sorry, forgot that the parent::serverCmdMessageSent will filter out the image tags, but still, don't do what you had earlier.
Either I'm blind, or what, but there's a syntax error in line 3, but all it is its just{}'s
« Last Edit: December 03, 2012, 08:45:37 PM by Quinn Mallory »

Either I'm blind, or what, but there's a syntax error in line 3, but all it is its just{}'s

I'm pretty sure you're blind.

I'm pretty sure you're blind.
I was being sacastic about that. But there is a error on line 3. What's the dilleo?
« Last Edit: December 03, 2012, 08:56:42 PM by Quinn Mallory »

Thanks, but everyone on blockland doesn't have the same name I have.
And not everyone has the name %1 so I'm not sure what point you're trying to make