Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Feb 9th, 2010 | Syntax: None | Size: 0.77 KB | Hits: 20 | Expires: Never
Copy text to clipboard
  1. public OnPlayerConnect(playerid)
  2. {
  3.     new pname[MAX_PLAYER_NAME], idx, found;
  4.     GetPlayerName(playerid, pname, sizeof pname);    
  5.     while(pname[idx])    
  6.     {
  7.         if(pname[idx] == '[' || pname[idx] == ']')
  8.         {        
  9.             SendClientMessage(playerid, COLOR_RED, "Seu nome não pode conter os seguintes caracteres: [ ]");            
  10.             Kick(playerid);
  11.             return 1;
  12.         }
  13.         if(pname[idx] == '_')
  14.         {        
  15.             found = 1;            
  16.             break;
  17.         }
  18.         idx++;      
  19.     }    
  20.     if(!found)    
  21.     {
  22.         SendClientMessage(playerid, COLOR_RED, "Seu nome precisa estar no formato: Nome_Sobrenome");
  23.         Kick(playerid);
  24.         return 1;            
  25.     }
  26.     return 1;
  27. }