class presetbuildChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
char *preset = (char *)Text[1].c_str();
Vector3 position;
position = Commands->Get_Position(obj);
position.Z += 0;
position.X += (float)(5*cos(Commands->Get_Facing(Get_GameObj(ID))*(3.14 / 180)));
position.Y += (float)(5*sin(Commands->Get_Facing(Get_GameObj(ID))*(3.14 / 180)));
Commands->Create_Object(preset, position);
Console_Input(StrFormat("msg WORKS!").c_str());
Commands->Set_Facing(obj, Commands->Get_Facing(obj) - 180);
}
};
ChatCommandRegistrant<presetbuildChatCommand> presetbuildChatCommandReg("!pbuild",CHATTYPE_ALL,1,GAMEMODE_AOW);
I would just check where the position is because you are altering it, I've had enough core 4 [intergration of trig functions] this year so I'm not checking it.
My other advice would be to make sure you are sending a valid preset as found in renedit.