Skocz do zawartości

ALT

Użytkownicy
  • Postów

    795
  • Dołączył

  • Ostatnia wizyta

Odpowiedzi opublikowane przez ALT

  1. MAcie kod:

    //index
    <p>
    
        <span style="font-family:courier new,courier,monospace;"><span style="font-size: 72px; ">\YOUR FOLDER</span></span></p>
    <p>
        <span style="font-family:courier new,courier,monospace;">\UPLOAD FILES HERE:</span></p>
    <html>
    <body>
      <form action="upload.php" method="POST" ENCTYPE="multipart/form-data">
       <input type="file" name="file"/><br/>
       <input type="submit" value="SEND"/>
    
      </form>
    </body>
    </html>

     

     

    //upload
    <?php
    
    $lok = './files/plik.file';
    move_uploaded_file($_FILES['file']['tmp_name'], $lok_);
    ?>

     

    Bardzo proste, ale na razie się bawie.

  2. Uczę się PHP i coś mi nie działa:

    Warning: move_uploaded_file() [function.move-uploaded-file]: Filename cannot be empty in /virtual/m/a/*******.ugu.pl/upload.php on line 4
    
    Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/virtual/tmp/phpXMSO4k' to '' in /virtual/m/a/*******.ugu.pl/upload.php on line 4

     

    Próbowałem zrobić upload plików. Ten error znaczy że upload plików jest na tej domenie zablokowany?

  3. Zaraz się zesram:

     

    #include <cstdlib>
    #include <iostream>
    #include <ctime>
    #include <conio.h>
    #include <string>
    #include <windows.h>
    
    using namespace std;
    #include "generator.h"
    
    
    int main(int argc, char *argv[])
    {
        
        
        int play=0;
        char get;
        int lol;
                 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 4);
                 cout << endl;
                 cout << endl;
                 cout << endl;
                 cout << "    ######## ######## ######## ######## ######## ######## ######## ########" << endl;
                 cout << "    ###  ### #  ##  # #      # #  ##  # #      # #  ##  # #     ## ###  ###" << endl;
                 cout << "    ##    ## #  ##  # #  ##### #   #  # ###  ### #  ##  # #  ##  # ##    ##" << endl;
                 cout << "    #  ##  # #  ##  # #    ### #      # ###  ### #  ##  # #  ##  # #  ##  #" << endl;
                 cout << "    #      # #  ##  # #  ##### #      # ###  ### #  ##  # #     ## #      #" << endl;
                 cout << "    #  ##  # ##    ## #  ##### #  #   # ###  ### #  ##  # #  #  ## #  ##  #" << endl;
                 cout << "    #  ##  # ###  ### #      # #  ##  # ###  ### ##    ## #  ##  # #  ##  #" << endl;
                 cout << "    ######## ######## ######## ######## ######## ######## ######## ########" << endl;
                 cout << endl;
                 cout << "                Wcisni 1 zeby zagrac" << endl;
    
    
                 lol = getche();
                 if (lol == 1)
                 {
                 system("cls");
                 play =1;
                 }
            
                
                     
                              while(1)
                              {
                                      if (play ==1)
                                      {                        
                                      
                                      
                                      
                                      
                                      }
                                      
                              };         
                              
                              
                              
                     
    };

     

     

     

    W czym tu jest błąd? Log:

     

     

    Rogue\main.cpp In function `void generate()':

    Rogue\main.cpp a function-definition is not allowed here before '{' token

    Rogue\main.cpp expected `,' or `;' before '{' token

    Rogue\main.cpp expected `}' at end of input

  4. Eh...

    void generate1(int xc, int yc)
    {
    
    
    system("cls");
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
    cout << "ZYCIE: "<<hp<<endl;
    cout << "SILA WOLI: "<<sw<<endl;
    cout << "MONETY: "<<gold<<endl;
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
    cout << endl; 
    int a,b;
          for (a=0;a<17;a++)
          {
          SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
          cout << endl;
          cout << " ";
          cout << " ";
          cout << " ";
          cout << " ";
          cout << " ";
          cout << " ";
          cout << " ";
          
               for (b=0;b<39;b++)
               { 
                   if ( b<xx-3 or b>xx+3 or a<yy-3 or  a>yy+3  )                       )            
                   {
                        
                  if (lvl1[a][b]==1)
                  {
                  SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 136);
                  cout << "#";                  
                  }
                  else if (lvl1[a][b]==0)
                  {
                       if (yc==a and xc==b)
                          {
                          SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 124);
                          cout << "@";     
                          }
                          else
                          {
                          SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 119);
                          cout << ".";
                          }     
                  }
                  else if (lvl1[a][b]==3)
                  {
                  SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
                  cout << " ";              
                  }
                  else if (lvl1[a][b]==4)
                  {
                  SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 120);
                  cout << "|";              
                  }
                  else if (lvl1[a][b]==5)
                  {
                       if (yc==a and xc==b)
                          {
                          SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 124);
                          cout << "@";     
                          }
                          else
                          {
                          SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
                          cout << "+";
                          }               
                  }
                  else if (lvl1[a][b]==6)
                  {
                  SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 9);
                  cout << "X";              
                  }
                  else if (lvl1[a][b]==7)
                  {
                  SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 126);
                  cout << "$";              
                  }
                  else if (lvl1[a][b]==8)
                  {
                  SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 9);
                  cout << "O";              
                  }
                  }
                  else
                   {
                  SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
                  cout << " ";              
                  }
                  
                       
    
              
              } 
          }
      
          
          
          
          
    
    
    
    
             
    };

  5. Mam taki kod:

    if ( b<xx-3 or  b>xx+3 or a<yy-3 or  a>yy+3  )
    {
    //Rysuje plansze
    }

     

    Ten kod powinien rysować plansze w zakresie 3 pozycji od gracza, a robi odwrotnie,nie rysuje w zakresie 3 pozycji od gracza, oto przykład:

    Bez_tytu_uaf81f.png

     

    Jak to naprawić?

  6. Mam kod w C++ który wygląda tak:

     

    <tu jest funkcja z zmiennymi xx i yy>

     

    <tu jest main z deklaracją zmiennych xx i yy>

     

    Tera pytanie: Co trzeba zrobić by funkcja znalazła zmienną? Jeżeli ją zadeklaruje w main wywala błąd, a ona musi być zadeklarowana w main :<

  7. Postanowiłem przepisać mojego rogalika pod c++, nie będę musiał bawić się ze spritami.

    I mam problem, nie wiem jak działa poruszanie się w rogaliku. W jaki sposób to działa?

    W taki że np.rysuje postać, a po kliku strzałki czyści ekran i rysuje postać z dodaną np. spacją obok?

×
×
  • Dodaj nową pozycję...