Guest User

Untitled

a guest
Mar 21st, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.02 KB | None | 0 0
  1. public OnPlayerDeath(playerid, killerid, reason)
  2. {
  3. new string[256];
  4. if(killerid != INVALID_PLAYER_ID)
  5. {
  6. if(IsPlayerInFraktion(killerid, 18))
  7. {
  8. if(PlayerInfo[playerid][pContract] > 0)
  9. {
  10. GameTextForPlayer(killerid, "~w~Auftragmord ~g~ausgefuehrt", 3000, 1);
  11. format(string, sizeof(string), "%s hat den Auftragsmord auf %s für $%d erfolgreich ausgeführt.", GetName(killerid), GetName(playerid), PlayerInfo[playerid][pContract]);
  12. SendRadioMessage(18, COLOR_LIGHTBLUE, string);
  13. GameTextForPlayer(playerid, "~r~Auftragsmord", 3000, 1);
  14. SafeGivePlayerMoney(killerid, PlayerInfo[playerid][pContract]);
  15. OnContractChange(playerid, PlayerInfo[playerid][pContract], 0);
  16. PlayerInfo[playerid][pContract] = 0;
  17. PlayerInfo[killerid][pContractCount] ++;
  18. for(new i=0;i<MAX_CTLABEL;i++){
  19. if(PlayerInfo[killerid][pCTLabelCreated][i] == 1 && PlayerInfo[killerid][pCTLabelID][i] == playerid){
  20. DestroyDynamic3DTextLabel(PlayerInfo[killerid][pCTLabel][i]);
  21. PlayerInfo[killerid][pCTLabelID][i] = INVALID_PLAYER_ID;
  22. PlayerInfo[killerid][pCTLabelCreated][i] = 0;
  23. }
  24. }
  25. }
  26. }
  27. }
  28. if(!(IsPlayerInFraktion(playerid, 3) || IsPlayerInFraktion(playerid, 5) || IsPlayerInFraktion(playerid, 9) && PlayerInfo[killerid][pWantedLevel] <=500))
  29. {
  30. if(pIsRobbingBank[playerid] == 1)
  31. {
  32. format(string, sizeof(string), "%s hat den Bankräuber %s getötet.", GetName(killerid), GetName(playerid));
  33. SendClientMessageToAll(COLOR_LIGHTBLUE, string);
  34. }
  35. format(string, sizeof(string), "HQ: %s (ID: %d) hat ein Verbrechen begangen: Mord, over.", GetName(killerid), killerid);
  36. SendRadioMessage(1, COLOR_BLUE, string);
  37. format(string, sizeof(string), "HQ: Reporter: %s, Aktuelles Wantedlevel: %d, over.", GetName(killerid), PlayerInfo[killerid][pWantedLevel]); //18814
  38. SendRadioMessage(1, COLOR_BLUE, string);
  39. SendRadioMessage(1, COLOR_BLUE, string);
  40. format(string, sizeof(string), "HQ: %s (ID: %d) hat ein Verbrechen begangen: Mord, over.", GetName(killerid), killerid);
  41. SendRadioMessage(2, COLOR_BLUE, string);
  42. format(string, sizeof(string), "HQ: Reporter: %s, Aktuelles Wantedlevel: %d, over.", GetName(killerid), PlayerInfo[killerid][pWantedLevel]);
  43. SendRadioMessage(2, COLOR_BLUE, string);
  44. format(string, sizeof(string), "HQ: %s (ID: %d) hat ein Verbrechen begangen: Mord, over.", GetName(killerid), killerid);
  45. SendRadioMessage(3, COLOR_BLUE, string);
  46. format(string, sizeof(string), "HQ: Reporter: %s, Aktuelles Wantedlevel: %d, over.", GetName(killerid), PlayerInfo[killerid][pWantedLevel]);
  47. SendRadioMessage(3, COLOR_BLUE, string);
  48. }
  49. if(Spectate[playerid] == 9999)
  50. {
  51. if(killerid != INVALID_PLAYER_ID)
  52. {
  53. new pString[512];
  54. format(pString, sizeof(pString), "[DEATH] %s wurde von %s getötet. Reason: %i", PlayerInfo[playerid][pName], PlayerInfo[killerid][pName], reason);
  55. Spielerprotokoll(playerid, 5, pString);
  56.  
  57. format(pString, sizeof(pString), "[KILL] %s hat %s getötet. Reason: %i", PlayerInfo[killerid][pName], PlayerInfo[playerid][pName], reason);
  58. Spielerprotokoll(killerid, 5, pString);
  59. }
  60. else
  61. {
  62. new pString[512];
  63. format(pString, sizeof(pString), "[DEATH] %s wurde vom Server getötet. Reason: %i", PlayerInfo[playerid][pName], reason);
  64. Spielerprotokoll(playerid, 5, pString);
  65. }
  66. ACSInfo[playerid][HealPaused] = 5;
  67. ACSInfo[playerid][WaffenCooldown] = 5;
  68.  
  69. if(PlayerInfo[playerid][pEisen] > 0)
  70. {
  71. SendStrukturMessage(playerid, MSG_INFO, "Da du gestorben bist, verlierst du dein Eisen!");
  72. PlayerInfo[playerid][pEisen] = 0;
  73. }
  74. if(PlayerInfo[playerid][pMaterials] > 0)
  75. {
  76.  
  77. SendStrukturMessage(playerid, MSG_INFO, "Da du gestorben bist, verlierst du deine Materials!");
  78. PlayerInfo[playerid][pMaterials] = 0;
  79. }
  80.  
  81. ResetPlayerWeapons(playerid);
  82. SetPlayerHealth(playerid, 99.0);
  83. SetPlayerArmour(playerid, 0.0);
  84. ACSInfo[playerid][FahrzeugEnterTime] += 221;
  85. DeathsPerSecond[playerid] ++;
  86. new newnamekiller[24], newnameplayer[24];
  87. if(IsPlayerInPaintballArena[playerid] == 1)
  88. {
  89. PlayerInfo[playerid][pTodStatus] = 4;
  90. return 1;
  91. }
  92. if(killerid != INVALID_PLAYER_ID && IsPlayerConnectedEx(killerid)) PlayerInfo[killerid][pMorde] += 1;
  93. GetPlayerPos(playerid, PlayerInfo[playerid][pTodX], PlayerInfo[playerid][pTodY], PlayerInfo[playerid][pTodZ]);
  94. GetPlayerFacingAngle(playerid, PlayerInfo[playerid][pTodR]);
  95. PlayerInfo[playerid][pTode] += 1;
  96. UpdatePlayerAccount(playerid, UPDATE_WAFFEN);
  97. for(new idx = 1; idx < sizeof(GangwarInfo); idx++)
  98. {
  99. if(GangwarInfo[idx][gwStatus] == 1)
  100. {
  101. if(IsPlayerInArea(playerid, GangwarInfo[idx][gwMinX], GangwarInfo[idx][gwMinY], GangwarInfo[idx][gwMaxX], GangwarInfo[idx][gwMaxY]))
  102. {
  103. strmid(newnameplayer, PlayerInfo[playerid][pName], 0, strlen(PlayerInfo[playerid][pName]), 255);
  104. if(PlayerInfo[playerid][pAdmin] > 1) strdel(newnameplayer, 0, 4);
  105. strmid(newnamekiller, PlayerInfo[killerid][pName], 0, strlen(PlayerInfo[killerid][pName]), 255);
  106. if(PlayerInfo[killerid][pAdmin] > 1) strdel(newnamekiller, 0, 4);
  107. if(IsPlayerInFraktion(playerid, GangwarInfo[idx][gwFrakID]))
  108. {
  109. GangwarInfo[idx][gwAngreiferP] += 1;
  110. format(string, sizeof(string), "~r~%s ~w~t¨tete ~r~%s", newnamekiller, newnameplayer);
  111. TextDrawSetString(GangwarTextDrawNews[idx], string);
  112. PlayerInfo[playerid][pTodStatus] = 2;
  113. GangwarEinnehmZeit[playerid] = 0;
  114. KillTimer(GangwarEinnehmTimer[playerid]);
  115. GangwarFlageAktualisieren(idx, 1);
  116. GangwarFlageAktualisieren(idx, 2);
  117. GangwarFlageAktualisieren(idx, 3);
  118. GangwarInfo[idx][gwTodeBesitzer] ++;
  119. if(killerid != INVALID_PLAYER_ID && IsPlayerInFraktion(killerid, GangwarInfo[idx][gwAngreifer])) GangwarInfo[idx][gwMordeAngreifer] ++;
  120. return 1;
  121. }
  122. if(IsPlayerInFraktion(playerid, GangwarInfo[idx][gwAngreifer]))
  123. {
  124. GangwarInfo[idx][gBesitzerP] += 1;
  125. format(string, sizeof(string), "~r~%s ~w~t¨tete ~r~%s", newnamekiller, newnameplayer);
  126. TextDrawSetString(GangwarTextDrawNews[idx], string);
  127. PlayerInfo[playerid][pTodStatus] = 2;
  128. GangwarEinnehmZeit[playerid] = 0;
  129. KillTimer(GangwarEinnehmTimer[playerid]);
  130. GangwarFlageAktualisieren(idx, 1);
  131. GangwarFlageAktualisieren(idx, 2);
  132. GangwarFlageAktualisieren(idx, 3);
  133. GangwarInfo[idx][gwTodeAngreifer] ++;
  134. if(killerid != INVALID_PLAYER_ID && IsPlayerInFraktion(killerid, GangwarInfo[idx][gwFrakID])) GangwarInfo[idx][gwMordeBesitzer] ++;
  135. return 1;
  136. }
  137. }
  138. }
  139. }
  140. if(killerid != INVALID_PLAYER_ID && (IsACop(killerid) && PlayerInfo[killerid][pDienst] == 0 || !IsACop(killerid)))
  141. {
  142. PlayerInfo[killerid][pWantedLevel] += 2;
  143. AktualisiereSpielerWanteds(killerid);
  144. format(string, sizeof(string), "Du hast ein Verbrechen begangen. (Mord) Reporter: %s", "Unbekannt");
  145. SendClientMessage(killerid, COLOR_RED, string);
  146. format(string, sizeof(string), "Dein aktuelles Wanted Level: %d", PlayerInfo[killerid][pWantedLevel]);
  147. SendClientMessage(killerid, COLOR_YELLOW, string);
  148. }
  149. if(IsPlayerInTheoriePrufung[playerid] == 1)
  150. {
  151. TUVTheoriePlatze[TUVTheoriePlatz[playerid]] = 0;
  152. SetDynamicObjectMaterialText(TUVPC[TUVTheoriePlatz[playerid]], 2, "TÜV SA", 130, "Arial", 125, 1, -16776961, -1, 1);
  153. IsPlayerInTheoriePrufung[playerid] = 0;
  154. }
  155. StopAudioStreamForPlayer(playerid);
  156. if(GetPVarInt(playerid, "roped") == 1)
  157. {
  158. for(new destr2 = 0; destr2 <= ropelength; destr2 ++) DestroyDynamicObject(r0pes[playerid][destr2]), r0pes[playerid][destr2] = NO_OBJECT;
  159. SetPVarInt(playerid, "roped", 0);
  160. DisablePlayerCheckpoint(playerid);
  161. }
  162. if(PlayerInfo[playerid][pGecufft] == 1)
  163. {
  164. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  165. RemovePlayerAttachedObject(playerid, CUFFOBJECT_SLOT);
  166. PlayerInfo[playerid][pGecufft] = 0;
  167. }
  168. new deathstring[110], deathreason[30];
  169. if(killerid != INVALID_PLAYER_ID)
  170. {
  171. switch(reason)
  172. {
  173. case 0: deathreason = "Faust";
  174. case 16,35,36,40,51: deathreason = "Explosion";
  175. case 18,37: deathreason = "Feuer";
  176. case 49: deathreason = "Fahrzeug";
  177. case 50: deathreason = "Rotor";
  178. default: GetWaffenName(reason, deathreason, sizeof(deathreason));
  179. }
  180. format(deathstring, sizeof(deathstring), "Info: %s (%i) wurde getötet von %s (%i) - %s", PlayerInfo[playerid][pName], playerid, PlayerInfo[killerid][pName], killerid, deathreason);
  181. }
  182. else
  183. {
  184. switch(reason)
  185. {
  186. case 51: deathreason = "Explosion";
  187. case 53: deathreason = "Drowned";
  188. case 54: deathreason = "Runtergefallen";
  189. default: deathreason = "Tot";
  190. }
  191. format(deathstring, sizeof(deathstring), "Info: %s (%i) wurde vom Server getötet. (%s)", PlayerInfo[playerid][pName], playerid, deathreason);
  192. }
  193. SendAdminMessage(3, COLOR_GREEN, deathstring);
  194. if(PlayerInfo[playerid][pWantedLevel] >= 1)
  195. {
  196. if(killerid != INVALID_PLAYER_ID && IsPlayerConnected(killerid))
  197. {
  198. if(IsACop(killerid) && PlayerInfo[killerid][pDienst] == 1)
  199. {
  200. new zeit = PlayerInfo[playerid][pWantedLevel]*45;
  201. PlayerInfo[playerid][pKnastZeit] = zeit;
  202. PlayerInfo[playerid][pKnastAFKZeit] = zeit/2;
  203. if(PlayerInfo[playerid][pWantedLevel] < 60) PlayerInfo[playerid][pKnast] = 1;
  204. else PlayerInfo[playerid][pKnast] = 3;
  205. new strafe = PlayerInfo[playerid][pWantedLevel]*65;
  206. if(PlayerInfo[playerid][pGiroKonto] == 1)
  207. {
  208. PlayerInfo[playerid][pGirokontoStand] -= 1999;
  209. KontoauszugLog(PlayerInfo[playerid][pSaveID], "-", "Gefängnis Strafe", 1999, PlayerInfo[playerid][pGirokontoStand]);
  210. }
  211. else SafeGivePlayerMoney(playerid, 1999);
  212. new kassenpreis = strafe/2;
  213. FrakInfo[1][fGeld] += kassenpreis;
  214. FrakInfo[3][fGeld] += kassenpreis;
  215. new loginfo[50];
  216. format(loginfo, sizeof(loginfo), "Gesuchten %s umgebracht", PlayerInfo[playerid][pName]);
  217. FrakInfoLog(1, "Geld", PlayerInfo[killerid][pName], "+", loginfo, kassenpreis, FrakInfo[1][fGeld]);
  218. FrakInfoLog(3, "Geld", PlayerInfo[killerid][pName], "+", loginfo, kassenpreis, FrakInfo[3][fGeld]);
  219. PlayerInfo[playerid][pWantedLevel] = 0;
  220. PlayerInfo[playerid][pKnastAufenthalte] += 1;
  221. GameTextForPlayer(killerid, "~w~Gesuchten~n~~r~umgebracht!", 2000, 1);
  222. format(string, sizeof(string), "[HQ] Alle Einheiten: %s hat den Gesuchten %s umgebracht!", PlayerInfo[killerid][pName], PlayerInfo[playerid][pName]);
  223. SendRadioMessage(1, COLOR_BLUE, string);
  224. SendRadioMessage(3, COLOR_BLUE, string);
  225. PlayerInfo[playerid][pTodStatus] = 3;
  226. AktualisiereSpielerWanteds(playerid);
  227. AktualisiereSpielerLabel(playerid);
  228. OnPlayerFriedhof(playerid);
  229. return 1;
  230. }
  231. }
  232. }
  233. if(PlayerResetInfo[playerid][prShootByCop] != 0)
  234. {
  235. new copkiller = IsAAktivCopInNear(playerid);
  236. if(copkiller != INVALID_PLAYER_ID)
  237. {
  238. new zeit = PlayerInfo[playerid][pWantedLevel]*45;
  239. PlayerInfo[playerid][pKnastZeit] = zeit;
  240. PlayerInfo[playerid][pKnastAFKZeit] = zeit/2;
  241. if(PlayerInfo[playerid][pWantedLevel] < 60) PlayerInfo[playerid][pKnast] = 1;
  242. else PlayerInfo[playerid][pKnast] = 3;
  243. new strafe = PlayerInfo[playerid][pWantedLevel]*65;
  244. if(PlayerInfo[playerid][pGiroKonto] == 1)
  245. {
  246. PlayerInfo[playerid][pGirokontoStand] -= 1999;
  247. KontoauszugLog(PlayerInfo[playerid][pSaveID], "-", "Gefängnis Strafe", 1999, PlayerInfo[playerid][pGirokontoStand]);
  248. }
  249. else SafeGivePlayerMoney(playerid, 1999);
  250. new kassenpreis = strafe/2;
  251. FrakInfo[1][fGeld] += kassenpreis;
  252. FrakInfo[3][fGeld] += kassenpreis;
  253. new loginfo[50];
  254. format(loginfo, sizeof(loginfo), "Gesuchten %s umgebracht", PlayerInfo[playerid][pName]);
  255. FrakInfoLog(1, "Geld", PlayerInfo[copkiller][pName], "+", loginfo, kassenpreis, FrakInfo[1][fGeld]);
  256. FrakInfoLog(3, "Geld", PlayerInfo[copkiller][pName], "+", loginfo, kassenpreis, FrakInfo[3][fGeld]);
  257. PlayerInfo[playerid][pWantedLevel] = 0;
  258. PlayerInfo[playerid][pKnastAufenthalte] += 1;
  259. GameTextForPlayer(killerid, "~w~Gesuchten~n~~r~umgebracht!", 2000, 1);
  260. format(string, sizeof(string), "[HQ] Alle Einheiten: %s war in der Nähe des gesuchten %s, als er gestorben ist", PlayerInfo[copkiller][pName], PlayerInfo[playerid][pName]);
  261. SendRadioMessage(1, COLOR_BLUE, string);
  262. SendRadioMessage(3, COLOR_BLUE, string);
  263. PlayerInfo[playerid][pTodStatus] = 3;
  264. AktualisiereSpielerWanteds(playerid);
  265. AktualisiereSpielerLabel(playerid);
  266. OnPlayerFriedhof(playerid);
  267. return 1;
  268. }
  269. }
  270. TodesGrund[playerid] = reason;
  271. PlayerInfo[playerid][pTodStatus] = 1;
  272. if(killerid != INVALID_PLAYER_ID && PlayerInfo[playerid][pBlacklist][GetPlayerFraktion(killerid)] == 1)
  273. {
  274. PlayerInfo[playerid][pTodZeit] = 240; // 4 Minuten
  275. SendFormatMessage(playerid, COLOR_ORANGE, "Ein Mitglied der %s hat dich getötet. Da du auf der Blacklist der Fraktion stehst, bist du für 10 Minuten auf dem Friedhof!", FrakInfo[GetPlayerFraktion(killerid)][fLongName]);
  276. SendFormatMessage(playerid, COLOR_ORANGE, "Du kannst im Forumbereich der Fraktion einen Freikaufantrag schreiben!");
  277. }
  278. else PlayerInfo[playerid][pTodZeit] = 120; // 5 Minuten
  279. OnPlayerFriedhof(playerid);
  280. new interior = GetPlayerInterior(playerid);
  281. new vw = GetPlayerVirtualWorld(playerid);
  282. if(TodIcon[playerid] == 0) TodIcon[playerid] = CreateDynamicPickup(1254, 1, PlayerInfo[playerid][pTodX], PlayerInfo[playerid][pTodY], PlayerInfo[playerid][pTodZ], vw, interior);
  283. if(PlayerInfo[playerid][pLevel] < 2) SendClientMessage(playerid, COLOR_WHITE, "Du kannst bis zum Respawn nur den Befehl /report benutzen!");
  284. PlayerInfo[playerid][pDienst] = 0;
  285. AktualisiereSpielerLabel(playerid);
  286. UpdatePlayerAccount(playerid, UPDATE_WAFFEN);
  287. UpdatePlayerDamageStatus(playerid);
  288. //SavePlayer(playerid);
  289. }
  290. return 1;
  291. }
Advertisement
Add Comment
Please, Sign In to add comment