Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- //#define FILTERSCRIPT
- #include <a_samp>
- #define dcmd(%1,%2,%3) if((strcmp((%3)[1],#%1,true,(%2))==0)&&((((%3)[(%2)+1]==0)&&(dcmd_%1(playerid,"")))||(((%3)[(%2)+1]==32)&&(dcmd_%1(playerid,(%3)[(%2)+2]))))) return 1
- #define m_arg 12 // 12/4=3 zones
- main()
- {
- zones("1,5,7,2,8,3,9,6");
- }
- new Float:pos[m_arg][4];
- new count;
- zones(arg[])
- {
- new idx = 0;
- new zz;
- count=0;
- for(new x;x!=m_arg;x++)
- {
- new Float:ok = floatstr(strtok(arg, idx, ','));
- if(ok == 0.0) break;
- if(zz==4) zz=0;
- pos[x][zz] = ok;
- printf("%f", pos[x][zz]);
- zz++;
- count++;//êîëè÷åñòâî çîí ++
- }
- infoArea();
- }
- infoArea()
- {
- new i = count / 4; //êîëè÷åñòâî ãàíã çîí
- printf("%d", i);
- new z = 0;
- new zz;
- while(z!=i)
- {
- for(new x;x!=4;x++)
- {
- if(zz==4)zz=0;
- printf("Zone %d: pos: %f",z,pos[x][zz]);
- zz++;
- }
- z++;
- }
- }
- strtok(const string[], &index,seperator=' ')
- {
- new length = strlen(string);
- new offset = index;
- new result[256];
- while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- if ((index < length) && (string[index] == seperator)) index++;
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement