Данный код поддерживает флаги %s %S %f %F %d %D %i %%, поддержку других флагом нужно писать самому, если потребуется.  Синтаксис: sprintf(const Format[], {Float,_}:...); 
 const Format - тип данных; 
 Float - аргументы. 
 
Code
stock sprintf(const Format[], {Float,_}:...) 
 {    
         new bool:searching, x;    
         new string[256], tmp[256], tmp2[256];    
         new currarg, i;    
         currarg=1;    
         for(i=0; i < strlen(Format); i++) {    
             if(Format[i] != '%') {    
                 string[strlen(string)] = Format[i];    
                 string[strlen(string)] = '\0';    
                 continue;    
              }    
             if(Format[i] == '%' && Format[i+1] == '%') {    
                 string[strlen(string)] = Format[i];    
                 string[strlen(string)] = '\0';    
                 i++;    
                 continue;    
              }    
              searching = true;    
             new tempFormat[256];    
             while(searching) {    
                 tempFormat[strlen(tempFormat)] = Format[i];    
                 tempFormat[strlen(tempFormat)] = '\0';    
                 switch(Format[i]) {    
                     case 's', 'S' : {    
                         strdel(tmp, 0, sizeof(tmp));    
                         strdel(tmp2, 0, sizeof(tmp2));    
                         x=0;    
                         for(x=0; getarg(currarg, x) != '\0'; x++) {    
                             tmp2[x] = getarg(currarg, x);    
                            }    
                            tmp2[x] = '\0';    
                         format(tmp, sizeof(tmp), tempFormat, tmp2);    
                         strcat(string, tmp);    
                         searching = false;    
                         currarg++;    
                        }    
                     case 'f', 'F' : {    
                         strdel(tmp, 0, sizeof(tmp));    
                         format(tmp, sizeof(tmp), tempFormat, Float:getarg(currarg));    
                         strcat(string, tmp);    
                         searching = false;    
                         currarg++;    
                        }    
                     case 'd', 'D', 'i' : {    
                         strdel(tmp, 0, sizeof(tmp));    
                         format(tmp, sizeof(tmp), tempFormat, getarg(currarg));    
                         strcat(string, tmp);    
                         searching = false;    
                         currarg++;    
                        }    
                    }    
                    if(searching)    
                     i++;    
               }    
         }    
         return string;    
 }    
 native sprintf(const Format[], {Float,_}:...);
 Автор: Peter.