Wall command
class WallChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID); //Gets the gameobj of the player using the command.
if (obj) {
Vector3 Pos = Commands->Get_Position(obj);
Pos.X += 3.0f;
GameObject *Wall = Commands->Create_Object("GDI_Humm-vee_Player",Pos);
Commands->Set_Model(Wall,"whatever");
Console_Input(StrFormat("ppage %d Wall... Created",ID).c_str());
}
}
};
ChatCommandRegistrant<WallChatCommand> WallChatCommandReg("!wall",CHATTYPE_ALL,0,GAMEMODE_ALL);
The following will take the first word that comes after the command, treat it as a nick, and try to get the gameobj associated with it.
GameObject *obj = Get_GameObj_By_Player_Name(Text[1].c_str());