Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerDeath(playerid, killerid, reason)
- {
- Server(playerid, "OnPlayerDeathCalled");
- playerData[playerid][hasSpawned] = false;
- playerData[playerid][ctpImmune] = true;
- playerData[playerid][abImmune] = true;
- Server(playerid, "Booleans loaded");
- // Easter
- PlayerTextDrawHide(playerid, playerData[playerid][Eggs][0]);
- PlayerTextDrawHide(playerid, playerData[playerid][Eggs][1]);
- PlayerTextDrawHide(playerid, playerData[playerid][Eggs][2]);
- Server(playerid, "easter tds hidden");
- if (playerData[playerid][isInDM])
- {
- Server(playerid, "player detected in dm");
- playerData[playerid][hasSpawned] = false;
- playerData[playerid][suicide] = false;
- if (killerid != INVALID_PLAYER_ID)
- {
- playerData[killerid][dmKills]++;
- playerData[killerid][dmStreak]++;
- dmStats(killerid);
- new randDeath = random(21), randomDeath[200];
- switch(randDeath)
- {
- case 0:
- {
- format(randomDeath, sizeof(randomDeath), "eliminated");
- }
- case 1:
- {
- format(randomDeath, sizeof(randomDeath), "fucked up");
- }
- case 2:
- {
- format(randomDeath, sizeof(randomDeath), "raped");
- }
- case 3:
- {
- format(randomDeath, sizeof(randomDeath), "put some lead into");
- }
- case 4:
- {
- format(randomDeath, sizeof(randomDeath), "gave a lead tattoo to");
- }
- case 5:
- {
- format(randomDeath, sizeof(randomDeath), "delivered some bullets to");
- }
- case 6:
- {
- format(randomDeath, sizeof(randomDeath), "said hello to");
- }
- case 7:
- {
- format(randomDeath, sizeof(randomDeath), "delivered some bullets first class to");
- }
- case 8:
- {
- format(randomDeath, sizeof(randomDeath), "slayed");
- }
- case 9:
- {
- format(randomDeath, sizeof(randomDeath), "mortalized");
- }
- case 10:
- {
- format(randomDeath, sizeof(randomDeath), "dropped");
- }
- case 11:
- {
- format(randomDeath, sizeof(randomDeath), "pwn3d");
- }
- case 12:
- {
- format(randomDeath, sizeof(randomDeath), "unleashed the pain on");
- }
- case 13:
- {
- format(randomDeath, sizeof(randomDeath), "avada kedavra'd");
- }
- case 14:
- {
- format(randomDeath, sizeof(randomDeath), "humiliated");
- }
- case 15:
- {
- format(randomDeath, sizeof(randomDeath), "broke");
- }
- case 16:
- {
- format(randomDeath, sizeof(randomDeath), "popped");
- }
- case 17:
- {
- format(randomDeath, sizeof(randomDeath), "sends their regards to");
- }
- case 18:
- {
- format(randomDeath, sizeof(randomDeath), "now owns");
- }
- case 19:
- {
- format(randomDeath, sizeof(randomDeath), "used a classified move on");
- }
- case 20:
- {
- format(randomDeath, sizeof(randomDeath), "ended");
- }
- }
- for (new i=0; i<MAX_PLAYERS; i++)
- {
- if(playerData[i][isInDM])
- {
- new dmKill[100];
- format(dmKill, sizeof(dmKill), "{FAAC58}%s(%i) {FFFFFF}%s {FAAC58}%s(%i)", playerData[killerid][playerNamee], killerid, randomDeath, playerData[playerid][playerNamee], playerid);
- SendClientMessage(i, COLOR_WHITE, dmKill);
- }
- }
- }
- playerData[playerid][dmDeaths]++;
- playerData[playerid][dmStreak] = 0;
- KillTimer(playerData[playerid][streakTimer]);
- disableStreak(playerid);
- dmStats(playerid);
- }
- else
- {
- Server(playerid, "player not detected in dm");
- if(!playerData[playerid][playerDied])
- {
- Server(playerid, "check if player is died and passed");
- new vid = GetPlayerVehicleID(killerid);
- if (killerid != INVALID_PLAYER_ID && GetPlayerWeapon(killerid) != reason && reason != 54 && reason != 50 && reason != 53 && !playerData[playerid][suicide] && GetVehicleModel(vid) != 520 && GetVehicleModel(vid) != 447)
- {
- Server(playerid, "check for invalid reasons etc.");
- if (reason == 49 && IsPlayerInAnyVehicle(killerid))
- {
- return 1;
- }
- else if (reason == 51 && IsPlayerInAnyVehicle(playerid))
- {
- return 1;
- }
- else
- {
- new string[600];
- format(string, sizeof(string), "%s{98B0CD}Invalid Death Detected \n", string);
- format(string, sizeof(string), "%s{FFFFFF}The server does not recognise the reason for your death. \n", string);
- format(string, sizeof(string), "%s{FFFFFF}To prevent stat loss, we have an anti-fake kill system in place. \n\n", string);
- format(string, sizeof(string), "%s{FFFFFF}If you have respawned at the bank with no weapons, click respawn. \n\n", string);
- ShowPlayerDialog(playerid, DIALOG_FORCE_RESPAWN, DIALOG_STYLE_MSGBOX, "", string, "RESPAWN", "CANCEL");
- return 0;
- }
- }
- printf("playerid: %d killerid: %d reason: %d", playerid, killerid, reason);
- SendDeathMessage(killerid, playerid, reason);
- #if !defined LOCALHOST
- ircDeath(killerid, playerid, reason);
- #endif
- if(playerData[playerid][playerLoggedIn])
- {
- if(playerData[playerid][isInEvent])
- {
- playerData[playerid][isInEvent] = false;
- playerData[playerid][hasSpawned] = false;
- newPlayerColour(playerid);
- playerData[playerid][playerDeaths]++;
- playerData[playerid][playerWantedLevel] = 0;
- SetPlayerWantedLevel(playerid, 0);
- playerData[playerid][hasSTD] = false;
- KillTimer(playerData[playerid][rapedTimer]);
- }
- else
- {
- if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
- {
- if(playerData[killerid][playerLoggedIn])
- {
- playerData[killerid][playerKills] = playerData[killerid][playerKills] + 1;
- playerData[killerid][playerScore] = playerData[killerid][playerScore] + 1;
- SetPlayerScore(killerid, playerData[killerid][playerScore]);
- playerGiveXP(playerid, 5);
- if (playerData[killerid][playerKills] == 1)
- {
- disableAchieve(killerid);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve1]);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve2]);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve3]);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve4]);
- PlayerTextDrawSetString(killerid, playerData[killerid][Achieve3], "First Kill");
- PlayerTextDrawSetString(killerid, playerData[killerid][Achieve4], "You killed your first victim. Well done.");
- PlayerPlaySound(killerid, 1183 ,0.0, 0.0, 0.0);
- playerData[playerid][achieveTimer] = SetTimerEx("disableAchieve", 8000, false, "i", killerid);
- // XP/SCORE AWARD
- playerGiveXP(playerid, 50);
- playerData[playerid][playerScore] = playerData[playerid][playerScore] + 2;
- SetPlayerScore(playerid, playerData[playerid][playerScore]);
- }
- else if (playerData[killerid][playerKills] == 50)
- {
- disableAchieve(killerid);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve1]);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve2]);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve3]);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve4]);
- PlayerTextDrawSetString(killerid, playerData[killerid][Achieve3], "Las Venturas Killer");
- PlayerTextDrawSetString(killerid, playerData[killerid][Achieve4], "You've killed 50 players! Nice!");
- PlayerPlaySound(killerid, 1183 ,0.0, 0.0, 0.0);
- playerData[playerid][achieveTimer] = SetTimerEx("disableAchieve", 8000, false, "i", killerid);
- // XP/SCORE AWARD
- playerGiveXP(playerid, 50);
- playerData[playerid][playerScore] = playerData[playerid][playerScore] + 2;
- SetPlayerScore(playerid, playerData[playerid][playerScore]);
- }
- else if (playerData[killerid][playerKills] == 500)
- {
- disableAchieve(killerid);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve1]);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve2]);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve3]);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve4]);
- PlayerTextDrawSetString(killerid, playerData[killerid][Achieve3], "Mass Murderer");
- PlayerTextDrawSetString(killerid, playerData[killerid][Achieve4], "500 kills attained. You require medical assistance.");
- PlayerPlaySound(killerid, 1183 ,0.0, 0.0, 0.0);
- playerData[playerid][achieveTimer] = SetTimerEx("disableAchieve", 8000, false, "i", killerid);
- // XP/SCORE AWARD
- playerGiveXP(playerid, 50);
- playerData[playerid][playerScore] = playerData[playerid][playerScore] + 2;
- SetPlayerScore(playerid, playerData[playerid][playerScore]);
- }
- if(playerData[killerid][playerClass] == CLASS_CIVILIAN || playerData[killerid][playerClass] == CLASS_MEDIC)
- {
- new message[128];
- playerData[killerid][playerWantedLevel] = playerData[killerid][playerWantedLevel] + 12;
- SetPlayerWantedLevel(killerid, playerData[killerid][playerWantedLevel] + 12);
- format(message, sizeof(message), "{FFDC2E}[MURDER] {FFFFFF}You have just killed %s(%i)!", playerData[playerid][playerNamee], playerid, playerData[killerid][playerWantedLevel]);
- SendClientMessage(killerid, COLOR_WHITE, message);
- sendWantedMessage(killerid, 12);
- newPlayerColour(killerid);
- if(playerData[killerid][playerJob] == JOB_HITMAN && playerData[killerid][playerClass] != CLASS_MEDIC)
- {
- if(playerData[playerid][playerHitValue] > 0)
- {
- playerData[killerid][hitsCompleted] = playerData[killerid][hitsCompleted] + 1;
- playerGiveMoney(killerid, playerData[playerid][playerHitValue]);
- format(message, sizeof(message), "{FFDC2E}[CONTRACT] {FFFFFF}%s(%i) has completed the contract on %s(%i) and earnt {FFDC2E}$%s", playerData[killerid][playerNamee], killerid, playerData[playerid][playerNamee], playerid, FormatNumber(playerData[playerid][playerHitValue]));
- SendClientMessageToAll(COLOR_WHITE, message);
- new loggingString[256];
- format(loggingString, sizeof(loggingString), "%s completed the contract on %s for %d.", playerData[killerid][playerNamee], playerData[playerid][playerNamee], playerData[playerid][playerHitValue]);
- writeInLog("contractLog.html", loggingString);
- playerData[playerid][playerHitValue] = 0;
- if (playerData[killerid][hitsCompleted] == 1)
- {
- disableAchieve(killerid);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve1]);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve2]);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve3]);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve4]);
- PlayerTextDrawSetString(killerid, playerData[killerid][Achieve3], "Contract Killer");
- PlayerTextDrawSetString(killerid, playerData[killerid][Achieve4], "You completed your first hit contract!");
- PlayerPlaySound(killerid, 1183 ,0.0, 0.0, 0.0);
- playerData[playerid][achieveTimer] = SetTimerEx("disableAchieve", 8000, false, "i", killerid);
- // XP/SCORE AWARD
- playerGiveXP(playerid, 50);
- playerData[playerid][playerScore] = playerData[playerid][playerScore] + 2;
- SetPlayerScore(playerid, playerData[playerid][playerScore]);
- }
- if (playerData[killerid][hitsCompleted] == 20)
- {
- disableAchieve(killerid);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve1]);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve2]);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve3]);
- PlayerTextDrawShow(killerid, playerData[killerid][Achieve4]);
- PlayerTextDrawSetString(killerid, playerData[killerid][Achieve3], "Professional Hitman");
- PlayerTextDrawSetString(killerid, playerData[killerid][Achieve4], "You completed 20 hit contracts!");
- PlayerPlaySound(killerid, 1183 ,0.0, 0.0, 0.0);
- playerData[playerid][achieveTimer] = SetTimerEx("disableAchieve", 8000, false, "i", killerid);
- // XP/SCORE AWARD
- playerGiveXP(playerid, 50);
- playerData[playerid][playerScore] = playerData[playerid][playerScore] + 2;
- SetPlayerScore(playerid, playerData[playerid][playerScore]);
- }
- }
- }
- playerData[killerid][playerLastKill] = GetTickCount();
- }
- if(playerData[playerid][playerClass] == CLASS_CIVILIAN || playerData[playerid][playerClass] == CLASS_MEDIC)
- {
- newPlayerColour(playerid);
- }
- if(playerData[killerid][playerClass] == CLASS_POLICE || playerData[killerid][playerClass] == CLASS_ARMY || playerData[killerid][playerClass] == CLASS_CIA || playerData[killerid][playerClass] == CLASS_FBI || playerData[killerid][playerClass] == CLASS_SECRETSERVICE)
- {
- if(playerData[playerid][playerWantedLevel] == 0)
- {
- if (!playerData[playerid][suicide])
- {
- if (playerData[killerid][playerClass] == CLASS_POLICE || playerData[killerid][playerClass] == CLASS_FBI || playerData[killerid][playerClass] == CLASS_CIA || playerData[killerid][playerClass] == CLASS_SECRETSERVICE)
- {
- playerData[killerid][innocentKills]++;
- if (playerData[killerid][innocentKills] > 2)
- {
- playerGiveMoney(killerid, -5000);
- }
- if (playerData[killerid][innocentKills] == 5)
- {
- // Cop class ban
- ForceClassSelection(killerid);
- TogglePlayerSpectating(killerid, true);
- TogglePlayerSpectating(killerid, false);
- playerData[killerid][playerCopBanned] = 1;
- }
- else
- {
- SetPlayerHealth(killerid, 0.0);
- }
- }
- if (playerData[killerid][playerClass] == CLASS_ARMY)
- {
- playerData[killerid][aInnocentKills]++;
- playerGiveMoney(killerid, -5000);
- if (playerData[killerid][aInnocentKills] == 3)
- {
- // Army class ban
- ForceClassSelection(killerid);
- TogglePlayerSpectating(killerid, true);
- TogglePlayerSpectating(killerid, false);
- playerData[killerid][playerArmyBanned] = 1;
- }
- else
- {
- SetPlayerHealth(killerid, 0.0);
- }
- }
- closeDialogs(killerid);
- PlayerTextDrawShow(killerid, playerData[killerid][InnocentKill1]);
- PlayerTextDrawShow(killerid, playerData[killerid][InnocentKill2]);
- PlayerTextDrawShow(killerid, playerData[killerid][InnocentKill3]);
- PlayerTextDrawShow(killerid, playerData[killerid][InnocentKill4]);
- PlayerTextDrawShow(killerid, playerData[killerid][InnocentKill5]);
- PlayerTextDrawShow(killerid, playerData[killerid][InnocentKill6]);
- PlayerTextDrawShow(killerid, playerData[killerid][InnocentKill7]);
- PlayerTextDrawShow(killerid, playerData[killerid][InnocentKill8]);
- }
- }
- else if(playerData[playerid][playerWantedLevel] > 0)
- {
- new message[128], earnings;
- earnings = (playerData[playerid][playerWantedLevel] * 200);
- format(message, sizeof(message), "{FFDC2E}[KILL] {FFFFFF}You killed %s(%i) who had a wanted level of %i, you earnt {FFDC2E}$%s!", playerData[playerid][playerNamee], playerid, playerData[playerid][playerWantedLevel], FormatNumber(earnings));
- SendClientMessage(killerid, COLOR_WHITE, message);
- playerGiveMoney(killerid, earnings);
- playerGiveXP(killerid, 5);
- playerData[killerid][copKills] = playerData[killerid][copKills] + 1;
- new loggingString[256];
- format(loggingString, sizeof(loggingString), "%s killed %s for %d.", playerData[killerid][playerNamee], playerData[playerid][playerNamee], earnings);
- writeInLog("copKillLog.html", loggingString);
- }
- }
- }
- }
- if(playerData[playerid][iscourier])
- {
- SendClientMessage(playerid, COLOR_WHITE, "{FFDC2E}[COURIER] {FFFFFF}You died, the mission was cancelled.");
- playerData[playerid][iscourier] = false;
- playerData[playerid][playerCourierLevel] = 0;
- DisablePlayerCheckpoint(playerid);
- }
- if (playerData[playerid][truckingStatus] > 0)
- {
- return cmd_canceltrucking(playerid, "");
- }
- if (playerData[playerid][forkliftStatus] > 0)
- {
- return cmd_cancelforklift(playerid, "");
- }
- if (playerData[playerid][busStatus] > 0)
- {
- return cmd_cancelroute(playerid, "");
- }
- playerData[playerid][playerDeaths]++;
- playerData[playerid][playerDied] = true;
- playerData[playerid][playerWantedLevel] = 0;
- SetPlayerWantedLevel(playerid, 0);
- playerData[playerid][hasSTD] = false;
- KillTimer(playerData[playerid][rapedTimer]);
- KillTimer(playerData[playerid][uncuffTimer]);
- playerData[playerid][playerIsTied] = false;
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
- KillTimer(playerData[playerid][untieTimer]);
- playerData[playerid][hasSpawned] = false;
- playerData[playerid][suicide] = false;
- if (!playerData[playerid][healthInsurance])
- {
- taxplayer(playerid);
- }
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment