SHARE
TWEET

lol

a guest Oct 6th, 2010 238 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. stock CriarArquivoLevels(playerid) //Cria o arquivo em Scriptfiles/Levels
  2. {
  3.         new formatted[40],Nomesz[25];
  4.         GetPlayerName(playerid,Nomesz,25);
  5.         format(formatted,40,"Levels/%s.subzero",Nomesz);
  6.         if(fexist(formatted)) return 0;
  7.         new File:SubZero=fopen(formatted,io_write);
  8.         fwrite(SubZero,"0");
  9.         fclose(SubZero);
  10.         return 1;
  11. }
  12. stock PegarLevel(playerid) //Retorna o level do player
  13. {
  14.         new Nomesz[25],strp[10],formatted[40];
  15.         GetPlayerName(playerid,Nomesz,25);
  16.         format(formatted,40,"Levels/%s.subzero",Nomesz);
  17.         if(fexist(formatted)) return 0;
  18.         new File:SubZero=fopen(formatted,io_read);
  19.         fread(SubZero,strp);
  20.         fclose(SubZero);
  21.         return strval(strp);
  22. }
  23. stock AddLevel(playerid) //Adiciona mais um level ao player
  24. {
  25.         new Nomesz[25],strp[10],formatted[40];
  26.         GetPlayerName(playerid,Nomesz,25);
  27.         format(formatted,40,"Levels/%s.subzero",Nomesz);
  28.         if(fexist(formatted)) return 0;
  29.         new File:SubZero=fopen(formatted,io_read);
  30.         fread(SubZero,strp);
  31.         fclose(SubZero);
  32.         new level=strval(strp);
  33.         new StakLine[10];
  34.         format(StakLine,10,"%d",level+1);
  35.         new File:SubZero2=fopen(formatted,io_write);
  36.         fwrite(SubZero2,StakLine);
  37.         fclose(SubZero2);
  38.         return 1;
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top