Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerDeath(playerid, killerid, reason)
- {
- playerDeath[playerid] = 1;
- Update3DTextLabelText(deathLabel[playerid], COLOR_LIGHTRED, "[dead]");
- Attach3DTextLabelToPlayer(deathLabel[playerid], playerid, 0.0, 0.0, 0.3);
- new string[180];
- if(GetPVarInt(playerid, "IsOnFire")) TogglePlayerBurning(playerid, false);
- InEvent[playerid] = 0;
- if(InRob[playerid] == 1) FailRob(playerid, "Ai fost omorat");
- if(killerid == INVALID_PLAYER_ID) ADeathMessage(INVALID_PLAYER_ID, playerid, 47);
- else ADeathMessage(playerid, killerid, reason);
- SetPlayerWorldBounds(playerid, 20000.0000, -20000.0000, 20000.0000, -20000.0000);
- if(PlayerInfo[playerid][pWantedLevel] != 0) {
- new count, names[180];
- foreach(Player,i) {
- if(IsACop(i) && CrimInRange(75.0, playerid,i) && OnDuty[i] == 1) {
- count = 1;
- format(string, sizeof(string), "running suspect bonus!");
- GameTextForPlayer(i, string, 3000, 1);
- ConsumingMoney[i] = 1;
- GivePlayerCash(i, PlayerInfo[playerid][pWantedLevel] * 2000);
- Update(i, pCashx);
- UpdateFactionRaport(i, 0);
- format(string, sizeof(string), "Ai primit $%d bonus pentru prinderea suspectului %s.", PlayerInfo[playerid][pWantedLevel] * 2000, GetName(playerid));
- SCM(i, COLOR_DBLUE, string);
- format(names, 256, "%s %s", names, GetName(i));
- }
- if(count == 1) {
- if(ProxDetectorS(30.0, i, playerid)) {
- format(string, sizeof(string), "* %s is now in jail thanks to: %s", GetName(playerid), names);
- SCM(i, COLOR_PURPLE, string);
- }
- }
- }
- if(count == 1) {
- 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));
- 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));
- SendTeamMessage(1, 0x2e64feFF, string);
- SendTeamMessage(2, 0x2e64feFF, string);
- SendTeamMessage(3, 0x2e64feFF, string);
- GivePlayerCash(playerid, - PlayerInfo[playerid][pWantedLevel] * 2000);
- PlayerInfo[playerid][pWantedDeaths] += 1;
- PlayerInfo[playerid][pJailed] = 1;
- PlayerInfo[playerid][pJailTime] = (PlayerInfo[playerid][pWantedLevel])*(250);
- PlayCopSound();
- 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);
- SendClientMessage(playerid, COLOR_LIGHTRED, string);
- TogglePlayerControllable(playerid, 0);
- SetTimerEx("UnFreezeStation", 1000, false, "i", playerid);
- PlayerInfo[playerid][pWantedLevel] = 0;
- SetPlayerWantedLevel(playerid, 0);
- Update(playerid,pWantedLevelx);
- Update(playerid,pJailedx);
- Update(playerid,pJailTimex);
- ClearCrime(playerid);
- }
- }
- TextDrawHideForPlayer(playerid, EventCS);
- Team[playerid] = 0;
- SetPVarInt(playerid,"KilledFlood", GetPVarInt(playerid,"KilledFlood") + 1);
- if(GetPVarInt(playerid,"KilledFlood") >= 3 && PlayerInfo[playerid][pAdmin] == 0) return KickEx(playerid);
- if(PaintType[killerid] != 0 && PaintType[playerid] != 0) {
- if(PaintText[PaintType[playerid]-1] > 1) return 1;
- if(PaintTime[PaintType[playerid]-1] < 1) return 1;
- for(new m; m < 2; m++) {
- if(PlayerInfo[killerid][pDailyMission][m] == 0) CheckMission(killerid, m);
- }
- PlayerInfo[killerid][pPaintKills][PaintType[killerid]-1] ++;
- switch(PaintType[killerid]-1) {
- case 0: UpdateVar(killerid, "PaintKills1", PlayerInfo[killerid][pPaintKills][PaintType[killerid]-1]);
- case 1: UpdateVar(killerid, "PaintKills2", PlayerInfo[killerid][pPaintKills][PaintType[killerid]-1]);
- case 2: UpdateVar(killerid, "PaintKills3", PlayerInfo[killerid][pPaintKills][PaintType[killerid]-1]);
- }
- PlayerInfo[playerid][pPaintDeaths][PaintType[playerid]-1] ++;
- switch(PaintType[playerid]-1) {
- case 0: UpdateVar(playerid, "PaintDeaths1", PlayerInfo[playerid][pPaintDeaths][PaintType[playerid]-1]);
- case 1: UpdateVar(playerid, "PaintDeaths2", PlayerInfo[playerid][pPaintDeaths][PaintType[playerid]-1]);
- case 2: UpdateVar(playerid, "PaintDeaths3", PlayerInfo[playerid][pPaintDeaths][PaintType[playerid]-1]);
- }
- PKills[killerid] ++;
- PDeaths[playerid] ++;
- if(PaintType[killerid] == 3 && PaintType[playerid] == 3) {
- if(GetPaintLevel(playerid) == 8) {
- foreach(Player,i) {
- if(IsPlayerConnected(i) && IsPlayerLogged[i] == 1) {
- if(PaintType[i] == PaintType[killerid]) {
- new pp = PaintType[killerid]-1;
- for(new m = 0; m < 5; m++) SendDeathMessageToPlayer(i, 1001, 1001, 200);
- format(string, sizeof(string), "* %s a castigat runda deoarece a omorat pe %s cu cutitul.", GetName(killerid), GetName(playerid));
- SendPaintMessage(PaintType[i]-1, COLOR_YELLOW, string);
- PaintTime[pp] = 300;
- PKills[i] = 0, PDeaths[i] = 0;
- PaintballWinner[pp] = i;
- PaintballWinnerScore[pp] = 0;
- SpawnPlayer(i);
- }
- }
- }
- }
- else GiveSkillWeapon(killerid);
- }
- foreach(Player,i) if(PaintType[i] == PaintType[playerid] && PlayerInfo[i][pAdmin] == 0) SendDeathMessageToPlayer(i, killerid, playerid, reason);
- if(PKills[killerid] > PaintballWinnerScore[PaintType[playerid]-1]) {
- PaintballWinner[PaintType[playerid]-1] = killerid;
- PaintballWinnerScore[PaintType[playerid]-1] = PKills[killerid];
- }
- if(PlayerInfo[killerid][pJailTime] != 0 && PlayerInfo[playerid][pJailTime] != 0) {
- PlayerInfo[killerid][pJailTime] += 120;
- SendClientMessage(killerid, COLOR_WARNING, "Sentinta ta a fost marita cu 2 minute deoarece ai ucis un player.");
- }
- if(GetDistanceBetweenPlayers(killerid,playerid) > 100 && reason != 34) {
- new gunname[50];
- GetWeaponNameEx(reason,gunname,sizeof(gunname));
- format(string, sizeof(string), "AdmWarning: %s l-a omorat pe %s de la %.0fm cu %s.",GetName(killerid),GetName(playerid),GetDistanceBetweenPlayers(killerid,playerid),gunname);
- if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_WARNING, string,1);
- }
- gPlayerUsingLoopingAnim[playerid] = 0;
- gPlayerSpawned[playerid] = 0;
- PlayerEnterTime[playerid]+=221;
- if(CP[playerid] == 50) {
- CP[playerid] = 0;
- RemovePlayerAttachedObject(playerid,0);
- DisablePlayerCheckpointEx(playerid);
- RemovePlayerAttachedObject(playerid,1);
- }
- if(PlayerCuffed2[playerid] == 1) {
- PlayerCuffed2[playerid] = 0;
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
- RemovePlayerAttachedObject(playerid,1);
- }
- if(gPlayerUsingLoopingAnim[playerid]) gPlayerUsingLoopingAnim[playerid] = 0;
- if(IsAMember(playerid) && IsAMember(killerid)) {
- for(new turf = 1; turf < sizeof(TurfInfo); turf++) {
- if(IsPlayerInTurf(playerid, turf) && IsPlayerInTurf(killerid, turf)) {
- 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]) {
- foreach(Player, i) {
- if(IsPlayerConnected(i) && IsPlayerLogged[i] == 1) {
- if(PlayerInfo[i][pMember] == PlayerInfo[playerid][pMember] || PlayerInfo[i][pMember] == PlayerInfo[killerid][pMember]) {
- if(PlayerInfo[i][pAdmin] == 0) SendDeathMessageToPlayer(i, killerid, playerid, reason);
- }
- }
- }
- if(PlayerInfo[killerid][pMember] == WarInfo[turf][wAttacker] || PlayerInfo[killerid][pMember] == WarInfo[turf][wFaction]) WarScoreF[PlayerInfo[killerid][pMember]][turf] += 1.0;
- ucideri[killerid][turf] ++; decese[playerid][turf] ++;
- UpdateVar(killerid, "WarKills", ucideri[killerid][turf]);
- UpdateVar(playerid, "WarDeaths", decese[playerid][turf]);
- WarKills[killerid] = ucideri[killerid][turf];
- WarDeaths[playerid] = decese[playerid][turf];
- if(PlayerInfo[killerid][pMember] == WarInfo[turf][wAttacker])
- {
- if(ucideri[killerid][turf] > bestscoreat[turf])
- {
- bestscoreat[turf] = ucideri[killerid][turf];
- bestmemberat[turf] = killerid;
- }
- }
- if(PlayerInfo[killerid][pMember] == WarInfo[turf][wFaction])
- {
- if(ucideri[killerid][turf] > bestscoredf[turf])
- {
- bestscoredf[turf] = ucideri[killerid][turf];
- bestmemberdf[turf] = killerid;
- }
- }
- if(PlayerInfo[playerid][pMember] == WarInfo[turf][wAttacker])
- {
- if(decese[playerid][turf] > worstscoreat[turf])
- {
- worstscoreat[turf] = decese[playerid][turf];
- worstmemberat[turf] = playerid;
- }
- }
- if(PlayerInfo[playerid][pMember] == WarInfo[turf][wFaction])
- {
- if(decese[playerid][turf] > worstscoredf[turf])
- {
- worstscoredf[turf] = decese[playerid][turf];
- worstmemberdf[turf] = playerid;
- }
- }
- new wname[32];
- GetWeaponNameEx(GetPlayerWeapon(killerid), wname, sizeof(wname));
- format(string, sizeof(string), "War: L-ai omorat pe %s cu %s de la %0.1fm.",GetName(playerid), wname, DistanceToPlayer(killerid, playerid));
- SendClientMessage(killerid, 0x00E5FFFF, string);
- format(string, sizeof(string), "War: Ai fost omorat de %s cu %s de la %0.1fm.",GetName(killerid),wname, DistanceToPlayer(killerid, playerid));
- SendClientMessage(playerid, 0x00E5FFFF, string);
- if(PaintType[playerid] == 0 && PaintType[killerid] == 0) {
- new Float: Pos[3], sweapon, sammo, idd;
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- for(new i = 0; i < 12; i++) {
- GetPlayerWeaponData(playerid, i, sweapon, sammo);
- if(sweapon != 0) {
- idd = CheckIDEmpty();
- Pickups[idd][psID] = CreateDynamicPickup(WeaponObject(sweapon), 23, Pos[0]+random(4), Pos[1]+random(4), Pos[2], GetPlayerVirtualWorld(playerid));
- Pickups[idd][psWar] = turf;
- Pickups[idd][psType] = 1;
- Pickups[idd][psWeapon] = sweapon;
- Pickups[idd][psAmmo] = sammo;
- }
- }
- idd = CheckIDEmpty();
- Pickups[idd][psID] = CreateDynamicPickup(1240, 23, Pos[0]+random(4), Pos[1]+random(4), Pos[2], GetPlayerVirtualWorld(playerid));
- Pickups[idd][psType] = 0;
- Pickups[idd][psWar] = turf;
- Pickups[idd][psWeapon] = 0;
- Pickups[idd][psAmmo] = 0;
- Pickups[idd][psWar] = turf;
- idd = CheckIDEmpty();
- Pickups[idd][psID] = CreateDynamicPickup(1212, 23, Pos[0]+random(4), Pos[1]+random(4), Pos[2], GetPlayerVirtualWorld(playerid));
- Pickups[idd][psType] = 2;
- Pickups[idd][psWar] = turf;
- Pickups[idd][psWeapon] = 0;
- Pickups[idd][psAmmo] = 0;
- Pickups[idd][psWar] = turf;
- Pickups[idd][psAmount] = 10+random(50);
- }
- return 1;
- }
- }
- }
- }
- if(gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11) {
- DisablePlayerCheckpointEx(playerid);
- gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
- }
- if(Mobile[playerid] != 255) {
- if(Mobile[playerid] < 255) {
- SendClientMessage(Mobile[playerid], COLOR_GRAD2, "Linia tocmai a fost intrerupta...");
- CellTime[Mobile[playerid]] = 0;
- CellTime[playerid] = 0;
- Mobile[Mobile[playerid]] = 255;
- }
- Mobile[playerid] = 255;
- CellTime[playerid] = 0;
- }
- if(PlayerInfo[playerid][pClan] != 0 && PlayerInfo[killerid][pClan] != 0) {
- for(new h = 0; h < MAX_SAFEZONES; h++) {
- if(PlayerToPoint(20.0, playerid, GraffitiInfo[h][gfX], GraffitiInfo[h][gfY], GraffitiInfo[h][gfZ])) return 1;
- }
- }
- if(PlayerHit[killerid] == playerid) {
- PlayerPlaySound(killerid,17802,0.0,0.0,0.0);
- new wname[30];
- GetWeaponName(reason, wname, sizeof(wname));
- if(reason == 0) wname = "Pumn";
- GivePlayerCash(killerid, HeadValue[playerid]);
- UsedContract[playerid] = 0;
- PlayerHit[killerid] = -1;
- Contract[playerid] = 0;
- if(DistanceToPlayer(killerid, playerid) >= 100 || reason == 4) {
- if(DistanceToPlayer(killerid, playerid) >= 200) GivePlayerCash(killerid, HeadValue[playerid]);
- format(string, sizeof(string), "* Ai efectuat cu succes contractul pe %s(%d). Ai primit: $%s.", GetName(playerid), playerid, FormatNumber(HeadValue[playerid]));
- SendClientMessage(killerid, COLOR_MONEY, string);
- 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);
- if(PhoneOnline[killerid] == 0) FailRaport(killerid, 0);
- if(GetPVarInt(killerid, "Undercover") == 0) FailRaport(killerid, 1);
- if(PhoneOnline[killerid] == 1 && GetPVarInt(killerid, "Undercover") == 1) {
- UpdateFactionRaport(killerid, 0);
- 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);
- for(new m; m < 2; m++) {
- if(PlayerInfo[killerid][pDailyMission][m] == 15 || PlayerInfo[killerid][pDailyMission][m] == 16) CheckMission(killerid, m);
- }
- }
- }
- else {
- FailRaport(killerid, 3);
- 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);
- }
- SendFactionMessage(11, COLOR_LIGHTBLUE, string);
- HeadValue[playerid] = 0;
- return 1;
- }
- if(IsAMember(playerid) && InWar[PlayerInfo[playerid][pMember]] == 1) return 1;
- if(InEvent[killerid] == 1) return 1;
- if(PaintType[killerid] == 0 && PaintType[killerid] == 0 && InEvent[killerid] == 0 && PlayerInfo[killerid][pJailed] == 0 && !IsACop(killerid) && !IsACop(playerid)) {
- if(PlayerInfo[killerid][pMember] == 0 && PlayerInfo[playerid][pMember] == 0 || PlayerInfo[playerid][pMember] != PlayerInfo[killerid][pMember]) {
- format(WantedName[playerid], 256, GetName(killerid));
- WantedReason[playerid] = reason;
- SendClientMessage(playerid,COLOR_WARNING,"Ai fost omorat de un player. Ai la dispozitie un minut pentru a folosi comanda '/call 112'.");
- WantedTimer[playerid] = SetTimerEx("ClearWanted",60000, false,"d", playerid);
- }
- }
- killerid = INVALID_PLAYER_ID;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement