weird reaction with const w_chart [message #464060] |
Fri, 09 March 2012 06:21 |
robbyke
Messages: 348 Registered: September 2010 Location: Belgium
Karma:
|
Recruit |
|
|
::onchat call
Toggle Spoiler
bool Kambot::OnChat(int PlayerID,TextMessageEnum Type,const wchar_t *Message,int recieverID)
{
Kambot_Commands(PlayerID,Type,Message,recieverID);
return true;
}
start of the called function
Toggle Spoiler
void Kambot_Commands(int PlayerID,TextMessageEnum Type,const wchar_t *Message,int recieverID)
{
Console_Input("msg functie ok");
StringClass Msg;
Msg.Format("msg %s",Message);
Console_Input(Msg);
if (wcsstr(Message,L"!") != NULL)
{
Console_Input("msg message ok");
keyhook function
Toggle Spoiler
void KB_keyhook::KeyHook()
{
if((The_Game()->Get_Game_Duration_S() - LastPress) >= 1){
StringClass Msg;
const wchar_t* message = (const wchar_t*)Get_Parameter("Command");
Kambot_Commands(Get_Player_ID(Owner()),TEXT_MESSAGE_TEAM,message,-1);
Msg.Format("msg %s",(const wchar_t*)Get_Parameter("Command"));
Console_Input(Msg);
LastPress = The_Game()->Get_Game_Duration_S();
}
}
ScriptRegistrant<KB_keyhook> KB_keyhook_Registrant("KB_keyhook","Key:string,Command:string");
what happens:
if i use a command in game the command works.
but the message is just a ! according to the game
but when i use my chathook the message is more and the command wont work
now i wonder what i do wrong.
probably my conversion.
Owner of kambot TT server
kambot.freeforums.org
|
|
|