Advertisement
Guest User

FTP tesztelő

a guest
Nov 1st, 2016
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.85 KB | None | 0 0
  1. #include <a_samp>
  2. #include <ftp>
  3.  
  4. // Ha muszáj követni az elnevezéseket..
  5. #define Connect CreateFTP
  6. #define Disconnect DestroyFTP
  7. #define Download DownloadFTP
  8.  
  9. public OnFilterScriptInit() {
  10.     Connect("127.0.0.1", 21, "tesztnev", "tesztjelszo");
  11.     return 1;
  12. }
  13.  
  14. public OnFTPConnected(ftpId) {
  15.     printf("[FTP #%i] Kapcsolat létrejött", ftpId);
  16.     printf("[FTP #%i] Letöltés indítása... teszt.txt", ftpId);
  17.  
  18.     //Download(ftpId, "teszt.7z", "teszt.7z"); // nem jó
  19.    
  20.     // Nagyon alap, egy egyszerű txt fájl letöltése..
  21.     Download(ftpId, "teszt.txt", "teszt.txt");
  22.     return 1;
  23. }
  24.  
  25. public OnFileDownloaded(ftpId, file[], savedAs[]) {
  26.     printf("[FTP #%i] %s letöltve ide: %s", ftpId, file, savedAs);
  27.     Disconnect(ftpId);
  28.     return 1;
  29. }
  30.  
  31. public OnFTPDisconnected(ftpId) {
  32.     printf("[FTP #%i] Kapcsolat bontva", ftpId);
  33.     return 1;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement