Server Help

Bot Questions - Sending PM to specified user.

TheOne - 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.

Code: Show/Hide
      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);
      }

Purge - 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.
TheOne - Fri May 26, 2006 5:41 pm
Post subject:
Actually, nevermind. I figured it out.
Bak - Sat May 27, 2006 12:19 am
Post subject:
<cough> buffer overflow
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group