Advertisement
Guest User

Untitled

a guest
May 24th, 2016
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. stock StartLicitatii()
  2. {
  3. new Cache: r, stringm[200];
  4. format(stringm, 200, "SELECT * FROM `users` WHERE House != 999 AND OrePeLuna < 6 ORDER BY `id` DESC");
  5. r = mysql_query(SQL, stringm);
  6.  
  7. printf("Sunt %dx Cache", cache_get_row_count());
  8.  
  9. new Get[ 2 ];
  10. cache_get_data(Get[0], Get[1], SQL);
  11.  
  12. new numar= 0;
  13. for(new i; i < Get[0]; i++)
  14. {
  15. numar ++;
  16. new idCasa;
  17. new Nume[MAX_PLAYER_NAME];
  18.  
  19. cache_get_field_content(i, "name", Nume, SQL, MAX_PLAYER_NAME );
  20. idCasa = cache_get_field_content_int(i, "House", SQL);
  21.  
  22. //print("2");
  23. if(strcmp(Nume, HouseInfo[idCasa][hOwner], true) == 0)
  24. {
  25. //print("3");
  26. TotalLicitatii ++;
  27.  
  28. mysql_format(SQL, stringm, sizeof(stringm), "INSERT INTO `licitatii` (`ID`, `HouseID`, `PretInceput`, `PretCurent`, `Lider`) VALUES (NULL, '%d', '%d', '0', '-1')", idCasa, HouseInfo[idCasa][hValue]);
  29. mysql_query(SQL, stringm);
  30.  
  31. LicInfo[TotalLicitatii][houseID] = idCasa;
  32. LicInfo[TotalLicitatii][LPretCurent] = 0;
  33. LicInfo[TotalLicitatii][LPretInceput] = HouseInfo[idCasa][hValue];
  34.  
  35. mysql_format(SQL, stringm, sizeof(stringm), "UPDATE `users` SET `House` = '999' WHERE `users`.`name` = '%s'", Nume);
  36. mysql_query(SQL, stringm);
  37.  
  38. HouseInfo[idCasa][hHel] = 0;
  39. HouseInfo[idCasa][hArm] = 0;
  40. HouseInfo[idCasa][hLock] = 0;
  41. HouseInfo[idCasa][hOwned] = 0;
  42. HouseInfo[idCasa][Licitata] = 1;
  43.  
  44. mysql_format(SQL, stringm, sizeof(stringm), "UPDATE `houses` SET `Hel` = '0', `Arm` = '-1', `Lockk` = '0', `Owned` = '0', `Owner`='The State', `Licitata` = '1' WHERE `houses`.`ID` = %d", idCasa);
  45. mysql_query(SQL, stringm);
  46.  
  47.  
  48. DestroyDynamic3DTextLabel(HouseLabel[idCasa]);
  49. DestroyDynamicPickup(HouseInfo[idCasa][hPickupID]);
  50. HouseInfo[idCasa][hPickupID] = CreateDynamicPickup(1272, 23, HouseInfo[idCasa][hEntrancex], HouseInfo[idCasa][hEntrancey], HouseInfo[idCasa][hEntrancez]);
  51.  
  52. //print("4");
  53.  
  54. format(stringm, sizeof(stringm),"{FFFFFF}Casa {54CC56}%d\n{FFFFFF}Aceasta casa este scoasa la licitatie!\nPretul la care s-a ajuns: {54CC56}$%s \n{FFFFFF}Pentru a licita foloseste /bid.",idCasa, FormatNumber(LicInfo[TotalLicitatii][LPretCurent]));
  55. HouseLabel[idCasa] = CreateDynamic3DTextLabel(stringm ,0x09FF00FF,HouseInfo[idCasa][hEntrancex], HouseInfo[idCasa][hEntrancey], HouseInfo[idCasa][hEntrancez],25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
  56.  
  57.  
  58. //print("5");
  59. if(IsPlayerConnected(GetPlayerID(Nume)))
  60. {
  61. PlayerInfo[GetPlayerID(Nume)][pPhousekey] = 999;
  62. PlayerInfo[GetPlayerID(Nume)][pRented] = -1;
  63. SCM(GetPlayerID(Nume), COLOR_LIGHTBLUE, "Casa ta a fost scoasa la licitatie automat din cauza ca n-ai jucat 6 ore in ultima luna!");
  64. }
  65.  
  66. printf("[Tura: %d] ID Casa: %d | Nume: %s", numar, LicInfo[TotalLicitatii][houseID], Nume);
  67. }
  68. }
  69. if(numar == 0) return SendClientMessageToAll(-1, "Licitatiile nu vor incepe deoarece nu exista jucatori inactivi.");
  70. printf("nr %d", numar);
  71. Licitatii = 1;
  72. cache_delete(r);
  73. return 1;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement