SHARE
TWEET

Untitled

a guest May 19th, 2017 38 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool Is_invalid(const char *Name) {
  2.     fstream file("invalid-nicks.txt", ios::in);
  3.     string tmp;
  4.     while(file >> tmp) {
  5.         if(strcmp(Name, tmp.c_str()) == 0) {
  6.             return 1;
  7.          }
  8.         }
  9.     return 0;
  10.     }
  11. extern "C" {
  12. DLLEXPORT void SSGM_Player_Join_Hook(int ID, const char *Nick) {
  13. if(Is_invalid(Get_Player_Name_By_ID(ID))) {
  14. Console_Input(StrFormat("msg %s is using an invalid nick...Kicking!",Nick).c_str());
  15. Console_Input(StrFormat("kick %d",ID).c_str());
  16. Console_Input(StrFormat("allow %d",ID).c_str());
  17.   }
  18.  }
  19. }
RAW Paste Data
Top