Thanks Reborn. Could someone check if this is right? It works but is this an ok way to do it?. Should i add something more?
I added these lines to my !ramp command
int playerid = Get_Player_ID(obj);
vector2d[playerid].push_back(Commands->Get_ID(turret)); // Turret = the object
And this is what the !sellall command looks like
class sellallChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
int playerid = Get_Player_ID(obj);
for (unsigned int i=0; i<vector2d[playerid].size(); i++) // Loop through all the object if there are any.
{
Commands->Destroy_Object(Commands->Find_Object(vector2d[playerid][i]));
}
vector2d[playerid].clear(); // clears all the elements in the vector.
}
};
ChatCommandRegistrant<sellallChatCommand> sellallChatCommandReg("!sellall",CHATTYPE_ALL,0,GAMEMODE_AOW);
[Updated on: Sun, 03 January 2010 05:28]
Report message to a moderator