Advertisement
Guest User

Untitled

a guest
May 27th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.39 KB | None | 0 0
  1. function CallBestPlayerActive() {
  2. new string[128];
  3. mysql_format(SQL,string, sizeof(string),"SELECT name,ConnectedTime FROM users ORDER BY ConnectedTime DESC LIMIT 1");
  4. mysql_tquery(SQL,string,"BestPlayerActive","");
  5. return 1;
  6. }
  7.  
  8. function BestPlayerActive() {
  9. new name[32]; cache_get_field_content(0,"name",name);
  10. new string[256];
  11. new id = GetPlayerID(name);
  12. if(IsPlayerConnected(id)) {
  13. format(string, sizeof(string), "%s are ce le mai multe ore jucate de pe server! Acesta detine %0.2f ore jucate!", GetName(id), PlayerInfo[id][pConnectTime]);
  14. SCMTA(COLOR_LIGHTRED, string);
  15. SCM(id, COLOR_YELLOW, "Deoarece esti cel mai activ jucator de pe server ti-a fost acordat gradul de NO LIFER.");
  16. SCM(id, COLOR_YELLOW, "Mentine suma de ore jucate cat mai mare, altfel vei pierde gradul.");
  17. PlayerInfo[id][pSefuActivilor] = 1;
  18. Update(id, pSefuActivilorx);
  19. PlayerInfo[id][pObtained1Pus] = 0;
  20. PlayerInfo[id][pObtained2Pus] = 0;
  21. PlayerInfo[id][pObtained3Pus] = 0;
  22. PlayerInfo[id][pObtained4Pus] = 1;
  23. Update(id, pObtained1Pusx);
  24. Update(id, pObtained2Pusx);
  25. Update(id, pObtained3Pusx);
  26. Update(id, pObtained4Pusx);
  27. if(IsValidDynamic3DTextLabel(YTScris[id])) DestroyDynamic3DTextLabel(YTScris[id]);
  28. if(IsValidDynamic3DTextLabel(VipScris[id])) DestroyDynamic3DTextLabel(VipScris[id]);
  29. if(IsValidDynamic3DTextLabel(BaniScris[id])) DestroyDynamic3DTextLabel(BaniScris[id]);
  30. if(IsValidDynamic3DTextLabel(ActivScris[id])) DestroyDynamic3DTextLabel(ActivScris[id]);
  31. AttachVipTags(id);
  32. }
  33. else {
  34. format(string, sizeof(string), "Offline: %s are ce le mai multe ore jucate de pe server! Acesta detine %0.2f ore jucate!", GetName(id), PlayerInfo[id][pConnectTime]);
  35. SCMTA(COLOR_LIGHTRED, string);
  36. }
  37. new query[128];
  38. format(query, sizeof(query),"UPDATE users SET `SefuActivilor`='0' WHERE `SefuActivilor`='1'");
  39. mysql_query(SQL,query);
  40.  
  41. format(query,sizeof(query),"UPDATE users SET `SefuActivilor`='1' WHERE `ID`='%d'",PlayerInfo[id][pSQLID]);
  42. mysql_query(SQL, query);
  43. return 1;
  44. }
  45.  
  46. function CallBestPlayerMoney() {
  47. new string[128];
  48. mysql_format(SQL,string, sizeof(string),"SELECT name,Bank FROM users ORDER BY Bank DESC LIMIT 1");
  49. mysql_tquery(SQL,string,"BestPlayerMoney","");
  50. return 1;
  51. }
  52.  
  53. function BestPlayerMoney() {
  54. new name[32]; cache_get_field_content(0,"name",name);
  55. new string[256];
  56. new id = GetPlayerID(name);
  57. if(IsPlayerConnected(id)) {
  58. format(string, sizeof(string), "%s este cel mai bogat jucator de pe server! Acesta detine $%s in banca!", GetName(id), FormatNumber(PlayerInfo[id][pAccount]));
  59. SCMTA(COLOR_LIGHTRED, string);
  60. SCM(id, COLOR_YELLOW, "Deoarece esti cel mai bogat jucator de pe server ti-a fost acordat gradul de SEFU LA BANI.");
  61. SCM(id, COLOR_YELLOW, "Mentine suma de bani in banca cat mai mare, altfel vei pierde gradul.");
  62. PlayerInfo[id][pSefuBaniilor] = 1;
  63. Update(id, pSefuBaniilorx);
  64. PlayerInfo[id][pObtained1Pus] = 0;
  65. PlayerInfo[id][pObtained2Pus] = 0;
  66. PlayerInfo[id][pObtained3Pus] = 1;
  67. PlayerInfo[id][pObtained4Pus] = 0;
  68. Update(id, pObtained1Pusx);
  69. Update(id, pObtained2Pusx);
  70. Update(id, pObtained3Pusx);
  71. Update(id, pObtained4Pusx);
  72. if(IsValidDynamic3DTextLabel(YTScris[id])) DestroyDynamic3DTextLabel(YTScris[id]);
  73. if(IsValidDynamic3DTextLabel(VipScris[id])) DestroyDynamic3DTextLabel(VipScris[id]);
  74. if(IsValidDynamic3DTextLabel(BaniScris[id])) DestroyDynamic3DTextLabel(BaniScris[id]);
  75. if(IsValidDynamic3DTextLabel(ActivScris[id])) DestroyDynamic3DTextLabel(ActivScris[id]);
  76. AttachVipTags(id);
  77. }
  78. else {
  79. format(string, sizeof(string), "Offline: %s este cel mai bogat jucator de pe server! Acesta detine $%s in banca!", GetName(id), FormatNumber(PlayerInfo[id][pAccount]));
  80. SCMTA(COLOR_LIGHTRED, string);
  81. }
  82. new query[128];
  83. format(query, sizeof(query),"UPDATE users SET `SefuBaniilor`='0' WHERE `SefuBaniilor`='1'");
  84. mysql_query(SQL,query);
  85.  
  86. format(query,sizeof(query),"UPDATE users SET `SefuBaniilor`='1' WHERE `ID`='%d'",PlayerInfo[id][pSQLID]);
  87. mysql_query(SQL, query);
  88. return 1;
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement