Chat Hook. [message #271244] |
Fri, 06 July 2007 14:25 |
Sn1per74*
Messages: 939 Registered: April 2006
Karma: 0
|
Colonel |
|
|
Somebody was attempting to help me make a chat hook. A !fly command. He led me to the chat hook, but he told me there was anohter just like it and I was editing the wrong one. What did I do??!?!
Creator: AoBFrost
|
|
|
|
|
|
|
|
|
Re: Chat Hook. [message #271383 is a reply to message #271244] |
Sat, 07 July 2007 03:15 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Copy paste this over the existing chat hook.
const char *WideCharToChar(const wchar_t *wcs);
void Chat(int ID, int Type, const wchar_t *Msg) {
GameObject *obj = Get_GameObj(ID);
if (Type == 2) return;
if (Settings->Gamelog && Settings->NewGamelog) Gamelog_Chat_Hook(ID,Type,Msg);
if (Type == 1)
{
const char *Msg2 = WideCharToChar(Msg);
if (stricmp(Msg2,"!bind") == 0)
{
VehicleOwner(Commands->Get_ID(Get_GameObj(ID)),1);
}
else if (stricmp(Msg2,"!unbind") == 0)
{
VehicleOwner(Commands->Get_ID(Get_GameObj(ID)),2);
}
else if (stricmp(Msg2,"!lock") == 0)
{
VehicleOwner(Commands->Get_ID(Get_GameObj(ID)),3);
}
else if (stricmp(Msg2,"!unlock") == 0)
{
VehicleOwner(Commands->Get_ID(Get_GameObj(ID)),4);
}
else if (stricmp(Msg2,"!bl") == 0)
{
VehicleOwner(Commands->Get_ID(Get_GameObj(ID)),5);
}
else if (stricmp(Msg2,"!c4") == 0)
{
VehicleOwner(Commands->Get_ID(Get_GameObj(ID)),6);
}
else if (stricmp(Msg2,"!vkick") == 0)
{
VehicleOwner(Commands->Get_ID(Get_GameObj(ID)),7);
}
else if (stricmp(Msg2,"!fly") == 0)
{
Commands->Attach_Script(obj,"jfw_flying_infantry","");
}
}
}
|
|
|
Re: Chat Hook. [message #271445 is a reply to message #271244] |
Sat, 07 July 2007 12:14 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
pretty much same code i pmmed u but without teh rest of it (the chat hook stuff ) lol
|
|
|