Advertisement
Guest User

Untitled

a guest
Mar 15th, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.78 KB | None | 0 0
  1. Кај дефинициите најгоре во скриптата додавате
  2. Код: [Избери]
  3.  
  4. #define EXPIRE_MINUTES 5
  5.  
  6.  
  7. Потоа под new каде што ви се дефинирани textdrawite додадете
  8. Код: [Избери]
  9.  
  10. new Text:exp[MAX_PLAYERS];
  11.  
  12.  
  13. После, под било кој forward додавате
  14. Код: [Избери]
  15.  
  16. forward OneMinute();
  17. forward ExpTimer();
  18.  
  19.  
  20. Исто така под new(во некои gamemodes околу 1000 линија)
  21. Код: [Избери]
  22.  
  23. new levelexp = 240;
  24.  
  25.  
  26. Под enum pInfo додавате
  27. Код: [Избери]
  28.  
  29. pExp,
  30.  
  31.  
  32. Кај textdrawite под public OnPlayerConnect додаваме
  33. Код: [Избери]
  34.  
  35. //TEXTDRAW POD PARITE
  36. exp[playerid] = TextDrawCreate(553.000000, 102.000000, "_");
  37. TextDrawAlignment(exp[playerid], 2);
  38. TextDrawBackgroundColor(exp[playerid], 255);
  39. TextDrawFont(exp[playerid], 1);
  40. TextDrawLetterSize(exp[playerid], 0.299998, 1.499999);
  41. TextDrawColor(exp[playerid], -1);
  42. TextDrawSetOutline(exp[playerid], 1);
  43. TextDrawSetProportional(exp[playerid], 0);
  44. TextDrawUseBox(exp[playerid], 1);
  45. TextDrawBoxColor(exp[playerid], 36);
  46. TextDrawTextSize(exp[playerid], 318.000000, 110.000000);
  47.  
  48.  
  49. Исто така под OnPlayerConnect подоле додаваме
  50. Код: [Избери]
  51.  
  52. PlayerInfo[playerid][pExp] = 0;
  53.  
  54.  
  55. кај тајмерите додавате
  56. Код: [Избери]
  57.  
  58. exptimer = SetTimer("ExpTimer", 100, 1);
  59. oneminute = SetTimer("OneMinute", 60000, 1);
  60.  
  61.  
  62. под public OnPlayerRegister додавате
  63. Код: [Избери]
  64.  
  65. format(var, 64, "Respect=%d\n",PlayerInfo[playerid][pExp]);fwrite(hFile, var);
  66.  
  67.  
  68. исто така и под OnPlayerLogin(EXRP gamemode под sacuvajigraca)
  69. Код: [Избери]
  70.  
  71. format(var, 64, "Respect=%d\n",PlayerInfo[playerid][pExp]);fwrite(hFile, var);
  72.  
  73.  
  74. исто така под OnPlayerLogin
  75. Код: [Избери]
  76.  
  77. if( strcmp( key , "Respect" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pExp] = strval( val ); }
  78.  
  79.  
  80. Кај текстот кога ќе се логирате(особено Вашиот донатор ранк е тој и тој)
  81. Код: [Избери]
  82.  
  83. new string[128];
  84. new nxtlevel = PlayerInfo[playerid][pLevel]+1;
  85. new expamount = nxtlevel*levelexp;
  86. format(string, sizeof(string), "%d / %d",PlayerInfo[playerid][pExp],expamount);
  87. TextDrawSetString(exp[playerid], string);
  88. TextDrawShowForPlayer(playerid, exp[playerid]);
  89.  
  90.  
  91. Би требало да излгеда вака
  92. Код: [Избери]
  93.  
  94. new drank[128];
  95. if(PlayerInfo[playerid][pDonateRank] == 1) { drank = "Easy User"; }
  96. else if(PlayerInfo[playerid][pDonateRank] == 2) { drank = "Medium User"; }
  97. else if(PlayerInfo[playerid][pDonateRank] == 3) { drank = "Hard User"; }
  98. else { drank = "0"; }
  99. new string[128];
  100. new nxtlevel = PlayerInfo[playerid][pLevel]+1;
  101. new expamount = nxtlevel*levelexp;
  102. format(string, sizeof(string), "%d / %d",PlayerInfo[playerid][pExp],expamount);
  103. TextDrawSetString(exp[playerid], string);
  104. TextDrawShowForPlayer(playerid, exp[playerid]);
  105. if(PlayerInfo[playerid][pDonateRank] >= 1)
  106. {
  107. format(string2, sizeof(string2), "{37F906}INFO:{FFFFFF}Vasiot donator level e %s.", drank);
  108. SCM(playerid, WHITE, string2);
  109. }
  110.  
  111.  
  112. На крајот од gamemodot додаваме
  113. Код: [Избери]
  114.  
  115. public ExpTimer()
  116. {
  117. for(new i = 0; i < MAX_PLAYERS; i++)
  118. {
  119. if(IsPlayerConnected(i))
  120. {
  121. if (gPlayerLogged[i] != 0)
  122. {
  123. if(PlayerInfo[i][pLevel] >= 0)
  124. {
  125. new nxtlevel = PlayerInfo[i][pLevel]+1;
  126. new expamount = nxtlevel*levelexp;
  127. new infostring[128];
  128. new string[128];
  129. if (PlayerInfo[i][pExp] < expamount)
  130. {
  131. return 1;
  132. }
  133. else
  134. {
  135. format(string, sizeof(string), "~y~POKACIVTE ~y~ LEVEL !");
  136. GameTextForPlayer(i, string, 5000, 4);
  137. PlayerPlaySound(i, 1052, 0.0, 0.0, 0.0);
  138. PlayerInfo[i][pLevel]++;
  139. if(PlayerInfo[i][pDonateRank] > 0)
  140. {
  141. PlayerInfo[i][pExp] -= expamount;
  142. new total = PlayerInfo[i][pExp];
  143. if(total > 0)
  144. {
  145. PlayerInfo[i][pExp] = total;
  146. }
  147. else
  148. {
  149. PlayerInfo[i][pExp] = 0;
  150. }
  151. }
  152. else
  153. {
  154. PlayerInfo[i][pExp] = 0;
  155. }
  156. }
  157. }
  158. return 1;
  159. }
  160. else
  161. {
  162. }
  163. }
  164. }
  165. }
  166.  
  167. public OneMinute()
  168. {
  169. for(new i = 0; i < MAX_PLAYERS; i++)
  170. {
  171. PlayerInfo[i][pExp]++;
  172. new string[128];
  173. new nxtlevel = PlayerInfo[i][pLevel]+1;
  174. new expamount = nxtlevel*levelexp;
  175. format(string, sizeof(string), "%d / %d",PlayerInfo[i][pExp],expamount);
  176. TextDrawSetString(exp[i], string);
  177. }
  178. return 1;
  179. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement