Guest User

Untitled

a guest
Jan 9th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.75 KB | None | 0 0
  1. public SetPlayerUnjail()
  2. {
  3. if(painttime > 0)
  4. {
  5. painttime--;
  6. }
  7. foreach(Player, z)
  8. {
  9. if(playerVariables[z][pDD] >= 1)
  10. {
  11. playerVariables[z][pDD] --;
  12. }
  13. if(playerVariables[z][pDs] >= 1)
  14. {
  15. playerVariables[z][pDs] --;
  16. }
  17. if(playerVariables[z][pDr] >= 1)
  18. {
  19. playerVariables[z][pDr] --;
  20. }
  21. }
  22. for(new iGroup; iGroup < MAX_GROUPS; iGroup++)
  23. {
  24. if(groupVariables[iGroup][gDeelay] >= 1)
  25. {
  26. groupVariables[iGroup][gDeelay]--;
  27. }
  28. }
  29. for(new i = 0; i <= sizeof(TurfInfo); i++)
  30. {
  31. new string[256];
  32. new count = 0;
  33. new att = WarInfo[i][wAttacker];
  34. new deff = WarInfo[i][wFaction];
  35. if(WarInfo[i][wTime] > 0)
  36. {
  37. WarInfo[i][wTime] -= 1;
  38. foreach(Player, x)
  39. {
  40. if(playerVariables[x][pGroup] == WarInfo[i][wAttacker])
  41. {
  42. if(IsPlayerInTurf(x , i))
  43. {
  44. count++;
  45. }
  46. }
  47.  
  48. if(groupVariables[playerVariables[x][pGroup]][gInWar] == 0)
  49. {
  50. foreach(Player, a)
  51. {
  52. SetPlayerMarkerForPlayer( x, a, ( GetPlayerColor( a ) & 0xFFFFFF00 ) );
  53. }
  54. }
  55. if(playerVariables[x][pGroup] == WarInfo[i][wAttacker] || playerVariables[x][pGroup] == WarInfo[i][wFaction])
  56. {
  57. new time = WarInfo[i][wTime];
  58. TextDrawShowForPlayer(x, tTimer[x]);
  59. format(string, sizeof(string), "War time: ~y~%s ~w~", CalculeazaTimp(time));
  60. TextDrawSetString(tTimer[x], string);
  61. GangZoneFlashForPlayer(x, Turfs[i], COLOR_RED);
  62. if(IsPlayerInTurf(x, i))
  63. {
  64. if(IsPlayerInAnyVehicle(x))
  65. {
  66. if(JustRemoved[x] == 0)
  67. {
  68. RemovePlayerFromVehicle(x);
  69. SendClientMessage(x, COLOR_RED, "Nu ai voie intr-o masina pe turf!");
  70. JustRemoved[x] = 1;
  71. }
  72. }
  73. }
  74.  
  75. foreach(Player, a)
  76. {
  77. if((playerVariables[x][pGroup] == WarInfo[i][wAttacker] || playerVariables[x][pGroup] == WarInfo[i][wFaction]) && groupVariables[playerVariables[x][pGroup]][gInWar] == 1 && (playerVariables[a][pGroup] == WarInfo[i][wAttacker] || playerVariables[a][pGroup] == WarInfo[i][wFaction]))
  78. {
  79. SetPlayerMarkerForPlayer(x, a, GetPlayerColor(a));
  80. }
  81. }
  82.  
  83. if(GetPlayerState(x) == PLAYER_STATE_ONFOOT)
  84. {
  85. JustRemoved[x] = 0;
  86. }
  87.  
  88. }
  89. else if(playerVariables[x][pGroup] == 0)
  90. {
  91. TextDrawHideForPlayer(x, tTimer[x]);
  92. GangZoneStopFlashForPlayer(x, Turfs[i]);
  93. }
  94. }
  95. if(count == 0)
  96. {
  97.  
  98. groupVariables[WarInfo[i][wFaction]][gInWar] = 0;
  99. groupVariables[WarInfo[i][wAttacker]][gInWar] = 0;
  100. groupVariables[att][gDeelay] = 600;
  101. new id;
  102. id = CalculateBestScore(i);
  103. new id2 = CalculateWorstScore(i);
  104. format(szMessage, sizeof(szMessage), "--------------------[war overview]-----------------");
  105. SendToGroup(att, COLOR_ATTACK, szMessage);
  106. SendToGroup(deff, COLOR_ATTACK, szMessage);
  107. format(szMessage, sizeof(szMessage), "Score: %s %d - %d %s",groupVariables[WarInfo[i][wAttacker]][gGroupName] , groupVariables[WarInfo[i][wAttacker]][gScore], groupVariables[deff][gScore], groupVariables[deff][gGroupName]);
  108. SendToGroup(att, COLOR_ATTACK, szMessage);
  109. SendToGroup(deff, COLOR_ATTACK, szMessage);
  110. format(szMessage, sizeof(szMessage), "Best score: %s (%i). Worst score: %s (%i)", playerVariables[id][pNormalName], playerVariables[id][pWarScore] - playerVariables[id][pWarDeaths], playerVariables[id2][pNormalName], playerVariables[id2][pWarScore] - playerVariables[id2][pWarDeaths]);
  111. SendToGroup(att, COLOR_ATTACK, szMessage);
  112. SendToGroup(deff, COLOR_ATTACK, szMessage);
  113. foreach(Player, z)
  114. {
  115. TextDrawHideForPlayer(z, tTimer[z]);
  116. if(playerVariables[z][pGroup] == att || playerVariables[z][pGroup] == deff)
  117. {
  118. foreach(Player, a)
  119. {
  120. SetPlayerMarkerForPlayer( z, a, ( GetPlayerColor( a ) & 0xFFFFFF00 ) );
  121. }
  122. TextDrawHideForPlayer(z, tTimer[z]);
  123. format(szMessage, sizeof(szMessage), "Your personal score: %i", playerVariables[z][pWarScore] - playerVariables[z][pWarDeaths]);
  124. SendClientMessage(z, COLOR_ATTACK, szMessage);
  125. playerVariables[z][pWarScore] = 0;
  126. playerVariables[z][pWarDeaths] = 0;
  127. GangZoneShowForPlayerEx(z, Turfs[i], GetTeamZoneColor(TurfInfo[i][zOwned]));
  128. TextDrawHideForPlayer(z, War0[z]);
  129. TextDrawHideForPlayer(z, War1[z]);
  130. TextDrawHideForPlayer(z, War2[z]);
  131. TextDrawHideForPlayer(z, War3[z]);
  132.  
  133. JustRemoved[z] = 0;
  134. }
  135. }
  136. format(szMessage, sizeof(szMessage), "-------------------------------------");
  137. SendToGroup(att, COLOR_ATTACK, szMessage);
  138. SendToGroup(deff, COLOR_ATTACK, szMessage);
  139. format(szMessage, sizeof(szMessage), "[WAR] %s failed to win turf %i owned by %s because they left the turf.", groupVariables[att][gGroupName], i, groupVariables[deff][gGroupName]);
  140. SendToGroup(att, COLOR_ATTACK, szMessage);
  141. SendToGroup(deff, COLOR_ATTACK, szMessage);
  142. GangZoneStopFlashForAll(Turfs[i]);
  143. WarInfo[i][wTime] = 0;
  144. WarInfo[i][wAttacker] = 0;
  145. WarInfo[i][wFaction] = 0;
  146. }
  147. if(WarInfo[i][wTime] == 2)
  148. {
  149. if(groupVariables[WarInfo[i][wAttacker]][gScore] > groupVariables[WarInfo[i][wFaction]][gScore])
  150. {
  151. TurfInfo[i][zOwned] = WarInfo[i][wAttacker];
  152. format(result, sizeof(result), "UPDATE turfs SET Owned = '%d' WHERE ID = %d", TurfInfo[i][zOwned], i);
  153. mysql_tquery(handle, result);
  154. format(szMessage, sizeof(szMessage), "NR AdmBot: Gruparea mafiota %s a cucerit teritoriul %i care era detinut de mafia %s.", groupVariables[att][gGroupName], i, groupVariables[deff][gGroupName]);
  155. SendClientMessageToAll(COLOR_NEWSRP, szMessage);
  156. groupVariables[att][gDeelay] = 300;
  157. }
  158. else if(groupVariables[WarInfo[i][wAttacker]][gScore] < groupVariables[WarInfo[i][wFaction]][gScore])
  159. {
  160. TurfInfo[i][zOwned] = WarInfo[i][wFaction];
  161. format(result, sizeof(result), "UPDATE turfs SET Owned = '%d' WHERE ID = %d", TurfInfo[i][zOwned], i);
  162. mysql_tquery(handle, result);
  163. groupVariables[att][gDeelay] = 600;
  164. format(szMessage, sizeof(szMessage), "[WAR] %s failed to win turf %i owned by %s.", groupVariables[att][gGroupName], i, groupVariables[deff][gGroupName]);
  165. SendToGroup(att, COLOR_ATTACK, szMessage);
  166. SendToGroup(deff, COLOR_ATTACK, szMessage);
  167. }
  168. else if(groupVariables[WarInfo[i][wAttacker]][gScore] == groupVariables[WarInfo[i][wFaction]][gScore])
  169. {
  170. TurfInfo[i][zOwned] = WarInfo[i][wFaction];
  171. format(result, sizeof(result), "UPDATE turfs SET Owned = '%d' WHERE ID = %d", TurfInfo[i][zOwned], i);
  172. mysql_tquery(handle, result);
  173. groupVariables[att][gDeelay] = 600;
  174. format(szMessage, sizeof(szMessage), "[WAR] %s failed to win turf %i owned by %s.", groupVariables[att][gGroupName], i, groupVariables[deff][gGroupName]);
  175. SendToGroup(att, COLOR_ATTACK, szMessage);
  176. SendToGroup(deff, COLOR_ATTACK, szMessage);
  177. }
  178. new id;
  179. id = CalculateBestScore(i);
  180. new id2 = CalculateWorstScore(i);
  181. groupVariables[WarInfo[i][wFaction]][gInWar] = 0;
  182. groupVariables[WarInfo[i][wAttacker]][gInWar] = 0;
  183. format(szMessage, sizeof(szMessage), "--------------------[war overview]-----------------");
  184. SendToGroup(att, COLOR_ATTACK, szMessage);
  185. SendToGroup(deff, COLOR_ATTACK, szMessage);
  186. format(szMessage, sizeof(szMessage), "Score: %s %d - %d %s",groupVariables[WarInfo[i][wAttacker]][gGroupName] , groupVariables[WarInfo[i][wAttacker]][gScore], groupVariables[deff][gScore], groupVariables[deff][gGroupName]);
  187. SendToGroup(att, COLOR_ATTACK, szMessage);
  188. SendToGroup(deff, COLOR_ATTACK, szMessage);
  189. format(szMessage, sizeof(szMessage), "Best score: %s (%i). Worst score: %s (%i)", playerVariables[id][pNormalName], playerVariables[id][pWarScore] - playerVariables[id][pWarDeaths], playerVariables[id2][pNormalName], playerVariables[id2][pWarScore] - playerVariables[id2][pWarDeaths]);
  190. SendToGroup(att, COLOR_ATTACK, szMessage);
  191. SendToGroup(deff, COLOR_ATTACK, szMessage);
  192. foreach(Player, z)
  193. {
  194. TextDrawHideForPlayer(z, tTimer[z]);
  195. if(playerVariables[z][pGroup] == att || playerVariables[z][pGroup] == deff)
  196. {
  197. foreach(Player, a)
  198. {
  199. SetPlayerMarkerForPlayer( z, a, ( GetPlayerColor( a ) & 0xFFFFFF00 ) );
  200. }
  201. TextDrawHideForPlayer(z, tTimer[z]);
  202. format(szMessage, sizeof(szMessage), "Your personal score: %i", playerVariables[z][pWarScore] - playerVariables[z][pWarDeaths]);
  203. SendClientMessage(z, COLOR_ATTACK, szMessage);
  204. playerVariables[z][pWarScore] = 0;
  205. playerVariables[z][pWarDeaths] = 0;
  206. GangZoneShowForPlayerEx(z, Turfs[i], GetTeamZoneColor(TurfInfo[i][zOwned]));
  207. JustRemoved[z] = 0;
  208. }
  209. }
  210. format(szMessage, sizeof(szMessage), "-------------------------------------");
  211. SendToGroup(att, COLOR_ATTACK, szMessage);
  212. SendToGroup(deff, COLOR_ATTACK, szMessage);
  213. GangZoneStopFlashForAll(Turfs[i]);
  214. WarInfo[i][wTime] = 0;
  215. WarInfo[i][wAttacker] = 0;
  216. WarInfo[i][wFaction] = 0;
  217. }
  218. }
  219. }
  220. foreach(Player, i)
  221. {
  222. if(IsPlayerConnected(i))
  223. {
  224. if(PaintballRound == 1 && PlayerPaintballing[i] != 0)
  225. {
  226. new string[256];
  227. format(string,sizeof(string),"Paintball time: %s", CalculeazaTimp2(painttime));
  228. TextDrawSetString(Paintball[3][i], string);
  229. TextDrawShowForPlayer(i, Paintball[3][i]);
  230. }
  231. if(PlayerStoned[i] >= 2)
  232. {
  233. new Float:angle;
  234. GetPlayerFacingAngle(i, angle);
  235. if(IsPlayerInAnyVehicle(i))
  236. {
  237. if(GetPlayerState(i) == 2)
  238. {
  239. SetVehicleZAngle(GetPlayerVehicleID(i), angle + 15);
  240. SetPlayerDrunkLevel (i, 5000);
  241. }
  242. }
  243. else
  244. {
  245. SetPlayerDrunkLevel (i, 5000);
  246. }
  247. }
  248. if(MedicCallTime[i] > 0)
  249. {
  250. if(MedicAccepted[i] < 999)
  251. {
  252. if(IsPlayerConnected(MedicAccepted[i]))
  253. {
  254. new Float:X,Float:Y,Float:Z;
  255. GetPlayerPos(MedicAccepted[i], X, Y, Z);
  256. SetPlayerCheckpoint(i, X, Y, Z, 5);
  257. }
  258. }
  259. }
  260. if(TaxiCallTime[i] > 0)
  261. {
  262. if(TaxiAccepted[i] < 999)
  263. {
  264. if(IsPlayerConnected(TaxiAccepted[i]))
  265. {
  266. new Float:X,Float:Y,Float:Z;
  267. GetPlayerPos(TaxiAccepted[i], X, Y, Z);
  268. SetPlayerCheckpoint(i, X, Y, Z, 5);
  269. }
  270. }
  271. }
  272.  
  273. if(FindTime[i] > 0)
  274. {
  275. if(PlayerFind[i] != 999)
  276. {
  277. new Float:X,Float:Y,Float:Z;
  278. GetPlayerPos(PlayerFind[i], X,Y,Z);
  279. SetPlayerCheckpoint(i, X,Y,Z, 6);
  280. }
  281. }
  282. }
  283. }
  284. }
Add Comment
Please, Sign In to add comment