This function checks and returns if whoever did !spec/!unspec is allowed to: bool Is_Allowed_To_Spectate(GameObject *obj) { const char *pname = Get_Player_Name(obj); if (!stricmp(pname,"zunnie")) return true; else if (!stricmp(pname,"Coolrock")) return true; else if (!stricmp(pname,"V0LK0V")) return true; else if (!stricmp(pname,"dudley")) return true; else if (!stricmp(pname,"Coolair")) return true; else if (!stricmp(pname,"BattleLaf")) return true; else if (!stricmp(pname,"metalfej")) return true; else if (!stricmp(pname,"danpaul88")) return true; else if (!stricmp(pname,"Sp4c3r")) return true; else if (!stricmp(pname,"Chronojam")) return true; else if (!stricmp(pname,"ChEmWaRsS")) return true; else if (!stricmp(pname,"ryan3k")) return true; else if (!stricmp(pname,"Akaranza")) return true; else if (!stricmp(pname,"AmunRa223")) return true; else if (!stricmp(pname,"NX01class")) return true; else if (!stricmp(pname,"m1garand8")) return true; else if (!stricmp(pname,"DooM663")) return true; else if (!stricmp(pname,"cuddling")) return true; else if (!stricmp(pname,"ididyamom")) return true; else if (!stricmp(pname,"seriousj7")) return true; else if (!stricmp(pname,"FMkillboy")) return true; else if (!stricmp(pname,"IWarriors")) return true; else if (!stricmp(pname,"ChopBam")) return true; else if (!stricmp(pname,"drunkill")) return true; else if (!stricmp(pname,"xocezert")) return true; else if (!stricmp(pname,"oxi")) return true; else if (!stricmp(pname,"ren00b")) return true; else if (!stricmp(pname,"Shaked")) return true; else if (!stricmp(pname,"Eggman891")) return true; else if (!stricmp(pname,"Strike")) return true; else if (!stricmp(pname,"sicanjal")) return true; else return false; } the !spec / !unspec command itself: else if (stricmp(Msg.c_str(),"!spec") == 0) { if (Is_Allowed_To_Spectate(obj)) { char pmsg[250]; char tcmsg[200]; char tc[200]; sprintf(pmsg,"pamsg %d Do NOT pickup ANY crates or ANY weapons, do NOT FIRE and do NOT enter vehicles or it WILL crash server!",Get_Player_ID(obj)); sprintf(tcmsg,"%s joined the spectators.",Get_Player_Name(obj)); sprintf(tc,"team2 %d 2",Get_Player_ID(obj)); Console_Input(pmsg); Send_Message(255,255,255,tcmsg); Console_Input(tc); } } else if (stricmp(Msg.c_str(),"!unspec") == 0) { if (Is_Allowed_To_Spectate(obj)) { char tcmsg[200]; char tc[200]; sprintf(tcmsg,"%s left the spectators.",Get_Player_Name(obj)); sprintf(tc,"team2 %d 1",Get_Player_ID(obj)); Send_Message(255,255,255,tcmsg); Console_Input(tc); } } Keyhook stuff from taunts: void KeyHookCall(void *Data) { MDB_KeyHook *Base = (MDB_KeyHook *)Data; Base->KeyHookFunc(); } int MDB_KeyHook::AddHook(const char *Key, GameObject *obj) { k = 0; k = new KeyHookStruct; k->data = this; k->hook = KeyHookCall; k->PlayerID = Get_Player_ID(obj); k->key = strdup(Key); if (is_keyhook_set == 1337) { RemoveHook(); } hookid = AddKeyHook(k); return hookid; } void MDB_KeyHook::RemoveHook() { if (hookid != 0 && RemoveKeyHook != 0) { RemoveKeyHook(hookid); hookid = 0; if (k != 0) { delete k; k = 0; } } } void MDB_KeyHook::Detach(GameObject *obj) { if (is_keyhook_set == 1337) { RemoveHook(); } } void MDB_KeyHook::Destroyed(GameObject *obj) { if (is_keyhook_set == 1337) { RemoveHook(); } } void MDB_Taunt_Key::Created(GameObject *obj) { if (Commands->Is_A_Star(obj)) { if (Commands->Get_Player_Type(obj) == 2) //if ptype = neutral, then spec = true { is_spectator = true; spectator = obj; Commands->Set_Is_Visible(spectator,false); } else { is_spectator = false; } } 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) { //when player press numpadkeys depending what key it is, it will send a messeage to theirself and execute: if (strstr(Get_Parameter("Anim"),"h_a_bodyslam"))//NumPad1 GOTO ALLIED BARRACKS { Commands->Send_Custom_Event(spectator,spectator,2222,1,0.1f); } else if (strstr(Get_Parameter("Anim"),"h_a_deathblast"))//NumPad2 MOVE SOUTH { Commands->Send_Custom_Event(spectator,spectator,2222,2,0.1f); } else if (strstr(Get_Parameter("Anim"),"h_a_deathblast2"))//NumPad3 GOTO ALLIED DOME { Commands->Send_Custom_Event(spectator,spectator,2222,3,0.1f); } else if (strstr(Get_Parameter("Anim"),"h_a_fly1"))//NumPad4 MOVE EAST { Commands->Send_Custom_Event(spectator,spectator,2222,4,0.1f); } else if (strstr(Get_Parameter("Anim"),"h_a_flykick"))//NumPad5 MOVE Z UP { Commands->Send_Custom_Event(spectator,spectator,2222,5,0.1f); } else if (strstr(Get_Parameter("Anim"),"h_a_legpain"))//NumPad6 MOVE WEST { Commands->Send_Custom_Event(spectator,spectator,2222,6,0.1f); } else if (strstr(Get_Parameter("Anim"),"h_a_cresentkick"))//NumPad7 GOTO SOVIET BAR { Commands->Send_Custom_Event(spectator,spectator,2222,7,0.1f); } else if (strstr(Get_Parameter("Anim"),"h_a_d2c5"))//NumPad8 MOVE NORTH { Commands->Send_Custom_Event(spectator,spectator,2222,8,0.1f); } else if (strstr(Get_Parameter("Anim"),"h_a_punchcombo"))//NumPad9 GOTO SOVIET DOME { Commands->Send_Custom_Event(spectator,spectator,2222,9,0.1f); } } } else { if (Get_Vehicle(Owner()) == 0) { //(GameObject *obj, const char *animation, bool loop, const char *subobject, float firstframe, float lastframe, bool blended); Commands->Set_Animation(Owner(),Get_Parameter("Anim"),false,0,0.0f,-1.0f,false); } } } void MDB_Taunt_Key::Register_Auto_Save_Variables() { Auto_Save_Variable(1,4,&spectator); } void M00_GrantPowerup_Created::Custom(GameObject *obj,int message,int param,GameObject *sender) { 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 ALL 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 Allied 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 ALLIED DOME { Commands->Start_Timer(obj,this,0.5f,673); if (Find_Building(1,COM_CENTER)) { GameObject *allieddome = Find_Building(1,COM_CENTER); 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 Allied Radar Dome on this map n00b :P"); } } else if (param == 4)//Keypad_4_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 == 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 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 == 7)//Keypad_7_Key SOV BAR { 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 Soviet Barracks 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 SOV DOME { Commands->Start_Timer(obj,this,0.5f,673); if (Find_Building(0,COM_CENTER)) { GameObject *sovdome = Find_Building(0,COM_CENTER); 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 Soviet Radar Dome on this map n00b :P"); } } } } } } void M00_GrantPowerup_Created::Timer_Expired(GameObject *obj,int number) { if (number == 673) { execute = true; } } void M00_GrantPowerup_Created::Register_Auto_Save_Variables() { Auto_Save_Variable(1, 4, &execute); Auto_Save_Variable(1, 4, &Is_Currently_Spectating); } Appearantly the taunts will now crash the server randomly and i have no idea why :S