This is something I made for Kamuix. You can use it for what you're trying to do.
else if (stricmp(Msg2,"!Deploy GuardTower") == 0) {
if (Get_Object_Type(obj) == 1) {
int Cost = 500;
char message[256];
GameObject *obj = Get_GameObj(ID);
if (Purchase_Item(obj,Cost)) {
Vector3 Pos = Commands->Get_Position(obj);
Pos.Z += 5;
GameObject *GT = Commands->Create_Object("GDI_Guard_Tower",Pos);
Commands->Disable_Physical_Collisions(GT);
sprintf(message,"msg Player %s has deployed a GDI Guard Tower",Get_Player_Name_By_ID(ID));
Console_Input(message);
}
else {
sprintf(message,"ppage %d Sorry, a Guard Tower costs $500",ID);
Console_Input(message);
}
}
}
[Updated on: Sun, 24 June 2007 20:26]
Report message to a moderator