Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  1. CMD:draugai(playerid,params[])
  2. {
  3. if(isnull(params))
  4. {
  5. new QueryString[200];
  6. mysql_format(connectionHandle, QueryString, 200, "SELECT `Draugas` FROM `draugai` WHERE `Pridejo` = '%e' ORDER BY `ID` DESC LIMIT 20;", Vardas(playerid));
  7. mysql_function_query(connectionHandle, QueryString, true, "OnSelectDraugai", "d", playerid);
  8. }
  9. else
  10. {
  11. new id;
  12. if(sscanf(params, "u", id))
  13. {
  14. UsageMessage(playerid,"* Pridëti þaidëjà á draugø sàraðà /draugas Vardas_Pavarde [ID]");
  15. return 1;
  16. }
  17. if(id == playerid)
  18. {
  19. ErrorMsg(playerid,"* Savæs á draugus pridët negalima!");
  20. return 1;
  21. }
  22. if(!IsPlayerConnected(id))
  23. {
  24. ErrorMsg(playerid,"* Tokio þaidëjo nëra.");
  25. return 1;
  26. }
  27. if(PlayerDB[playerid][DraugaiVisi] == 20)
  28. {
  29. ErrorMsg(playerid,"* Daugiausiai gali turëti 20 draugø!");
  30. return 1;
  31. }
  32. new string[144];
  33. format(string, 144, "* %s pridëtas á draugø sàraðà.", Vardas(id));
  34. SendClientMessage(playerid, GELTONA, string);
  35. PlayerDB[playerid][DraugaiVisi]+=1;
  36. new QueryString[512];
  37. mysql_format(connectionHandle, QueryString, 512, "INSERT INTO `draugai`(`Draugas`, `Pridejo`) VALUES ('%e','%e');", Vardas(id),Vardas(playerid));
  38. mysql_function_query(connectionHandle, QueryString, false, "", "");
  39. }
  40. return 1;
  41. }
  42. forward OnSelectDraugai(playerid);
  43. public OnSelectDraugai(playerid)
  44. {
  45. if(cache_get_row_count() == 0)
  46. {
  47. ErrorMsg(playerid,"* Neturi draugø! Pridëk su komanda /draugas V_P");
  48. }
  49. else
  50. {
  51. new info[1000];
  52. for(new row=0;row<cache_get_row_count();row++)
  53. {
  54. new string[150];
  55. new Draugas[24];
  56. new id;
  57. cache_get_row(row, 0, Draugas);
  58. if(!sscanf(Draugas, "u", id))
  59. {
  60. if(IsPlayerConnected(id))
  61. {
  62. format(string, 150, "\n{00FF00}%s ON", Draugas);
  63. strcat(info, string);
  64. }
  65. else
  66. {
  67. format(string, 150, "\n{FF0000}%s OFF", Draugas);
  68. strcat(info, string);
  69. }
  70. }
  71. }
  72. ShowPlayerDialog(playerid, 246, DIALOG_STYLE_LIST, "Draugai", info, "Gerai", "");
  73. }
  74. return 1;
  75. }
  76. CMD:atsakiklis(playerid,params[])
  77. {
  78. new QueryString[200];
  79. mysql_format(connectionHandle, QueryString, 200, "SELECT `SenderName`, FROM_UNIXTIME(`SendingTime`) AS `GavimoLaikasData`, `Zinute` FROM `smszinutes` WHERE `ReceiverName` = '%e' ORDER BY `ID` DESC LIMIT 20;", Vardas(playerid));
  80. mysql_function_query(connectionHandle, QueryString, true, "OnSelectSMSZinutes", "d", playerid);
  81. return 1;
  82. }
  83. forward OnSelectSMSZinutes(playerid);
  84. public OnSelectSMSZinutes(playerid)
  85. {
  86. if(cache_get_row_count() == 0)
  87. {
  88. ErrorMsg(playerid,"* Atsakiklis tuðèias!");
  89. }
  90. else
  91. {
  92. new info[2048];
  93. for(new row=0;row<cache_get_row_count();row++)
  94. {
  95. new string[150];
  96. new SenderName[24];
  97. new GavimoLaikasData[20];
  98. new Zinute[144];
  99. cache_get_row(row, 0, SenderName);
  100. cache_get_row(row, 1, GavimoLaikasData);
  101. cache_get_row(row, 2, Zinute);
  102. format(string, 150, "\n[%s] %s: %s",GavimoLaikasData,SenderName,Zinute);
  103. strcat(info, string);
  104. }
  105. ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Atsakiklis", info, "Gerai", "");
  106. }
  107. return 1;
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement