Guest User

Setplayerunjail error

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