Re: Code Release - !ping command [message #313110 is a reply to message #313097] |
Wed, 23 January 2008 10:10 |
|
jnz
Messages: 3396 Registered: July 2006 Location: 30th century
Karma:
|
General (3 Stars) |
|
|
Cat998 wrote on Wed, 23 January 2008 15:58 |
class PingChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
char msg[256];
sprintf(msg, "message %s, your ping is %d.", Get_Player_Name_By_ID(ID), Get_Ping(ID));
Console_Input(msg);
}
};
ChatCommandRegistrant<PingChatCommand> PingChatCommandReg("!ping",CHATTYPE_ALL,0,GAMEMODE_ALL);
|
memory leak.
class PingChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
char msg[256];
sprintf(msg, "message %S, your ping is %d.", Get_Wide_Player_Name_By_ID(ID), Get_Ping(ID));
Console_Input(msg);
}
};
ChatCommandRegistrant<PingChatCommand> PingChatCommandReg("!ping",CHATTYPE_ALL,0,GAMEMODE_ALL);
[Updated on: Wed, 23 January 2008 10:41] Report message to a moderator
|
|
|