garfield

[COD]: getParam - Pegar parâmetros.

Oct 13th, 2012
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.73 KB | None | 0 0
  1.  
  2.  
  3. stock getParam(intstring[128], parameter, delim){ // By SuYaNw / Garfield's
  4.  
  5.     static
  6.         szStringOut[128],
  7.         Loop_Interator,
  8.         LastWorldSize,
  9.         String_Size,
  10.         Parameters
  11.     ;
  12.    
  13.     // Setting:
  14.     String_Size     = strlen(intstring);
  15.    
  16.     // Resetting:
  17.     szStringOut[0]  = EOS;
  18.     Loop_Interator  = 0 ;
  19.     LastWorldSize   = 0 ;
  20.     Parameters      = 0 ;
  21.  
  22.  
  23.     for ( ; Loop_Interator  !=  String_Size; ++Loop_Interator){
  24.  
  25.         if(intstring[Loop_Interator] == delim){
  26.             if(Parameters == parameter){
  27.                 strmid(szStringOut,  intstring,(parameter != 0 ? (LastWorldSize + 1) : (LastWorldSize)), Loop_Interator);
  28.                 break;
  29.             }
  30.             Parameters ++;
  31.             LastWorldSize = Loop_Interator;
  32.         }
  33.     }
  34.     return szStringOut;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment