Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.99 KB | None | 0 0
  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.     new File:SubZero=fopen(formatted,io_read);
  17.     fread(SubZero,strp);
  18.     fclose(SubZero);
  19.     return strval(strp);
  20. }
  21. stock AddLevel(playerid) //Adiciona mais um level ao player
  22. {
  23.     new Nomesz[25],strp[10],formatted[40];
  24.     GetPlayerName(playerid,Nomesz,25);
  25.     new File:SubZero=fopen(formatted,io_read);
  26.     fread(SubZero,strp);
  27.     fclose(SubZero);
  28.     new level=strval(strp);
  29.     new StakLine[10];
  30.     format(StakLine,10,"%d",level+1);
  31.     new File:SubZero2=fopen(formatted,io_write);
  32.     fwrite(SubZero2,StakLine);
  33.     fclose(SubZero2);
  34.     return 1;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement