Advertisement
garfield

[INC]: Citar jogador

Aug 17th, 2014
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.89 KB | None | 0 0
  1.  
  2.  
  3. #if defined citar_included
  4.     #endinput
  5. #else
  6.     #define citar_included
  7. #endif
  8.  
  9.  
  10. /*
  11.  
  12.     native Citar(text[]);
  13.  */
  14.  
  15.  
  16.  
  17. stock Citar(text[]){
  18.  
  19.     new
  20.         string[128],
  21.         id[10],
  22.         pos = 0
  23.     ;
  24.  
  25.     format(string, 128, text);
  26.  
  27.     while( (pos = strfind(string, "@", true, (pos + 1))) != -1 ){
  28.  
  29.  
  30.         static
  31.             i
  32.         ;
  33.  
  34.         i = (pos + 1);
  35.  
  36.         for( ; ; )
  37.         {
  38.  
  39.             if(
  40.                 (string[i] > 64 && string[i] < 90) ||
  41.                 (string[i] > 96 && string[i] < 123) ||
  42.                 (string[i] == 32 || string[i] == '\0'))
  43.             {
  44.                 break;
  45.             }
  46.  
  47.  
  48.             ++i;
  49.  
  50.         }
  51.  
  52.  
  53.  
  54.         strmid(id, string, pos+1, i);
  55.        
  56.        
  57.         if( (id[0] ^ '\0' && id[0] ^ '\1'  && id[0] ^ ' ') &&
  58.             IsPlayerConnected(strval(id)))
  59.         {
  60.  
  61.             strdel(string, pos, i);
  62.  
  63.             static
  64.                 _n[24]
  65.             ;
  66.            
  67.             GetPlayerName(strval(id), _n, 24);
  68.  
  69.             strins(string, _n, pos, sizeof(string));
  70.  
  71.         }
  72.     }
  73.     return string;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement