Server Help

Bot Questions - Codes

Oer The Dragon - Sun Jul 03, 2005 3:26 pm
Post subject: Codes
how do you know what to write to make a plugin do something? like is there a list of commands to write or do you have to figure it out yourself (guessing) lol
Bak - Sun Jul 03, 2005 3:32 pm
Post subject:
if you go through all the #includes all the functions are in there. The rest is just basic syntax.

for example in spawns.h we see the headers for the chat functions:

Code: Show/Hide
void sendPrivate(Player *player, char *msg);
void sendPrivate(Player *player, BYTE snd, char *msg);

void sendTeam(char *msg);
void sendTeam(BYTE snd, char *msg);

void sendTeamPrivate(Uint16 team, char *msg);
void sendTeamPrivate(Uint16 team, BYTE snd, char *msg);

void sendPublic(char *msg);
void sendPublic(BYTE snd, char *msg);

void sendPublicMacro(char *msg);
void sendPublicMacro(BYTE snd, char *msg);

void sendChannel(char *msg);         // #;Message
void sendRemotePrivate(char *msg);      // :Name:Messsage
void sendRemotePrivate(char *name, char *msg);


so if we wanted to send a public message we could just call sendPublic with a char* and it would send it.

so like

char* helloMessage = "hello";
sendPublic(helloMessage);

or simply

sendPublic("hello");
Assassin2684 - Sun Jul 03, 2005 4:26 pm
Post subject:
Ya like with me learning C++ I was wondering the same thing. I think we get this stuff in the tutorial on http://catid.ssihosting.com/
Oer The Dragon - Mon Jul 04, 2005 2:27 am
Post subject:
Quote:
if you go through all the #includes all the functions are in there. The rest is just basic syntax.


Thanks icon_biggrin.gif, didn't know that
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group