Advertisement
DraKiNs

[Filterscript] [iPs]Streamer V3

Oct 4th, 2011
825
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 17.10 KB | None | 0 0
  1.  
  2. /*=================================================================
  3.      _ ____     _____         __  __
  4.     (_)  _ \ ___  |_   _|__  __ _|  \/  |
  5.     | | |_) / __|   | |/ _ \/ _` | |\/| |
  6.     | |  __/\__ \   | |  __/ (_| | |  | |
  7.     |_|_|   |___/   |_|\___|\__,_|_|  |_|
  8.  
  9.         Created by Bruno da Silva
  10.         www.ips-team.blogspot.com
  11.        Stremaer Objects [iPs]Streamer
  12.  
  13. =================================================================*/
  14.  
  15.  
  16. #include <a_samp>
  17.  
  18. #include IPS/foreach
  19. #include IPS/ips_ini
  20.  
  21.  
  22. #define MAX_STREAM          10000
  23. #define MIN_INTERVAL        00500
  24. #define MAX_DRAW            350.0
  25.  
  26. #define function%0(%1)      %0(%1); public %0(%1)
  27.  
  28. // ===================== [ Declarar Variaveis ] ================================
  29.  
  30. stock static
  31.     bool:objetoDeletado[MAX_PLAYERS][MAX_STREAM],
  32.     Float:objetoDistancia[MAX_PLAYERS],
  33.     Iterator:structObject<MAX_STREAM>,
  34.     Float:dataObject[MAX_STREAM][7],
  35.     objetoConfigs[MAX_STREAM][2],
  36.     objetosCriados[MAX_PLAYERS],
  37.     objetoNumero[MAX_PLAYERS],
  38.     objetoCriado[MAX_STREAM],
  39.     objectModel[MAX_STREAM],
  40.     objetoIdd[MAX_STREAM],
  41.     objCriados = 0;
  42.  
  43. // ========================== [ Funções ] ======================================
  44.  
  45. public OnFilterScriptInit()
  46. {
  47.  
  48.     // createObjectsFromMAPFile("mapa.map");
  49.     // createObjectsFromTXTFile("mapa.txt", '|');
  50.    
  51.     return SetTimer("ObjectUpdate", MIN_INTERVAL, true);
  52. }
  53.  
  54.  
  55. stock getMapXMLParam(string[], param[])
  56. {
  57.     new
  58.         tempString[128],
  59.         paramInt = strfind(string, param, true)
  60.     ;
  61.  
  62.     if(-1 != paramInt)
  63.     {
  64.         paramInt += strlen(param);
  65.  
  66.         for(new j = -1; string[paramInt] != '"'; ++paramInt)
  67.         {
  68.             tempString[++j] = string[paramInt];
  69.         }
  70.     }
  71.    
  72.     return tempString;
  73. }
  74.  
  75. function createObjectsFromMAPFile(arquivo[])
  76. {
  77.     new
  78.         File:arquivoFopen = fopen(arquivo, io_read),
  79.         string[256]
  80.     ;
  81.  
  82.     while(fread(arquivoFopen, string))
  83.     {
  84.         if(strlen(getMapXMLParam(string, "id=\"object")) < 2) continue;
  85.        
  86.         createObject
  87.         (
  88.             strval(getMapXMLParam(string, "model=\"")),
  89.             floatstr(getMapXMLParam(string, "posX=\"")),
  90.             floatstr(getMapXMLParam(string, "posY=\"")),
  91.             floatstr(getMapXMLParam(string, "posZ=\"")),
  92.             floatstr(getMapXMLParam(string, "rotX=\"")),
  93.             floatstr(getMapXMLParam(string, "rotY=\"")),
  94.             floatstr(getMapXMLParam(string, "rotZ=\"")),
  95.             MAX_DRAW, strval(getMapXMLParam(string, "interior=\"")), 0
  96.         );
  97.  
  98.     }
  99.     return true;
  100. }
  101.  
  102. function createObjectsFromTXTFile(arquivo[], split)
  103. {
  104.         static
  105.                 fileFormat[24],
  106.                 string[64],
  107.                 modelid,
  108.                 interior,
  109.                 worldids
  110.         ;
  111.  
  112.         new
  113.                 File:arquivoFopen = fopen(arquivo, io_read)
  114.         ;
  115.  
  116.         enum E_OBJECTF
  117.         {
  118.             Float:float1,
  119.             Float:float2,
  120.             Float:float3,
  121.             Float:float4,
  122.             Float:float5,
  123.             Float:float6,
  124.             Float:float7
  125.         };
  126.        
  127.         new
  128.             Float:dataFloat[E_OBJECTF]
  129.         ;
  130.        
  131.         format(fileFormat, 24, "p<%c>de<fffffff>dd", split);
  132.        
  133.         while(fread(arquivoFopen, string))
  134.         {
  135.                 sscanf(string, fileFormat, modelid, dataFloat,interior, worldids);
  136.                
  137.                 if(!dataFloat[float7])
  138.                 {
  139.                     dataFloat[float7] = 350.0;
  140.                 }
  141.                
  142.                 createObject(modelid, dataFloat[float1], dataFloat[float2], dataFloat[float3], dataFloat[float4], dataFloat[float5], dataFloat[float6], dataFloat[float7], interior, worldids);
  143.         }
  144.  
  145.         #pragma unused modelid
  146.         #pragma unused dataFloat
  147.         #pragma unused string
  148.         #pragma unused split
  149.         #pragma unused fileFormat
  150.         #pragma unused interior
  151.         #pragma unused worldids
  152.        
  153.         return fclose(arquivoFopen);
  154. }
  155.  
  156.  
  157. function createObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, Float:DrawDistance, interior, worldids)
  158. {
  159.     if(MAX_STREAM - 1 == objCriados)
  160.     {
  161.    
  162.         print("[ERRO] Informação acessada inválida (objeto numero " #MAX_STREAM - 1 " ) (limite excedido)");
  163.         return false;
  164.        
  165.     }
  166.  
  167.     ++objCriados;
  168.  
  169.     objectModel[objCriados] = modelid;
  170.  
  171.     dataObject[objCriados][0] = X;
  172.     dataObject[objCriados][1] = Y;
  173.     dataObject[objCriados][2] = Z;
  174.  
  175.     dataObject[objCriados][3] = rX;
  176.     dataObject[objCriados][4] = rY;
  177.     dataObject[objCriados][5] = rZ;
  178.  
  179.     objetoConfigs[objCriados][0] = worldids;
  180.     objetoConfigs[objCriados][1] = interior;
  181.    
  182.     dataObject[objCriados][6] = DrawDistance;
  183.  
  184.     Iter_Add(structObject, objCriados);
  185.  
  186.     return objCriados;
  187. }
  188.  
  189.  
  190. function deleteObject(objectid)
  191. {
  192.     foreach(Player, i)
  193.     {
  194.         DestroyPlayerObject(i, objectid);
  195.  
  196.         dataObject[objectid][0] = 0;
  197.         dataObject[objectid][1] = 0;
  198.         dataObject[objectid][2] = 0;
  199.  
  200.         dataObject[objectid][3] = 0;
  201.         dataObject[objectid][4] = 0;
  202.         dataObject[objectid][5] = 0;
  203.  
  204.         dataObject[objectid][6] = 0;
  205.  
  206.         objetoIdd[objectid] = 0;
  207.  
  208.         objectModel[objectid] = 0;
  209.        
  210.         objetoConfigs[objectid][0] = 0;
  211.         objetoConfigs[objectid][1] = 0;
  212.        
  213.         Iter_Remove(structObject, objectid);
  214.  
  215.     }
  216.     return true;
  217. }
  218.  
  219.  
  220. function moveObject(objectid, Float:pX, Float:pY, Float:pZ, Float:Speed, Float:rotX, Float:rotY, Float:rotZ)
  221. {
  222.     foreach(Player, i) {
  223.         dataObject[objectid][0] = pX;
  224.         dataObject[objectid][1] = pY;
  225.         dataObject[objectid][2] = pZ;
  226.  
  227.         #if defined PlayAudioStreamForPlayer
  228.         {
  229.             MovePlayerObject(i, objectid, pX, pY, pZ, Speed, rotX, rotY, rotZ);
  230.         }
  231.         #else
  232.         {
  233.             MovePlayerObject(i, objectid, pX, pY, pZ, Speed);
  234.         }
  235.         #endif
  236.     }
  237.     return 1;
  238. }
  239.  
  240.  
  241. function ObjectUpdate()
  242. {
  243.     static objetoPerto;
  244.  
  245.     foreach(Player, i) foreach(structObject, o)
  246.     {
  247.         objetoPerto = IsPlayerInRangeOfPoint(i, dataObject[o][6], dataObject[o][0], dataObject[o][1], dataObject[o][2]);
  248.  
  249.         if(objetoPerto && !objetoCriado[o] && GetPlayerVirtualWorld(i) == objetoConfigs[o][0] && GetPlayerInterior(i) == objetoConfigs[o][1])
  250.         {
  251.             static
  252.                 Float: px,
  253.                 Float: py,
  254.  
  255.                 Float: pz,
  256.                 Float: pd;
  257.  
  258.             GetPlayerPos(i, px, py, pz);
  259.  
  260.             px -= dataObject[o][0];
  261.             py -= dataObject[o][1];
  262.             pz -= dataObject[o][2];
  263.  
  264.             pd = floatsqroot((px * px) + (py * py) + (pz * pz));
  265.  
  266.             if(pd > objetoDistancia[i]) {
  267.                 objetoDistancia[i] = pd;
  268.                 objetoNumero[i] = o;
  269.             }
  270.  
  271. // criar ojeto
  272.             ++objetoCriado[o];
  273.             ++objetosCriados[i];
  274.  
  275.             objetoIdd[o] = CreatePlayerObject(i, objectModel[o], dataObject[o][0], dataObject[o][1], dataObject[o][2], dataObject[o][3], dataObject[o][4], dataObject[o][5], dataObject[o][6]);
  276.  
  277. // tirar objeto caso limite for ultrapssado
  278.             if(objetosCriados[i] > MAX_OBJECTS - 50) {         // PREVENT CRASH
  279.                 DestroyPlayerObject(i, objetoIdd[objetoNumero[i]]);
  280.                 objetoDistancia[i] = 0.0;
  281.  
  282.                 --objetosCriados[i];
  283.                 --objetoCriado[o];
  284.             }
  285.  
  286.             continue;
  287.         }
  288.         if(objetoPerto && !objetoCriado[o]) {
  289.             DestroyPlayerObject(i, objetoIdd[o]);
  290.  
  291.             --objetoCriado[o];
  292.             --objetosCriados[i];
  293.         }
  294.     }
  295.     return true;
  296. }
  297.  
  298.  
  299. sscanf(string[], format[],{Float,_}:...)
  300. {
  301.  
  302.     #if !defined isNull
  303.     #define isNull(%0) (!%0[0]  || %0[0] == '\1' && !%0[1])
  304.     #endif
  305.  
  306.     #if defined strcpy
  307.     #undef strcpy
  308.     #endif
  309.  
  310.     #if !defined foreach
  311.     #define foreach(%0,%1) for (new %1 = 0; %1 != MAX_PLAYERS; ++%1) if(IsPlayerConnected(%1))
  312.     #endif
  313.  
  314.     #define strcpy(%0,%1) strcat((%0[0] = '\0', %0), %1, sizeof(%0))
  315.  
  316.     #define MAX_BUFFER  128
  317.  
  318.     if(isNull(string))
  319.     {
  320.         return false;
  321.  
  322.     }
  323.  
  324.     new
  325.         formatCount = -1,
  326.         stringCount = -1,
  327.         paramsCount = 2,
  328.         delim = 0x20,
  329.         bool:silentMod = false,
  330.         totalParams = numargs()
  331.     ;
  332.  
  333.     static
  334.         temporaria[MAX_BUFFER]
  335.     ;
  336.  
  337.     strcpy(temporaria, string);
  338.  
  339.     #pragma unused string
  340.  
  341.     while(format[++formatCount])
  342.     {
  343.         switch(format[formatCount])
  344.         {
  345.             case '{':
  346.  
  347.                 {
  348.                     silentMod = true;
  349.                     continue;
  350.  
  351.                 }
  352.  
  353.                 case '}':
  354.  
  355.             {
  356.                 silentMod = false;
  357.                 continue;
  358.  
  359.             }
  360.  
  361.  
  362.         }
  363.  
  364.         if(silentMod)
  365.         {
  366.             continue;
  367.  
  368.  
  369.         }
  370.  
  371.         switch(format[formatCount])
  372.         {
  373.             case 'i', 'd':
  374.  
  375.             {
  376.                 new
  377.                 numero,
  378.                 caractere = temporaria[stringCount + 1],
  379.                 negativo = 1                                                ;
  380.  
  381.                 if(caractere == '-')
  382.                 {
  383.                     ++stringCount;
  384.                     negativo = -1;
  385.  
  386.                 }
  387.  
  388.                 while((caractere = temporaria[++stringCount]) != delim && caractere)
  389.                 {
  390.                     if ('0' <= caractere <= '9')
  391.                     {
  392.                         numero =  (numero * 10) + (caractere - '0');
  393.  
  394.                     }
  395.                     else
  396.                     {
  397.                         return false;
  398.  
  399.                     }
  400.  
  401.  
  402.                 }
  403.  
  404.                 setarg(paramsCount, 0, numero * negativo);
  405.                 ++paramsCount;
  406.                 continue;
  407.  
  408.  
  409.             }
  410.  
  411.             case 'f':
  412.  
  413.             {
  414.  
  415.                 new sscanfValor = -1;
  416.  
  417.                 new
  418.                     stringFloat[15]
  419.                 ;
  420.  
  421.                 while(temporaria[++stringCount] != delim && temporaria[stringCount])
  422.                 {
  423.                     stringFloat[++sscanfValor] = temporaria[stringCount];
  424.  
  425.                 }
  426.  
  427.                 if(sscanfValor != -1)
  428.                 {
  429.                     setarg(paramsCount, 0, _:floatstr(stringFloat));
  430.                     ++paramsCount;
  431.                 }
  432.  
  433.                 #pragma unused sscanfValor
  434.                 continue;
  435.  
  436.  
  437.             }
  438.  
  439.             case 'u':
  440.  
  441.             {
  442.                 new
  443.                     texto,
  444.                     tempVal = stringCount,
  445.                     stringTemp[MAX_BUFFER],
  446.                     caractere = temporaria[stringCount + 1]   ;
  447.  
  448.                 while((caractere = temporaria[++tempVal]) != delim && temporaria[stringCount]) if ('0' > caractere || '9' < caractere)
  449.                 {
  450.                     texto = 1;
  451.                     break;
  452.  
  453.                 }
  454.  
  455.                 if(!texto)
  456.                 {
  457.                     while((caractere = temporaria[++stringCount])!= delim && caractere)
  458.                     {
  459.                         texto  =  (texto * 10) + (caractere - '0');
  460.  
  461.  
  462.                     }
  463.                     texto = 10;
  464.                     setarg(paramsCount, 0, texto);
  465.  
  466.  
  467.                 }
  468.                 else
  469.                 {
  470.                     texto = -1;
  471.                     while(temporaria[++stringCount] != delim && temporaria[stringCount])
  472.                     {
  473.                         stringTemp[++texto] = temporaria[stringCount];
  474.  
  475.                     }
  476.  
  477.                     foreach(Player, i)
  478.                     {
  479.                         static
  480.                         name[MAX_PLAYER_NAME]
  481.                         ;
  482.  
  483.                         GetPlayerName(i, name, MAX_PLAYER_NAME);
  484.                         if(-1 != strfind(name, stringTemp, true))
  485.                         {
  486.                             setarg(paramsCount, 0, i);
  487.                             texto = 10;
  488.                             break;
  489.  
  490.  
  491.                         }
  492.  
  493.  
  494.                     }
  495.  
  496.  
  497.                 }
  498.  
  499.                 if(10 != texto)
  500.                 {
  501.                     setarg(paramsCount, 0, -1);
  502.  
  503.                 }
  504.  
  505.                 ++paramsCount;
  506.                 continue;
  507.  
  508.  
  509.             }
  510.  
  511.             case 's', 'z':
  512.  
  513.             {
  514.                 new
  515.                 sscanfValor = -1
  516.                 ;
  517.  
  518.                 while(temporaria[++stringCount] != delim && temporaria[stringCount])
  519.                 {
  520.                     setarg(paramsCount, ++sscanfValor, temporaria[stringCount]);
  521.  
  522.                 }
  523.  
  524.                 if(sscanfValor != -1)
  525.                 {
  526.                     ++paramsCount;
  527.  
  528.                 }
  529.                 #pragma unused sscanfValor
  530.                 continue;
  531.  
  532.  
  533.             }
  534.  
  535.             case 'c':
  536.  
  537.             {
  538.                 if(!temporaria[++stringCount]) return false;
  539.                 setarg(paramsCount, 0, temporaria[stringCount]);
  540.                 continue;
  541.  
  542.  
  543.             }
  544.  
  545.             case '(':
  546.  
  547.             {
  548.                 switch(format[formatCount - 1])
  549.                 {
  550.                     case 'g':
  551.  
  552.                     {
  553.                         new
  554.                         findString[MAX_BUFFER],
  555.                         sscanfValor = -1
  556.                         ;
  557.  
  558.                         while(format[++formatCount] != ')')
  559.                         {
  560.                             findString[++sscanfValor] = format[formatCount];
  561.  
  562.                         }
  563.  
  564.                         if(-1 != sscanfValor)
  565.                         {
  566.                             sscanfValor = strfind(temporaria, findString, true);
  567.                             if(-1 != sscanfValor)
  568.                             {
  569.                                 setarg(paramsCount, 0, sscanfValor);
  570.                                 stringCount = sscanfValor+strlen(findString)+1;
  571.                                 setarg(++paramsCount, 0, stringCount);
  572.  
  573.                             }
  574.  
  575.                         }
  576.  
  577.                         ++paramsCount;
  578.                         #pragma unused sscanfValor
  579.                         continue;
  580.  
  581.  
  582.                     }
  583.  
  584.                     case 'r':
  585.  
  586.  
  587.                     {
  588.                         while(format[++formatCount] )
  589.                         {
  590.  
  591.                             switch(format[formatCount])
  592.                             {
  593.                                 case ')':
  594.  
  595.                                 {
  596.                                     break;
  597.  
  598.                                 }
  599.  
  600.                                 case 's' , 'z':
  601.  
  602.                                 {
  603.                                     new
  604.                                     sscanfValor = -1,
  605.                                     bufferString[MAX_BUFFER]                        ;
  606.  
  607.                                     while(temporaria[++stringCount] != delim && temporaria[stringCount])
  608.                                     {
  609.                                         bufferString[++sscanfValor] = temporaria[stringCount];
  610.  
  611.  
  612.                                     }
  613.  
  614.                                     new
  615.                                         i = sscanfValor
  616.                                     ;
  617.  
  618.                                     sscanfValor = -1;
  619.  
  620.                                     for( ; 0xFFFFFFFF != i; --i)
  621.                                     {
  622.                                         setarg(paramsCount, ++sscanfValor, bufferString[i]);
  623.  
  624.  
  625.                                     }
  626.  
  627.                                     if(sscanfValor != -1)
  628.                                     {
  629.                                         ++paramsCount;
  630.  
  631.                                     }
  632.                                     #pragma unused sscanfValor
  633.  
  634.                                 }
  635.  
  636.                                 case 'f':
  637.  
  638.  
  639.                                 {
  640.                                     new
  641.                                         sscanfValor = -1,
  642.                                         stringFloat[MAX_BUFFER]                     ;
  643.  
  644.                                     while(temporaria[++stringCount] != delim && temporaria[stringCount])
  645.                                     {
  646.                                         stringFloat[++sscanfValor] = temporaria[stringCount];
  647.  
  648.  
  649.                                     }
  650.  
  651.                                     new
  652.                                         i = sscanfValor
  653.                                     ;
  654.  
  655.                                     sscanfValor = -1;
  656.  
  657.                                     for( ; -1 != i; --i)
  658.                                     {
  659.                                         stringFloat[++sscanfValor] = stringFloat[i];
  660.  
  661.                                     }
  662.  
  663.                                     if(sscanfValor != -1)
  664.                                     {
  665.                                         setarg(++paramsCount, 0, _:floatstr(stringFloat));
  666.  
  667.                                     }
  668.                                     #pragma unused sscanfValor
  669.  
  670.  
  671.                                 }
  672.  
  673.                                 case 'd' , 'i':
  674.  
  675.  
  676.                                 {
  677.                                     new
  678.                                     sscanfValor = -1,
  679.                                     stringValue[MAX_BUFFER]                     ;
  680.  
  681.                                     while(temporaria[++stringCount] != delim && temporaria[stringCount])
  682.                                     {
  683.                                         stringValue[++sscanfValor] = temporaria[stringCount];
  684.  
  685.  
  686.                                     }
  687.  
  688.                                     new
  689.                                         i = sscanfValor
  690.                                     ;
  691.  
  692.                                     sscanfValor = -1;
  693.  
  694.                                     for( ; -1 != i; --i)
  695.                                     {
  696.                                         stringValue[++sscanfValor] = stringValue[i];
  697.  
  698.                                     }
  699.  
  700.                                     if(sscanfValor != -1)
  701.                                     {
  702.                                         setarg(++paramsCount, 0, strval(stringValue));
  703.  
  704.                                     }
  705.                                     #pragma unused sscanfValor
  706.  
  707.                                 }
  708.  
  709.                             }
  710.  
  711.                         }
  712.                         continue;
  713.  
  714.  
  715.                     }
  716.  
  717.                 }
  718.  
  719.  
  720.             }
  721.  
  722.             case '<':
  723.  
  724.  
  725.             {
  726.                 new
  727.                 paramEnum = -1
  728.                 ;
  729.  
  730.                 switch(format[formatCount-1])
  731.                 {
  732.                     case 'e' , 'a':
  733.  
  734.  
  735.                     {
  736.                         while(format[++formatCount])
  737.                         {
  738.                             switch(format[formatCount])
  739.                             {
  740.                                 case '>':
  741.  
  742.                                 {
  743.                                     break                                       ;
  744.  
  745.                                 }
  746.  
  747.                                 case 'i', 'd':
  748.  
  749.  
  750.                                 {
  751.  
  752.                                     new
  753.                                     numero,
  754.                                     caractere = temporaria[stringCount + 1],
  755.                                     negativo = 1                            ;
  756.  
  757.                                     if(caractere == '-')
  758.                                     {
  759.  
  760.                                         ++stringCount;
  761.                                         negativo = -1;
  762.  
  763.  
  764.                                     }
  765.  
  766.                                     while((caractere = temporaria[++stringCount]) != delim && caractere)
  767.                                     {
  768.  
  769.                                         if ('0' <= caractere <= '9')
  770.                                         {
  771.                                             numero =  (numero * 10) + (caractere - '0');
  772.  
  773.  
  774.                                         }
  775.                                         else
  776.                                         {
  777.                                             return false;
  778.  
  779.  
  780.                                         }
  781.  
  782.  
  783.                                     }
  784.                                     setarg(paramsCount, ++paramEnum, numero * negativo);
  785.                                     continue;
  786.  
  787.  
  788.                                 }
  789.  
  790.                                 case 'u':
  791.  
  792.  
  793.                                 {
  794.                                     new
  795.                                     texto,
  796.                                     tempVal = stringCount,
  797.                                     stringTemp[MAX_BUFFER],
  798.                                     caractere = temporaria[stringCount + 1] ;
  799.  
  800.                                     while((caractere = temporaria[++tempVal]) != delim && temporaria[stringCount]) if ('0' > caractere || '9' < caractere)
  801.                                     {
  802.                                         texto = 1;
  803.                                         break;
  804.  
  805.                                     }
  806.  
  807.                                     if(!texto)
  808.                                     {
  809.                                         while((caractere = temporaria[++stringCount])!= delim && caractere)
  810.                                         {
  811.                                             texto  =  (texto * 10) + (caractere - '0');
  812.  
  813.                                         }
  814.                                         texto = 10;
  815.  
  816.                                         setarg(paramsCount, ++paramEnum, texto);
  817.  
  818.  
  819.                                     }
  820.                                     else
  821.                                     {
  822.                                         texto = -1;
  823.                                         while(temporaria[++stringCount] != delim && temporaria[stringCount])
  824.                                         {
  825.                                             stringTemp[++texto] = temporaria[stringCount];
  826.  
  827.  
  828.                                         }
  829.  
  830.                                         foreach(Player, i)
  831.                                         {
  832.                                             static
  833.                                             name[MAX_PLAYER_NAME]
  834.                                             ;
  835.  
  836.                                             GetPlayerName(i, name, MAX_PLAYER_NAME);
  837.                                             if(-1 != strfind(name, stringTemp, true))
  838.                                             {
  839.                                                 setarg(paramsCount, ++paramEnum, i);
  840.                                                 texto = 10;
  841.                                                 break;
  842.  
  843.  
  844.                                             }
  845.  
  846.  
  847.                                         }
  848.  
  849.  
  850.                                     }
  851.  
  852.                                     if(10 != texto)
  853.                                     {
  854.                                         setarg(paramsCount, ++paramEnum, -1)    ;
  855.  
  856.  
  857.                                     }
  858.                                     continue;
  859.  
  860.  
  861.                                 }
  862.  
  863.                                 case 'f':
  864.  
  865.  
  866.                                 {
  867.                                     new
  868.                                     sscanfValor = -1,
  869.                                     stringFloat[15]                         ;
  870.  
  871.                                     while(temporaria[++stringCount] != delim && temporaria[stringCount])
  872.                                     {
  873.  
  874.                                         stringFloat[++sscanfValor] = temporaria[stringCount];
  875.  
  876.  
  877.                                     }
  878.  
  879.                                     if(sscanfValor != -1)
  880.                                     {
  881.                                         setarg(paramsCount, ++paramEnum, _:floatstr(stringFloat));
  882.  
  883.  
  884.                                     }
  885.                                     #pragma unused sscanfValor
  886.                                     continue;
  887.  
  888.  
  889.                                 }
  890.  
  891.                                 case 'c':
  892.  
  893.  
  894.                                 {
  895.                                     setarg(paramsCount, ++paramEnum, temporaria[++stringCount]);
  896.                                     continue;
  897.  
  898.  
  899.                                 }
  900.  
  901.  
  902.                             }
  903.  
  904.  
  905.                         }
  906.                         ++paramsCount;
  907.  
  908.  
  909.                     }
  910.  
  911.                     case 'p':
  912.  
  913.  
  914.                     {
  915.  
  916.                         delim = format[++formatCount];
  917.  
  918.                         while(format[++formatCount] != '>') continue;
  919.  
  920.  
  921.                     }
  922.  
  923.  
  924.                 }
  925.  
  926.  
  927.             }
  928.  
  929.  
  930.         }
  931.  
  932.     }
  933.     return paramsCount == totalParams;
  934. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement