Ok guys, here is a chat hook i made and i want to share it
TurnON
class e_onChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
GameObject *veh = Get_Vehicle(obj);
Console_Input(StrFormat("cmsg 166,149,56 [BSS: Engine is on!] ").c_str());
Commands->Enable_Engine(veh,1);
}
};
ChatCommandRegistrant<e_onChatCommand> e_onChatCommandReg("!engine_on",CHATTYPE_ALL,0,GAMEMODE_AOW);
TurnOFF
class e_offChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
GameObject *veh = Get_Vehicle(obj);
Console_Input(StrFormat("cmsg 166,149,56 [BSS: Engine is off!] ").c_str());
Commands->Enable_Engine(veh,0);
}
};
ChatCommandRegistrant<e_offChatCommand> e_offChatCommandReg("!engine_off",CHATTYPE_ALL,0,GAMEMODE_AOW);
Just put them both in gmmain.cpp and it will work. (for begginers)
Usage: !engine_on = turn on the engine. !engine_off = turn off the engine!
Have fun