Advertisement
Guest User

Untitled

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