Jump to content
  • 0

pomoc Report


NurofeN-Cz

Dotaz

format(cesta, 25, "cwmode/report/Data.ini");
   if (!fexist(cesta))
   {
       new File:test=fopen(cesta,io_write);
       if(test){
       fwrite(test, "Test");
       fclose(test);
       }
   }
   if (fexist(cesta)) {print("            slozka \"cwmode\\report\"   [OK]");fremove(cesta);}
   else {print("            slozka \"cwmode\\report\"   [ERROR]");SetTimer("ExitGameMode",3000,false);}

 

public WriteClanWarRound()
{
   new Soubor[45];
   format(Soubor, 45, "cwmod/report/%s_vs_%s.ini",TeamRed,TeamGreen);
   new File:SaveFile = fopen(Soubor, io_append);
   if(SaveFile)
   {
   new String[100];
   {
   new Sav[100];
   format(Sav, 100, "\r\n=================================================================\r\n");fwrite(SaveFile, Sav);
    format(Sav, 100, "Total: %d : %d\r\n",scorerrr,scoreggg);fwrite(SaveFile, Sav);
   format(Sav, 100, "(Red)%s %d : %d %s(Green)\r\n",TeamRed,scorer,scoreg,TeamGreen);fwrite(SaveFile, Sav);
     }
   new Float:Ratio;
   for(new i=0;i<=MAX_PLAYERS;i++) {
   if(!IsPlayerConnected(i)) continue;
   if(gTeam[i]==0) continue;
   if(zabil[i]==0) Ratio = 0.00;
   else Ratio = Float:zabil[i]/Float:umrel[i];
   format(String, 100, "%s: Zabil: %d  Umrel: %d  Teamkill: %d  Ratio: %0.2f", Jmeno(i), zabil[i], umrel[i], teamkill[i],Ratio);
   SaveWrite(SaveFile, String);
   }

   fclose(SaveFile);

   } else {
           SendClientMessageToAll(COLOR_RED, "< FUNC > Static Error.");
           print("< FUNC > Static Error.");
           return false;
   }
   return true;
}

Mely by se zapisovat statistiky o kole, ale kdyz skonci kolo, jdu se podivat do scrtiptfiles, nic tam neni..

Btw.. nvm jestli nemam neco dat do OnPlayerDeath

Nebo udelat podminku do publicu az bude score ktere nastavim coz je true

tak ze to vyvola funkci a zapise se to tam. Poradte prosim.. dekuju..:-)

 

-- ned 10. říj 2010 17:34:22 --

 

PS: testuju to na Win Serveru.. tak nevim jestli to jeste neni tim.. ale to asi ne.. :(

 

-- ned 10. říj 2010 18:39:05 --

 

Muzete lock :-)

Link to comment
Share on other sites

9 odpovědí na tuto otázku

Recommended Posts

  • 0

používaj dini, priehľadnejšie a lepšie ;)

 

fuj, by adaxx... on to takto "skracuje" btw a to fremove to zmaže (zložku) :d

if(fexist(cesta)) {print(" slozka \"cwmode\\report\" [OK]");fremove(cesta);}

Link to comment
Share on other sites

  • 0

myslenie je ho*no vedieť

ono je to to isté ;)

ved si kukni zdrojáky dini, uvidíš je to to isté je iba rozdiel že nemusíš

 

new File:SaveFile = fopen("...", io_append);

fwrite

....

 

.

fclose(...);

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...