whiplk

[COD] AccountCreate(complement to Files)

Mar 15th, 2012
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.66 KB | None | 0 0
  1. /* jVerify retorna o valor de algum arquivo.ini existente : false,
  2.    jCreateAccount cria um arquivo com nome de %s.ini juntamente com a senha, sem criptografia.
  3. */
  4. new File:j, str[128], write[128], Key_[128], Item_[128], nn[MAX_PLAYER_NAME];
  5.  
  6. stock jVerify(accFile[]) {
  7.     format(str, 40, "%s.ini", accFile);
  8.     return fexist(str);
  9. }
  10.  
  11. stock jCreateAccount(accFile[], senha[]) {
  12.     format(str, 40, "%s.ini", accFile);
  13.     if(fexist(str))
  14.         return false;
  15.        
  16.     j = fopen(str, io_write);
  17.     if(j)
  18.     {
  19.         format(write, 50, "Senha = %s", senha);
  20.         fwrite(j, write);
  21.         fclose(j);
  22.         return printf("Conta criada, nick: %s, senha: %s", accFile, senha), true;
  23.     }
  24.     return false;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment