Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » chatcommand
chatcommand [message #457083] Fri, 07 October 2011 11:54 Go to next message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
ive been trying to understand the new keyhook and ive mastered as far as i need it.

but id like that if someone presses a key the server acts as if someone typed a certain chatcommand

it used to work with ssgm_chatcommand something and ive looked at it , but i have no clue how it works

im trying this virtual void:
struct Datastruct
{//triggers a chat command in some way
	virtual void Trigger_Chat_Command(int ID,int Type,const StringClass &Command,const TokenClass &Text);
};
Datastruct *Data;

void KB_keyhook::Detach(GameObject *obj)
{
	JFW_Key_Hook_Base::Detach(obj);
}

void KB_keyhook::Created(GameObject *obj)
{
	enabled = true;
	hookid = 0;
	k = 0;
	time = true;
	InstallHook(Get_Parameter("Key"),obj);
	LastPress = The_Game()->Get_Game_Duration_S()-5;
}
void KB_keyhook::KeyHook()
{
	Data->Trigger_Chat_Command(Get_Player_ID(Owner()),Get_Int_Parameter("ChatType"),Get_Parameter("Command"),TokenClass());
}
ScriptRegistrant<KB_keyhook> KB_keyhook_Registrant("KB_keyhook","Key:string,Command:string,ChatType:integer");


wich was the way it worked if im lucky it works otherwise ill edit my post here

NO LUCK Sad

any help?


Owner of kambot TT server

kambot.freeforums.org

[Updated on: Fri, 07 October 2011 17:01]

Report message to a moderator

Re: chatcommand [message #457109 is a reply to message #457083] Fri, 07 October 2011 17:22 Go to previous messageGo to next message
snazy2000 is currently offline  snazy2000
Messages: 67
Registered: December 2007
Karma: 0
Recruit
Your better off just doing this


void KB_keyhook::KeyHook()
{
     // Do The Chat Command
}
ScriptRegistrant<KB_keyhook> KB_keyhook_Registrant("KB_keyhook","");




Were you have Do Chat Command put the command in the KeyHook so put the fiscal code in there, the triger_chat_Command does to exist in the new SSGM becuase all of the command class has been removed

[Updated on: Fri, 07 October 2011 17:22]

Report message to a moderator

Re: chatcommand [message #457111 is a reply to message #457083] Fri, 07 October 2011 17:43 Go to previous messageGo to next message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
i dont really understand what your trying to say. sorry

can i trigger Onchat manually?

e.g
Kambot::OnChat(Get_Player_ID(Owner()),TEXT_MESSAGE_PUBLIC,command,0);


Owner of kambot TT server

kambot.freeforums.org

[Updated on: Fri, 07 October 2011 19:09]

Report message to a moderator

Re: chatcommand [message #457244 is a reply to message #457111] Sat, 08 October 2011 00:10 Go to previous messageGo to next message
snazy2000 is currently offline  snazy2000
Messages: 67
Registered: December 2007
Karma: 0
Recruit
No i mean so if lets say you had a chat command

!help

the code could be

Console_Input("msg Help Me Bla Bla Bla");

and you wanted that to come up on keypress


you would put


void KB_keyhook::KeyHook()
{
Console_Input("msg Help Me Bla Bla Bla");
}
ScriptRegistrant<KB_keyhook> KB_keyhook_Registrant("KB_keyhook","");
Re: chatcommand [message #457270 is a reply to message #457083] Sat, 08 October 2011 06:25 Go to previous message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
ah but i cant use host because i need the player team,id,position etc in most chatcommand functions

how does tmsg work cause it says it talks to teamchat as if it was <playerID> but it wispers to host

i just found out that tmsg is bugged i think with tmessage my problem is fixed thnx for help


Owner of kambot TT server

kambot.freeforums.org

[Updated on: Sat, 08 October 2011 10:07]

Report message to a moderator

Previous Topic: gameobject lists-> which&when
Next Topic: TCW Tropical [wip]
Goto Forum:
  


Current Time: Thu Nov 28 20:46:58 MST 2024

Total time taken to generate the page: 0.00715 seconds