Author |
Message |
TheOne Newbie

Age:41 Gender: Joined: Sep 04 2005 Posts: 17 Offline
|
Posted: Fri May 26, 2006 5:07 pm Post subject: Sending PM to specified user. |
 |
|
|
|
Problem Solved
Could anyone help me out with a small command? I've been trying to make a command that will PM a specified user with a given message. Possibly to be later used as a warn feature. (!warn name:message)
Ex. !pm Testguy:Testmessage
So far, I've gotten it to send a PM to the player, but it's always a remote PM. I tried changing sendRemotePrivate to sendPrivate, but I get an error every time.
Any help would be greatly appreciated. Thanks.
else if (c.check("pm"))
{
tolower(c.final);
String pm = c.final;
String name, message;
char xname[256], xmessage[256];
name = pm.split(':');
message = pm.split(':');
sprintf(xname, "%s", name);
sprintf(xmessage, "%s", message);
h->sendRemotePrivate(xname,xmessage);
//Just a test...
//String k;
//k += p->name;
//k += " says: ";
//k += xmessage;
//h->sendRemotePrivate(xname,k.msg);
} |
Last edited by TheOne on Fri May 26, 2006 5:41 pm, edited 1 time in total |
|
Back to top |
|
 |
Purge Episode I > Eposide III Jar-Jar is kool

Age:35 Gender: Joined: Sep 08 2004 Posts: 2019 Offline
|
Posted: Fri May 26, 2006 5:13 pm Post subject: |
 |
|
|
|
Why are you treating Command c as a char? Use it as a pointer in command.cpp. |
|
Back to top |
|
 |
TheOne Newbie

Age:41 Gender: Joined: Sep 04 2005 Posts: 17 Offline
|
Posted: Fri May 26, 2006 5:41 pm Post subject: |
 |
|
|
|
Actually, nevermind. I figured it out. |
|
Back to top |
|
 |
Bak ?ls -s 0 in

Age:26 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Sat May 27, 2006 12:19 am Post subject: |
 |
|
|
|
<cough> buffer overflow |
|
Back to top |
|
 |
|