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
any help?
[Updated on: Fri, 07 October 2011 17:01]
Report message to a moderator