Author Topic: Greeting script help  (Read 1006 times)

Another post dedicated to Pacnet2011.
---------------------------------------------------------
Quote from: Pacnet2011
I've got a problem with this script i was making. A greeting script. It doesn't say hello to someone but it does say bye to someone.
Example.

RootBeerDude connected.
(nothing)
RootBeerDude has left the game.
Pacnet2011: Bai, RootBeerDude

Here's the script

Code: [Select]
package greetmod
{
function newChatHud_addLine(%text)
{
Parent::newChatHud_addLine(%text);
%nameToGreet = strReplace(%text," connected.","");
if(%nameToGreet !$= %text)
{
commandtoserver('messagesent',"Hai, " @ %nameToGreet);
}
}
function newChatHud_addLine(%text)
{
Parent::newChatHud_addLine(%text);
%nameToGreet = strReplace(%text," has left the game.","");
if(%nameToGreet !$= %text)
{
commandtoserver('messagesent',"Bai, " @ %nameToGreet);
}
}
};
activatePackage(greetmod);


the second argument is messageclient(); is the type of message, and I believe messagedisconnect is an option, but I'm not sure if that is exactly how it is said.

Not sure how to package that on the client side, though.  Need to look up what clientcmd receives that

It's because your redefining the same function twice within the same package, so the game goes with the second redefinition of the function, which it the one containing the goodbye.
« Last Edit: June 28, 2011, 02:42:36 PM by Headcrab Zombie »

No.
Please no.
Autogreeter scripts are usually spam, and most decent hosts will force you to turn it off or kick you.
Please do not contribute to making an autogreeter.

It's because your redefining the same function twice within the same package, so the game goes with the second redefinition of the function, which it the one containing the goodbye.
thx


Why do you need an autogreeter, anyway?
Probably his hosting service.


isn't it "has connected." and not "connected."?


No.
Please no.
Autogreeter scripts are usually spam, and most decent hosts will force you to turn it off or kick you.
Please do not contribute to making an autogreeter.
Depends on the way you make them, my old version only sends out bout one to two lines of chat when you connect using the playerlist gui.


Anyway the way your making it, can be abused.
"
ChocoboPah connected.
PacNet: Hai, ChocoboPah
ChocoboPah: connected.
PacNet: Hai, ChocoboPah:
ChocoboPah: lol
ChocoboPah: conneted.
You have been muted for spamming.
"

and theres a found glitch that I saw with some autogreeters that if you say in chat Blocker: connected. LOL.
That the greeter will greet you and repeat your LOL. Message or whatever you typed in.

and theres a found glitch that I saw with some autogreeters that if you say in chat Blocker: connected. LOL.
That the greeter will greet you and repeat your LOL. Message or whatever you typed in.
That's because autogreeters are stuff.
A greeting doesn't mean anything if it's not personal.