Advertisement
Guest User

Untitled

a guest
Jul 9th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.75 KB | None | 0 0
  1. timer CheckPlayerLoginKeys[200](playerid)
  2. {
  3. new keys, ud, lr;
  4.     GetPlayerKeys(playerid, keys, ud, lr);
  5.  
  6.     if(lr > 0)
  7.     {
  8.         SelectedCharacter[playerid] ++;
  9.         TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  R  S~n~T  U  V  Z  Q  W  Y  X  0  1  2  3  4  5  6  7  8  9");
  10.  
  11.         mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid));
  12.         mysql_query(Query);
  13.         mysql_store_result();
  14.  
  15.         if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN   DELETE");
  16.         else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER   DELETE");
  17.     }
  18.     else if(lr < 0)
  19.     {
  20.         SelectedCharacter[playerid] --;
  21.         TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  R  S~n~T  U  V  Z  Q  W  Y  X  0  1  2  3  4  5  6  7  8  9");
  22.  
  23.         mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid));
  24.         mysql_query(Query);
  25.         mysql_store_result();
  26.  
  27.         if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN   DELETE");
  28.         else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER   DELETE");
  29.     }
  30.  
  31. /*
  32. TU TEXTDRAWY
  33. */     
  34.  
  35.         mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid));
  36.         mysql_query(Query);
  37.         mysql_store_result();
  38.  
  39.         if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~b~~h~LOGIN   ~w~DELETE");
  40.         else TextDrawSetString(RegisterLoginTD[playerid][2], "~b~~h~REGISTER   ~w~DELETE");
  41.  
  42.         PlaceWhereIsCharacter[playerid] = 2;
  43.     }
  44.     else if(SelectedCharacter[playerid] == 37)
  45.     {
  46.         TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  R  S~n~T  U  V  Z  Q  W  Y  X  0  1  2  3  4  5  6  7  8  9");
  47.  
  48.         mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid));
  49.         mysql_query(Query);
  50.         mysql_store_result();
  51.  
  52.         if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN   ~b~~h~DELETE");
  53.         else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER   ~b~~h~DELETE");
  54.  
  55.         PlaceWhereIsCharacter[playerid] = 2;
  56.     }
  57.     else if(SelectedCharacter[playerid] == 38) SelectedCharacter[playerid] = 0;
  58.     else if(SelectedCharacter[playerid] == -1) SelectedCharacter[playerid] = 37;
  59.  
  60.     if(ud > 0)
  61.     {
  62.         TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  R  S~n~T  U  V  Z  Q  W  Y  X  0  1  2  3  4  5  6  7  8  9");
  63.  
  64.         mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid));
  65.         mysql_query(Query);
  66.         mysql_store_result();
  67.  
  68.         if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN   DELETE");
  69.         else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER   DELETE");
  70.  
  71.         if(PlaceWhereIsCharacter[playerid] == 0)
  72.         {
  73.             SelectedCharacter[playerid] = 18;
  74.         }
  75.         if(PlaceWhereIsCharacter[playerid] == 1)
  76.         {
  77.             SelectedCharacter[playerid] = 36;
  78.         }
  79.         if(PlaceWhereIsCharacter[playerid] == 2)
  80.         {
  81.             SelectedCharacter[playerid] = 0;
  82.         }
  83.     }
  84.     else if(ud < 0)
  85.     {
  86.         TextDrawSetString(RegisterLoginTD[playerid][1], "~w~A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  R  S~n~T  U  V  Z  Q  W  Y  X  0  1  2  3  4  5  6  7  8  9");
  87.  
  88.         mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid));
  89.         mysql_query(Query);
  90.         mysql_store_result();
  91.  
  92.         if(mysql_num_rows() == 1) TextDrawSetString(RegisterLoginTD[playerid][2], "~w~LOGIN   DELETE");
  93.         else TextDrawSetString(RegisterLoginTD[playerid][2], "~w~REGISTER   DELETE");
  94.  
  95. //reszta kodu
  96.  
  97.  
  98.         if(SelectedCharacter[playerid] == 36)
  99.         {
  100.             mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e' AND `Password` = md5('%e')", GetName(playerid), InputedWord[playerid]);
  101.             mysql_query(Query);
  102.             mysql_store_result();
  103.             if(mysql_num_rows() == 1)
  104.             {
  105.                 if(mysql_fetch_row_format(Query, "|"))
  106.                 {
  107.                     mysql_fetch_field_row(string, "Admin"); PlayerInfo[playerid][pAdmin] = strval(string);
  108.                     mysql_fetch_field_row(string, "Gamemaster"); PlayerInfo[playerid][pGameMaster] = strval(string);
  109.                     mysql_fetch_field_row(string, "Kills"); PlayerInfo[playerid][pKills] = strval(string);
  110.                     mysql_fetch_field_row(string, "Deaths"); PlayerInfo[playerid][pDeaths] = strval(string);
  111. ////////////////////////////////////
  112.  
  113. timer LoadingScreenTimer[100](playerid)
  114. {
  115.  
  116.     if(LoadingPercentage[playerid] == 100)
  117.     {
  118.         SendClientMessage(playerid, COLOR_YELLOW, "Use keys up-down and right-left and when you select action press F!");
  119.        
  120.         format(string, sizeof(string), "Welcome %s~n~~n~Please type your password!", GetName(playerid));
  121.         TextDrawSetString(RegisterLoginTD[playerid][0], string);
  122.        
  123.         LoadingPercentage[playerid] = 0;
  124.  
  125.         TextDrawHideForPlayer(playerid, RegisterLoginTD[playerid][5]);
  126.  
  127.         mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid));
  128.         mysql_query(Query);
  129.         mysql_store_result();
  130.        
  131.         SelectedCharacter[playerid] = 0;
  132.    
  133.         if(mysql_num_rows() == 1)
  134.         {
  135.             SendClientMessage(playerid, COLOR_LIME, "You are registered, please type your password!");
  136.             CPLK[playerid] = repeat CheckPlayerLoginKeys(playerid);
  137.            
  138.             TextDrawSetString(RegisterLoginTD[playerid][2], "LOGIN   DELETE");
  139.         }
  140.         else
  141.         {
  142.             SendClientMessage(playerid, COLOR_LIME, "You are not registered, please type your new password!");
  143.             CPRK[playerid] = repeat CheckPlayerRegisterKeys(playerid);
  144.            
  145.             TextDrawSetString(RegisterLoginTD[playerid][2], "REGISTER   DELETE");
  146.         }
  147.        
  148.  
  149.        
  150.         stop LST[playerid];
  151.     }
  152.     mysql_free_result();
  153.     return 1;
  154. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement