Advertisement
Guest User

Untitled

a guest
Dec 29th, 2009
2,248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.96 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new symbols[] =
  4. {
  5.     '[', ']'
  6. };
  7.  
  8. new abc[] =
  9. {
  10.     'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
  11.     'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
  12. };
  13.  
  14. new bool: Big;
  15.  
  16. public OnPlayerConnect(playerid)
  17. {
  18.     new string[128], pName[MAX_PLAYER_NAME];
  19.     GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  20.     if(IsPlayerNPC(playerid))
  21.     {
  22.         return 1;
  23.     }
  24.     if(strfind(pName, "_", true) == -1)
  25.     {
  26.         format(string, 128, ".:: %s has been kicked from this server! Reason: Change your name! FirstName_LastName ::.", pName);
  27.         SendClientMessageToAll(0xAA3333AA, string);
  28.         Kick(playerid);
  29.         return 1;
  30.         } else {
  31.         for(new i; i <= strlen(pName); i++)
  32.         {
  33.             for(new j; j <= 9; j++)
  34.             {
  35.                 if(pName[i] == j)
  36.                 {
  37.                     format(string, 128, ".:: %s has been kicked from this server! Reason: Change your name! FirstName_LastName ::.", pName);
  38.                     SendClientMessageToAll(0xAA3333AA, string);
  39.                     Kick(playerid);
  40.                     return 1;
  41.                 }
  42.             }
  43.             for(new j; j <= sizeof(symbols); j++)
  44.             {
  45.                 if(pName[i] == symbols[j])
  46.                 {
  47.                     format(string, 128, ".:: %s has been kicked from this server! Reason: Change your name! FirstName_LastName ::.", pName);
  48.                     SendClientMessageToAll(0xAA3333AA, string);
  49.                     Kick(playerid);
  50.                     return 1;
  51.                 }
  52.             }
  53.             if(i >= 1)
  54.             {
  55.                 if(Big == true)
  56.                 {
  57.                     Big = false;
  58.                     continue;
  59.                 }
  60.                 if(pName[i] == '_')
  61.                 {
  62.                     Big = true;
  63.                     continue;
  64.                 }
  65.                 for(new j; j <= sizeof(abc); j++)
  66.                 {
  67.                     if(pName[i] == abc[j])
  68.                     {
  69.                         format(string, 128, ".:: %s has been kicked from this server! Reason: Change your name! FirstName_LastName ::.", pName);
  70.                         SendClientMessageToAll(0xAA3333AA, string);
  71.                         Kick(playerid);
  72.                         return 1;
  73.                     }
  74.                 }
  75.             }
  76.         }
  77.     }
  78.     return 1;
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement