Guest User

pomoc

a guest
Jan 11th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.93 KB | None | 0 0
  1. na vrh
  2. Kod: [Odaberi]
  3.  
  4. new oplayers, Precord, Drecord, Mrecord, Yrecord, THrecord, TMrecord;
  5. new mname[][] = {"Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"};
  6.  
  7. pod onplayerdisconnec t ovo
  8. Kod: [Odaberi]
  9.  
  10. oplayers--;
  11.  
  12. Kod: [Odaberi]
  13.  
  14. forward LoadRecord();
  15. public LoadRecord()
  16. {
  17. new strFromFile[24], arrCoords[6][5], File: file = fopen("porecords", io_read);
  18. if (file)
  19. {
  20. fread(file, strFromFile);
  21. split(strFromFile, arrCoords, ',');
  22. Precord = strval(arrCoords[0]);
  23. Drecord = strval(arrCoords[1]);
  24. Mrecord = strval(arrCoords[2]);
  25. Yrecord = strval(arrCoords[3]);
  26. THrecord = strval(arrCoords[4]);
  27. TMrecord = strval(arrCoords[5]);
  28. fclose(file);
  29. }
  30. return 1;
  31. }
  32. forward SaveRecord();
  33. public SaveRecord()
  34. {
  35. new coordsstring[24];
  36. format(coordsstring, sizeof(coordsstring), "%d,%d,%d,%d,%d,%d", Precord, Drecord, Mrecord, Yrecord, THrecord, TMrecord);
  37. new File: file = fopen("porecords", io_write);
  38. fwrite(file, coordsstring);
  39. fclose(file);
  40. return 1;
  41. }
  42. forward Record(playerid);
  43. public Record(playerid)
  44. {
  45. if(Precord)
  46. {
  47. new string[92];
  48. format(string, sizeof(string), "**rekord igraca %d, sada je narasao %d %s %d, na %d:%d", Precord, Drecord, mname[Mrecord-1], Yrecord, THrecord, TMrecord);
  49. SendClientMessage(playerid, 0xA5D24DFF, string);
  50. }
  51. oplayers++;
  52. if(Precord < oplayers)
  53. {
  54. Precord=oplayers;
  55. gettime(THrecord, TMrecord); getdate(Yrecord, Mrecord, Drecord);
  56. new string[92];
  57. format(string, sizeof(string), "*NOVI REKORD IGRACA %d, stavljen na %d %s %d, at %d:%d", Precord, Drecord, mname[Mrecord-1], Yrecord, THrecord, TMrecord);
  58. SendClientMessageToAll(0xFCB833FF, string);
  59. SaveRecord();
  60. }
  61. return 1;
  62. }
  63.  
  64. takodje stavis i ovo na kraj skripte
  65. Kod: [Odaberi]
  66.  
  67. forward ConnectedPlayers();
  68. public ConnectedPlayers()
  69. {
  70. new Connected;
  71. for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && !IsPlayerNPC(i)) Connected++;
  72. return Connected;
  73. }
  74.  
  75. takodje stavi ovo pod onplayerconnect
  76. Kod: [Odaberi]
  77.  
  78. SetTimerEx("Record", 5000, false, "d", playerid)
  79.  
  80.  
  81. -----------------------------------------------------------------------------------
  82. TAKO JE BLEAKS URADIO ALI SAD KAKO JA DA DODAM SVOJ TEXTDRAW
  83. JEL NEMA TU TEXT REKORDO CU SVOJ JA URADIO SVOJ TEXTDRAW
  84. GDE GDA TREBA DODAT
  85.  
  86. -------------------------------------------------------------------------------------
  87. // Create the textdraws:
  88. Textdraw0 = TextDrawCreate(487.000000, 394.000000, "00:");
  89. TextDrawBackgroundColor(Textdraw0, 255);
  90. TextDrawFont(Textdraw0, 2);
  91. TextDrawLetterSize(Textdraw0, 0.380000, 1.000000);
  92. TextDrawColor(Textdraw0, -1);
  93. TextDrawSetOutline(Textdraw0, 0);
  94. TextDrawSetProportional(Textdraw0, 1);
  95. TextDrawSetShadow(Textdraw0, 1);
  96.  
  97. Textdraw1 = TextDrawCreate(485.000000, 408.000000, "Rekord");
  98. TextDrawBackgroundColor(Textdraw1, 255);
  99. TextDrawFont(Textdraw1, 2);
  100. TextDrawLetterSize(Textdraw1, 0.380000, 1.200000);
  101. TextDrawColor(Textdraw1, -1);
  102. TextDrawSetOutline(Textdraw1, 0);
  103. TextDrawSetProportional(Textdraw1, 1);
  104. TextDrawSetShadow(Textdraw1, 1);
  105.  
  106. Textdraw2 = TextDrawCreate(610.000000, 395.000000, "00");
  107. TextDrawBackgroundColor(Textdraw2, 255);
  108. TextDrawFont(Textdraw2, 2);
  109. TextDrawLetterSize(Textdraw2, 0.500000, 1.000000);
  110. TextDrawColor(Textdraw2, -1);
  111. TextDrawSetOutline(Textdraw2, 0);
  112. TextDrawSetProportional(Textdraw2, 1);
  113. TextDrawSetShadow(Textdraw2, 1);
  114.  
  115. Textdraw3 = TextDrawCreate(613.000000, 410.000000, "Igraci");
  116. TextDrawBackgroundColor(Textdraw3, 255);
  117. TextDrawFont(Textdraw3, 2);
  118. TextDrawLetterSize(Textdraw3, 0.500000, 1.000000);
  119. TextDrawColor(Textdraw3, -1);
  120. TextDrawSetOutline(Textdraw3, 0);
  121. TextDrawSetProportional(Textdraw3, 1);
  122. TextDrawSetShadow(Textdraw3, 1);
  123. ------------------------------------------------
  124. ako moze dami kazete gde treba ga stavit i dami stavite pliz il gde treba stavit Textdarw0,textdraw,1,23
  125.  
  126. pliz
Advertisement
Add Comment
Please, Sign In to add comment