Guest User

Untitled

a guest
Oct 29th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.51 KB | None | 0 0
  1. public OnPlayerDeath(playerid, killerid, reason)
  2. {
  3. playerDeath[playerid] = 1;
  4. Update3DTextLabelText(deathLabel[playerid], COLOR_LIGHTRED, "[dead]");
  5. Attach3DTextLabelToPlayer(deathLabel[playerid], playerid, 0.0, 0.0, 0.3);
  6.  
  7. new string[180];
  8.  
  9. if(InRob[playerid] == 1) FailRob(playerid, "Ai fost omorat");
  10.  
  11. SetPlayerWorldBounds(playerid, 20000.0000, -20000.0000, 20000.0000, -20000.0000);
  12.  
  13. if(PlayerInfo[playerid][pWantedLevel] != 0) {
  14. new count, names[180];
  15. foreach(new i: Player) {
  16. if(IsACop(i) && CrimInRange(75.0, playerid,i) && OnDuty[i] == 1) {
  17. count = 1;
  18. format(string, sizeof(string), "running suspect bonus!");
  19. GameTextForPlayer(i, string, 3000, 1);
  20. ConsumingMoney[i] = 1;
  21. GivePlayerCash(i, PlayerInfo[playerid][pWantedLevel] * 2000);
  22. Update(i, pCashx);
  23. UpdateFactionRaport(i, 0);
  24.  
  25. format(string, sizeof(string), "Ai primit $%d bonus pentru prinderea suspectului %s.", PlayerInfo[playerid][pWantedLevel] * 2000, GetName(playerid));
  26. SCM(i, COLOR_DBLUE, string);
  27. format(names, 256, "%s %s", names, GetName(i));
  28. }
  29. if(count == 1) {
  30. if(ProxDetectorS(30.0, i, playerid)) {
  31. format(string, sizeof(string), "* %s is now in jail thanks to: %s", GetName(playerid), names);
  32. SCM(i, COLOR_PURPLE, string);
  33. }
  34. }
  35. }
  36. if(count == 1) {
  37. if(killerid == INVALID_PLAYER_ID) format(string, sizeof(string), "Dispatch: %s has been killed by No One and will be in jail for %d seconds, over.", GetName(playerid), (PlayerInfo[playerid][pWantedLevel])*(150));
  38. else format(string, sizeof(string), "Dispatch: %s has been killed by %s and will be in jail for %d seconds, over.", GetName(playerid), GetName(killerid), (PlayerInfo[playerid][pWantedLevel])*(150));
  39. SendTeamMessage(1, 0x2e64feFF, string);
  40. SendTeamMessage(2, 0x2e64feFF, string);
  41. SendTeamMessage(3, 0x2e64feFF, string);
  42.  
  43. GivePlayerCash(playerid, - PlayerInfo[playerid][pWantedLevel] * 2000);
  44. PlayerInfo[playerid][pWantedDeaths] += 1;
  45. PlayerInfo[playerid][pJailed] = 1;
  46. PlayerInfo[playerid][pJailTime] = (PlayerInfo[playerid][pWantedLevel])*(250);
  47. PlayCopSound();
  48. format(string, sizeof(string), "Because you got killed, you lost $%d and you will be taken to jail. You are no longer a criminal.", PlayerInfo[playerid][pJailTime], PlayerInfo[playerid][pWantedLevel] * 2000);
  49. SCM(playerid, COLOR_LIGHTRED, string);
  50.  
  51. TogglePlayerControllable(playerid, 0);
  52. SetTimerEx("UnFreezeStation", 1000, false, "i", playerid);
  53. PlayerInfo[playerid][pWantedLevel] = 0;
  54. SetPlayerWantedLevel(playerid, 0);
  55. Update(playerid,pWantedLevelx);
  56. Update(playerid,pJailedx);
  57. Update(playerid,pJailTimex);
  58. ClearCrime(playerid);
  59. }
  60. }
  61.  
  62. if(killerid != INVALID_PLAYER_ID) {
  63. if(IsACop(playerid) && PaintType[playerid] == 0 && !IsACop(killerid)) finishAchievement(killerid, 14);
  64.  
  65. SetPVarInt(playerid,"KilledFlood", GetPVarInt(playerid,"KilledFlood") + 1);
  66. if(GetPVarInt(playerid,"KilledFlood") >= 3 && PlayerInfo[playerid][pAdmin] == 0) return KickEx(playerid);
  67.  
  68. if(PaintType[killerid] != 0 && PaintType[playerid] != 0) {
  69. if(PaintText[PaintType[playerid]-1] > 1) return 1;
  70. if(PaintTime[PaintType[playerid]-1] < 1) return 1;
  71.  
  72. for(new m; m < 2; m++) {
  73. if(PlayerInfo[killerid][pDailyMission][m] == 0) CheckMission(killerid, m);
  74. }
  75.  
  76. PlayerInfo[killerid][pPaintKills][PaintType[killerid]-1] ++;
  77. switch(PaintType[killerid]-1) {
  78. case 0: UpdateVar(killerid, "PaintKills1", PlayerInfo[killerid][pPaintKills][PaintType[killerid]-1]);
  79. case 1: UpdateVar(killerid, "PaintKills2", PlayerInfo[killerid][pPaintKills][PaintType[killerid]-1]);
  80. case 2: UpdateVar(killerid, "PaintKills3", PlayerInfo[killerid][pPaintKills][PaintType[killerid]-1]);
  81. }
  82.  
  83. PlayerInfo[playerid][pPaintDeaths][PaintType[playerid]-1] ++;
  84. switch(PaintType[playerid]-1) {
  85. case 0: UpdateVar(playerid, "PaintDeaths1", PlayerInfo[playerid][pPaintDeaths][PaintType[playerid]-1]);
  86. case 1: UpdateVar(playerid, "PaintDeaths2", PlayerInfo[playerid][pPaintDeaths][PaintType[playerid]-1]);
  87. case 2: UpdateVar(playerid, "PaintDeaths3", PlayerInfo[playerid][pPaintDeaths][PaintType[playerid]-1]);
  88. }
  89. PKills[killerid] ++;
  90. PDeaths[playerid] ++;
  91. if(PaintType[killerid] == 3 && PaintType[playerid] == 3) {
  92. if(GetPaintLevel(playerid) == 8) {
  93. foreach(new i: Player) {
  94. if(IsPlayerConnected(i) && IsPlayerLogged[i] == 1) {
  95. if(PaintType[i] == PaintType[killerid]) {
  96. new pp = PaintType[killerid]-1;
  97. for(new m = 0; m < 5; m++) SendDeathMessageToPlayer(i, 1001, 1001, 200);
  98. format(string, sizeof(string), "* %s a castigat runda deoarece a omorat pe %s cu cutitul.", GetName(killerid), GetName(playerid));
  99. SendPaintMessage(PaintType[i]-1, COLOR_YELLOW, string);
  100. PaintTime[pp] = 300;
  101. PKills[i] = 0, PDeaths[i] = 0;
  102. PaintballWinner[pp] = i;
  103. PaintballWinnerScore[pp] = 0;
  104. SpawnPlayer(i);
  105. }
  106. }
  107. }
  108. }
  109. else GiveSkillWeapon(killerid);
  110. }
  111. foreach(new i: Player) if(PaintType[i] == PaintType[playerid] && PlayerInfo[i][pAdmin] == 0) SendDeathMessageToPlayer(i, killerid, playerid, reason);
  112. if(PKills[killerid] > PaintballWinnerScore[PaintType[playerid]-1]) {
  113. PaintballWinner[PaintType[playerid]-1] = killerid;
  114. PaintballWinnerScore[PaintType[playerid]-1] = PKills[killerid];
  115. }
  116. }
  117. if(PlayerInfo[killerid][pJailTime] != 0 && PlayerInfo[playerid][pJailTime] != 0) {
  118. PlayerInfo[killerid][pJailTime] += 120;
  119. SCM(killerid, COLOR_WARNING, "Sentinta ta a fost marita cu 2 minute deoarece ai ucis un player.");
  120. }
  121. if(GetDistanceBetweenPlayers(killerid,playerid) > 100 && reason != 34) {
  122. new gunname[50];
  123. GetWeaponNameEx(reason,gunname,sizeof(gunname));
  124. format(string, sizeof(string), "AdmWarning: %s l-a omorat pe %s de la %.0fm cu %s.",GetName(killerid),GetName(playerid),GetDistanceBetweenPlayers(killerid,playerid),gunname);
  125. if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_WARNING, string,1);
  126. }
  127.  
  128. gPlayerUsingLoopingAnim[playerid] = 0;
  129. gPlayerSpawned[playerid] = 0;
  130. PlayerEnterTime[playerid]+=221;
  131.  
  132. if(CP[playerid] == 50) {
  133. CP[playerid] = 0;
  134. RemovePlayerAttachedObject(playerid,0);
  135. DisablePlayerCheckpointEx(playerid);
  136. RemovePlayerAttachedObject(playerid,1);
  137. }
  138. if(PlayerCuffed2[playerid] == 1) {
  139. PlayerCuffed2[playerid] = 0;
  140. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
  141. RemovePlayerAttachedObject(playerid,1);
  142. }
  143. if(gPlayerUsingLoopingAnim[playerid]) gPlayerUsingLoopingAnim[playerid] = 0;
  144. if(IsAMember(playerid) && IsAMember(killerid)) {
  145. for(new turf = 1; turf < sizeof(TurfInfo); turf++) {
  146. if(IsPlayerInTurf(playerid, turf) && IsPlayerInTurf(killerid, turf)) {
  147. if(WarInfo[turf][wFaction] == PlayerInfo[playerid][pMember] && WarInfo[turf][wAttacker] == PlayerInfo[killerid][pMember] || WarInfo[turf][wFaction] == PlayerInfo[killerid][pMember] && WarInfo[turf][wAttacker] == PlayerInfo[playerid][pMember]) {
  148. foreach(new i: Player) {
  149. if(IsPlayerConnected(i) && IsPlayerLogged[i] == 1) {
  150. if(PlayerInfo[i][pMember] == PlayerInfo[playerid][pMember] || PlayerInfo[i][pMember] == PlayerInfo[killerid][pMember]) {
  151. if(PlayerInfo[i][pAdmin] == 0) SendDeathMessageToPlayer(i, killerid, playerid, reason);
  152. }
  153. }
  154. }
  155. if(PlayerInfo[killerid][pMember] == WarInfo[turf][wAttacker] || PlayerInfo[killerid][pMember] == WarInfo[turf][wFaction]) WarScoreF[PlayerInfo[killerid][pMember]][turf] += 1.0;
  156. ucideri[killerid][turf] ++; decese[playerid][turf] ++;
  157.  
  158. UpdateVar(killerid, "WarKills", ucideri[killerid][turf]);
  159. UpdateVar(playerid, "WarDeaths", decese[playerid][turf]);
  160.  
  161. WarKills[killerid] = ucideri[killerid][turf];
  162. WarDeaths[playerid] = decese[playerid][turf];
  163.  
  164. if(PlayerInfo[killerid][pMember] == WarInfo[turf][wAttacker])
  165. {
  166. if(ucideri[killerid][turf] > bestscoreat[turf])
  167. {
  168. bestscoreat[turf] = ucideri[killerid][turf];
  169. bestmemberat[turf] = killerid;
  170. }
  171. }
  172. if(PlayerInfo[killerid][pMember] == WarInfo[turf][wFaction])
  173. {
  174. if(ucideri[killerid][turf] > bestscoredf[turf])
  175. {
  176. bestscoredf[turf] = ucideri[killerid][turf];
  177. bestmemberdf[turf] = killerid;
  178. }
  179. }
  180. if(PlayerInfo[playerid][pMember] == WarInfo[turf][wAttacker])
  181. {
  182. if(decese[playerid][turf] > worstscoreat[turf])
  183. {
  184. worstscoreat[turf] = decese[playerid][turf];
  185. worstmemberat[turf] = playerid;
  186. }
  187. }
  188. if(PlayerInfo[playerid][pMember] == WarInfo[turf][wFaction])
  189. {
  190. if(decese[playerid][turf] > worstscoredf[turf])
  191. {
  192. worstscoredf[turf] = ucideri[playerid][turf] - decese[playerid][turf];
  193. worstmemberdf[turf] = playerid;
  194. }
  195. }
  196. new wname[32];
  197. GetWeaponNameEx(GetPlayerWeapon(killerid), wname, sizeof(wname));
  198. format(string, sizeof(string), "War: L-ai omorat pe %s cu %s de la %0.1fm.",GetName(playerid), wname, DistanceToPlayer(killerid, playerid));
  199. SCM(killerid, 0x00E5FFFF, string);
  200. format(string, sizeof(string), "War: Ai fost omorat de %s cu %s de la %0.1fm.",GetName(killerid),wname, DistanceToPlayer(killerid, playerid));
  201. SCM(playerid, 0x00E5FFFF, string);
  202. if(PaintType[playerid] == 0 && PaintType[killerid] == 0) {
  203. new Float: Pos[3], sweapon, sammo, idd;
  204. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  205. for(new i = 0; i < 12; i++) {
  206. GetPlayerWeaponData(playerid, i, sweapon, sammo);
  207. if(sweapon != 0) {
  208. idd = CheckIDEmpty();
  209. Pickups[idd][psID] = CreateDynamicPickup(WeaponObject(sweapon), 23, Pos[0]+random(4), Pos[1]+random(4), Pos[2], GetPlayerVirtualWorld(playerid));
  210. Pickups[idd][psWar] = turf;
  211. Pickups[idd][psType] = 1;
  212. Pickups[idd][psWeapon] = sweapon;
  213. Pickups[idd][psAmmo] = 250;
  214. }
  215. }
  216. idd = CheckIDEmpty();
  217. Pickups[idd][psID] = CreateDynamicPickup(1240, 23, Pos[0]+random(4), Pos[1]+random(4), Pos[2], GetPlayerVirtualWorld(playerid));
  218. Pickups[idd][psType] = 0;
  219. Pickups[idd][psWar] = turf;
  220. Pickups[idd][psWeapon] = 0;
  221. Pickups[idd][psAmmo] = 0;
  222. Pickups[idd][psWar] = turf;
  223. idd = CheckIDEmpty();
  224. Pickups[idd][psID] = CreateDynamicPickup(1212, 23, Pos[0]+random(4), Pos[1]+random(4), Pos[2], GetPlayerVirtualWorld(playerid));
  225. Pickups[idd][psType] = 2;
  226. Pickups[idd][psWar] = turf;
  227. Pickups[idd][psWeapon] = 0;
  228. Pickups[idd][psAmmo] = 0;
  229. Pickups[idd][psWar] = turf;
  230. Pickups[idd][psAmount] = 10+random(50);
  231. }
  232. return 1;
  233. }
  234. }
  235. }
  236. }
  237. if(gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11) {
  238. DisablePlayerCheckpointEx(playerid);
  239. gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
  240. }
  241. if(Mobile[playerid] != -1) {
  242. SCM(Mobile[playerid], COLOR_GRAD2, "Linia tocmai a fost intrerupta...");
  243. CellTime[Mobile[playerid]] = 0;
  244. CellTime[playerid] = 0;
  245. Mobile[Mobile[playerid]] = -1;
  246. Mobile[playerid] = -1;
  247. CellTime[playerid] = 0;
  248. }
  249. if(PlayerInfo[playerid][pClan] != 0 && PlayerInfo[killerid][pClan] != 0) {
  250. for(new h = 0; h < MAX_SAFEZONES; h++) {
  251. if(PlayerToPoint(20.0, playerid, GraffitiInfo[h][gfX], GraffitiInfo[h][gfY], GraffitiInfo[h][gfZ])) return 1;
  252. }
  253. }
  254. if(PlayerHit[killerid] == playerid) {
  255. PlayerPlaySound(killerid,17802,0.0,0.0,0.0);
  256.  
  257. new wname[30];
  258. GetWeaponName(reason, wname, sizeof(wname));
  259. if(reason == 0) wname = "Pumn";
  260.  
  261. GivePlayerCash(killerid, HeadValue[playerid]);
  262. UsedContract[playerid] = 0;
  263. PlayerHit[killerid] = -1;
  264. Contract[playerid] = 0;
  265.  
  266. if(DistanceToPlayer(killerid, playerid) >= 100 || reason == 4) {
  267. if(DistanceToPlayer(killerid, playerid) >= 200) GivePlayerCash(killerid, HeadValue[playerid]);
  268. format(string, sizeof(string), "* Ai efectuat cu succes contractul pe %s(%d). Ai primit: $%s.", GetName(playerid), playerid, FormatNumber(HeadValue[playerid]));
  269. SCM(killerid, COLOR_MONEY, string);
  270. format(string, sizeof(string), "(!) %s[rank: %d] a terminat contractul pe %s [distanta: %0.1fm][arma: %s][fail]", GetName(killerid), PlayerInfo[killerid][pRank], GetName(playerid), DistanceToPlayer(killerid, playerid), wname);
  271. if(PhoneOnline[killerid] == 0) FailRaport(killerid, 0);
  272. if(GetPVarInt(killerid, "Undercover") == 0) FailRaport(killerid, 1);
  273. if(PhoneOnline[killerid] == 1 && GetPVarInt(killerid, "Undercover") == 1) {
  274. UpdateFactionRaport(killerid, 0);
  275. format(string, sizeof(string), "(!) %s[rank: %d] a terminat contractul pe %s [distanta: %0.1fm][arma: %s][succes]", GetName(killerid), PlayerInfo[killerid][pRank], GetName(playerid), DistanceToPlayer(killerid, playerid), wname);
  276. for(new m; m < 2; m++) {
  277. if(PlayerInfo[killerid][pDailyMission][m] == 15 || PlayerInfo[killerid][pDailyMission][m] == 16) CheckMission(killerid, m);
  278. }
  279. }
  280. }
  281. else {
  282. FailRaport(killerid, 3);
  283. format(string, sizeof(string), "(!) %s[rank: %d] a terminat contractul pe %s [distanta: %0.1fm][arma: %s][fail]", GetName(killerid), PlayerInfo[killerid][pRank], GetName(playerid), DistanceToPlayer(killerid, playerid), wname);
  284. }
  285. SendFactionMessage(11, COLOR_LIGHTBLUE, string);
  286. HeadValue[playerid] = 0;
  287. return 1;
  288. }
  289. if(IsAMember(playerid) && InWar[PlayerInfo[playerid][pMember]] == 1) return 1;
  290. if(PaintType[killerid] == 0 && PaintType[killerid] == 0 && PlayerInfo[killerid][pJailed] == 0 && !IsACop(killerid) && !IsACop(playerid)) {
  291. if(PlayerInfo[killerid][pMember] == 0 && PlayerInfo[playerid][pMember] == 0 || PlayerInfo[playerid][pMember] != PlayerInfo[killerid][pMember]) {
  292. format(WantedName[playerid], 256, GetName(killerid));
  293. WantedReason[playerid] = reason;
  294. SCM(playerid,COLOR_WARNING,"Ai fost omorat de un player. Ai la dispozitie un minut pentru a folosi comanda '/call 112'.");
  295. WantedTimer[playerid] = SetTimerEx("ClearWanted",60000, false,"d", playerid);
  296. }
  297. }
  298. killerid = INVALID_PLAYER_ID;
  299. }
  300. return 1;
  301. }
Add Comment
Please, Sign In to add comment