its a bit crude how it works but it works lol joining and leaving spectators kind of bugged atm, it doesnt 'toggle fly' correctly join spec and then press number 1 on keypad and then type !fly in F3 remember to add a section [Spectators] in ssaow.ini and enter nicknames like: Duke=1 to allow that nick to use spec ######################### aow.cpp bool Is_Allowed_To_Spectate(GameObject *obj) { if (!obj) return false; char Allowed[256]; Settings->INI->Get_String("Spectators",Get_Player_Name(obj),"0",Allowed,255); std::string Ret = Allowed; if (Ret == "0") return false; else if (Ret == "1") return true; else return false; } void Chat(int ID, int Type, const wchar_t *Msg2) { GameObject *obj = Get_GameObj(ID); std::string brenlog; if (Type == 2) return; if (Settings->Gamelog && Settings->NewGamelog) Gamelog_Chat_Hook(ID,Type,Msg2); if (Type == 1) { std::string Msg = WideCharToString(Msg2); if (stricmp(Msg.c_str(),"!spec") == 0) { if (Is_Allowed_To_Spectate(obj)) { Commands->Send_Custom_Event(obj,obj,2223,12,0.1f);//change team to 2 } } else if (stricmp(Msg.c_str(),"!unspec") == 0) { if (Is_Allowed_To_Spectate(obj)) { Commands->Send_Custom_Event(obj,obj,2222,22,0.1f);//despacte... } } else if (stricmp(Msg.c_str(),"!fly") == 0) { if (Is_Allowed_To_Spectate(obj)) { Toggle_Fly_Mode(obj); } } MDB_SSAOW_Player: if (Is_Allowed_To_Spectate(obj)) { Commands->Attach_Script(obj,"MDB_Taunt_Key","Radio5,h_a_d2c5"); Commands->Attach_Script(obj,"MDB_Taunt_Key","Radio6,h_a_d2c5"); Commands->Attach_Script(obj,"MDB_Taunt_Key","Radio7,h_a_d2c5"); } void M00_GrantPowerup_Created::Created(GameObject *obj) { if (Commands->Get_Player_Type(obj) == 2) { if (Commands->Is_A_Star(obj)) { Is_Currently_Spectating = true; execute = true; } } else { Is_Currently_Spectating = false; execute = true; } if (Data->Mod || !Commands->Is_A_Star(obj)) { Commands->Give_Powerup(obj,Get_Parameter("WeaponDef"),false); } } void M00_GrantPowerup_Created::Custom(GameObject *obj,int message,int param,GameObject *sender) { if (message == 2223) { if (!Is_Currently_Spectating) { if (execute) { if (param == 12) { char tc[200]; sprintf(tc,"team2 %d 2",Get_Player_ID(obj)); Console_Input(tc); char tcmsg[200]; sprintf(tcmsg,"%s joined the spectators.",Get_Player_Name(obj)); Send_Message(255,255,255,tcmsg); } } Commands->Start_Timer(obj,this,0.5f,673); execute = false; } } if (message == 2222) { if (Is_Currently_Spectating) { if (execute) { execute = false; Commands->Start_Timer(obj,this,0.5f,673); if (param == 1)//Keypad_1_Key GDI BAR { Commands->Start_Timer(obj,this,0.5f,673); if (Find_Building(1,SOLDIER_FACTORY)) { GameObject *abar = Find_Building(1,SOLDIER_FACTORY); Vector3 GotoLocation = Commands->Get_Position(abar); GotoLocation.Z += 30.0f; Commands->Set_Position(obj,GotoLocation); } else { Send_Message_Player(obj,255,255,255,"There is no GDI Barracks on this map n00b :P"); } } else if (param == 2)//Keypad_2_Key SOUTH { Commands->Start_Timer(obj,this,0.5f,673); Vector3 GotoLocation = Commands->Get_Position(obj); GotoLocation.Y -= 100.0f; Commands->Set_Position(obj,GotoLocation); } else if (param == 3)//Keypad_3_Key GDI REF { Commands->Start_Timer(obj,this,0.5f,673); if (Find_Building(1,REFINERY)) { GameObject *allieddome = Find_Building(1,REFINERY); Vector3 GotoLocation = Commands->Get_Position(allieddome); GotoLocation.Z += 30.0f; Commands->Set_Position(obj,GotoLocation); } else { Send_Message_Player(obj,255,255,255,"There is no GDI Refinery on this map n00b :P"); } } else if (param == 4)//Keypad_4_Key WEST { Commands->Start_Timer(obj,this,0.5f,673); Vector3 GotoLocation = Commands->Get_Position(obj); GotoLocation.X -= 100.0f; Commands->Set_Position(obj,GotoLocation); } else if (param == 5)//Keypad_5_Key POSITION Z UP { Commands->Start_Timer(obj,this,0.5f,5432); Vector3 GotoLocation = Commands->Get_Position(obj); GotoLocation.Z += 30.0f; Commands->Set_Position(obj,GotoLocation); } else if (param == 6)//Keypad_6_Key EAST { Commands->Start_Timer(obj,this,0.5f,673); Vector3 GotoLocation = Commands->Get_Position(obj); GotoLocation.X += 100.0f; Commands->Set_Position(obj,GotoLocation); } else if (param == 7)//Keypad_7_Key NOD HAND { Commands->Start_Timer(obj,this,0.5f,673); if (Find_Building(0,SOLDIER_FACTORY)) { GameObject *sbar = Find_Building(0,SOLDIER_FACTORY); Vector3 GotoLocation = Commands->Get_Position(sbar); GotoLocation.Z += 30.0f; Commands->Set_Position(obj,GotoLocation); } else { Send_Message_Player(obj,255,255,255,"There is no Hand of Nod on this map n00b :P"); } } else if (param == 8)//Keypad_8_Key NORTH { Commands->Start_Timer(obj,this,0.5f,673); Vector3 GotoLocation = Commands->Get_Position(obj); GotoLocation.Y += 100.0f; Commands->Set_Position(obj,GotoLocation); } else if (param == 9)//Keypad_1_Key NOD REF { Commands->Start_Timer(obj,this,0.5f,673); if (Find_Building(0,REFINERY)) { GameObject *sovdome = Find_Building(0,REFINERY); Vector3 GotoLocation = Commands->Get_Position(sovdome); GotoLocation.Z += 30.0f; Commands->Set_Position(obj,GotoLocation); } else { Send_Message_Player(obj,255,255,255,"There is no Nod Refinery on this map n00b :P"); } } else if (param == 10)//Keypad_0_Key POSITION Z DOWN { Commands->Start_Timer(obj,this,0.5f,673); Vector3 GotoLocation = Commands->Get_Position(obj); GotoLocation.Z -= 30.0f; Commands->Set_Position(obj,GotoLocation); } else if (param == 22) { int rt = Commands->Get_Random_Int(1,7); if ((rt == 1) || (rt == 2) || (rt == 3)) { char tc1[200]; sprintf(tc1,"team2 %d 1",Get_Player_ID(obj)); Console_Input(tc1); char tc1msg[200]; sprintf(tc1msg,"%s left the spectators and randomly joined GDI.",Get_Player_Name(obj)); Send_Message(255,255,255,tc1msg); } else { char tc2[200]; sprintf(tc2,"team2 %d 0",Get_Player_ID(obj)); Console_Input(tc2); char tc2msg[200]; sprintf(tc2msg,"%s left the spectators and randomly joined Nod.",Get_Player_Name(obj)); Send_Message(255,255,255,tc2msg); } } } } } } void M00_GrantPowerup_Created::Timer_Expired(GameObject *obj,int number) { if (number == 673) { execute = true; } if (number == 2001) { Toggle_Fly_Mode(obj); } } ######################### aow.h bool Is_Allowed_To_Spectate(GameObject *obj); class M00_GrantPowerup_Created : public ScriptImpClass { void Created(GameObject *obj); void Custom(GameObject *obj,int message,int param,GameObject *sender); void Timer_Expired(GameObject *obj,int number); bool execute; bool Is_Currently_Spectating; }; ######################### keyhook.cpp void MDB_Taunt_Key::Created(GameObject *obj) { if (Commands->Is_A_Star(obj)) { spec = obj; } else { spec = 0; } if (Commands->Get_Player_Type(obj) == 2) { if (Commands->Is_A_Star(obj)) { spectator = obj; Set_Skin(obj,"blamo"); Commands->Set_Is_Visible(obj,false); Commands->Set_Shield_Type(obj,"blamo"); Commands->Set_Model(obj,"null"); Commands->Clear_Weapons(obj); } else { spectator = 0; } } else { spectator = 0; } if (is_keyhook_set != 1337) { hookid = AddHook(Get_Parameter("Key"),obj); is_keyhook_set = 1337; } } void MDB_Taunt_Key::KeyHookFunc() { if (spectator) { if (Get_Vehicle(Owner()) == 0) { if (stricmp(Get_Parameter("Key"),"Taunt1") == 0) { Commands->Send_Custom_Event(spectator,spectator,2222,1,0.1f); } else if (stricmp(Get_Parameter("Key"),"Taunt2") == 0) { Commands->Send_Custom_Event(spectator,spectator,2222,2,0.1f); } else if (stricmp(Get_Parameter("Key"),"Taunt3") == 0) { Commands->Send_Custom_Event(spectator,spectator,2222,3,0.1f); } else if (stricmp(Get_Parameter("Key"),"Taunt4") == 0) { Commands->Send_Custom_Event(spectator,spectator,2222,4,0.1f); } else if (stricmp(Get_Parameter("Key"),"Taunt5") == 0) { Commands->Send_Custom_Event(spectator,spectator,2222,5,0.1f); } else if (stricmp(Get_Parameter("Key"),"Taunt6") == 0) { Commands->Send_Custom_Event(spectator,spectator,2222,6,0.1f); } else if (stricmp(Get_Parameter("Key"),"Taunt7") == 0) { Commands->Send_Custom_Event(spectator,spectator,2222,7,0.1f); } else if (stricmp(Get_Parameter("Key"),"Taunt8") == 0) { Commands->Send_Custom_Event(spectator,spectator,2222,8,0.1f); } else if (stricmp(Get_Parameter("Key"),"Taunt9") == 0) { Commands->Send_Custom_Event(spectator,spectator,2222,9,0.1f); } else if (stricmp(Get_Parameter("Key"),"PoolInfo") == 0) { Commands->Send_Custom_Event(spectator,spectator,2222,10,0.1f); } } } else { if (Get_Vehicle(Owner()) == 0) { Commands->Set_Animation(Owner(),Get_Parameter("Anim"),false,0,0.0f,-1.0f,false); } } if (spec) { if (Get_Vehicle(Owner()) == 0) { if (stricmp(Get_Parameter("Key"),"Radio6") == 0)//spec F11 { Commands->Send_Custom_Event(spec,spec,2223,12,0.1f); } else if (stricmp(Get_Parameter("Key"),"Radio7") == 0)//unspec F12 { Commands->Send_Custom_Event(spec,spec,2222,22,0.1f); } } } if (stricmp(Get_Parameter("Key"),"Radio5") == 0) { if (Is_Allowed_To_Spectate(spec)) { Toggle_Fly_Mode(spec); } } } void MDB_Taunt_Key::Register_Auto_Save_Variables() { Auto_Save_Variable(1,4,&spectator); Auto_Save_Variable(1,4,&spec); } ######################### keyhook.h class MDB_Taunt_Key : public MDB_KeyHook { void Created(GameObject *obj); void KeyHookFunc(); void Register_Auto_Save_Variables(); GameObject *spectator; GameObject *spec; };