void KAK_Spectator_Mode::Created(GameObject *obj) {
if (Commands->Get_ID(Get_Vehicle_Return(obj)) != Commands->Get_ID(obj)) Commands->Apply_Damage(Get_Vehicle(obj),99999,"Explosive",0);
Commands->Disable_Physical_Collisions(obj);
Commands->Set_Model(obj,"None");
Toggle_Fly_Mode(obj);
Commands->Set_Is_Visible(obj,false);
Commands->Give_Powerup(obj,"POW_Ammo_Regeneration",false);
Commands->Start_Timer(obj,this,0.1f,1);
}
void KAK_Spectator_Mode::Damaged(GameObject *obj, GameObject *damager, float damage) {
if (Commands->Get_Player_Type(damager) < 2) Commands->Set_Player_Type(obj,Commands->Get_Player_Type(damager));
Commands->Set_Health(obj,Commands->Get_Max_Health(obj));
Commands->Set_Shield_Strength(obj,Commands->Get_Max_Shield_Strength(obj));
}
void KAK_Spectator_Mode::Custom(GameObject *obj, int message, int param, GameObject *sender) {
if (message == 2520) {
Commands->Destroy_Object(obj);
Destroy_Script();
}
}
void KAK_Spectator_Mode::Timer_Expired(GameObject *obj, int number) {
if (number == 1) {
Commands->Select_Weapon(obj,"Weapon_MineTimed_Player");
Commands->Start_Timer(obj,this,0.1f,1);
}
}
ScriptRegistrant<KAK_Spectator_Mode> KAK_Spectator_Mode_Registrant("KAK_Spectator_Mode","");
class KAK_Spectator_Mode : public ScriptImpClass {
void Damaged(GameObject *obj, GameObject *damager, float damage);
void Custom(GameObject *obj, int message, int param, GameObject *sender);
void Created(GameObject *obj);
void Timer_Expired(GameObject *obj, int number);
int OriginalTeam;
};