Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerDeath(playerid, killerid, reason)
- {
- Alive[playerid] = 0;
- CheckDelay[playerid] = 10;
- TextDrawHideForPlayer(playerid, Status[playerid]);
- new vehicleid = GetPlayerVehicleID(playerid);
- if(vehicleVariables[vehicleid][vVehicleJob] == 7)
- {
- format(szMessage, sizeof(szMessage), "Job failed.");
- SCM(playerid, COLOR_NOB, szMessage);
- SetVehicleToRespawnEx(vehicleid);
- KillTimer(mowertimer[playerid]);
- MowerMoney[playerid] = 0;
- TextDrawHideForPlayer(playerid,Mower[playerid]);
- PlayerData[playerid][pFarmerMoney] = 0;
- PlayerData[playerid][pCheckpoint] = 0;
- CP[playerid] = 0;
- }
- if(PlayerPaintballing[playerid] != 0)
- {
- new string[500];
- new pinfo[128];
- KillP[killerid]++;
- DeathP[playerid]++;
- format(string, sizeof(string), "You have killed %s. You now have %d kills.",GetName(playerid), KillP[killerid]);
- SendClientMessage(killerid, COLOR_GENANNOUNCE, string);
- format(string, sizeof(string), "You have been killed by %s.",GetName(killerid));
- SendClientMessage(playerid, COLOR_GENANNOUNCE, string);
- PlayerPaintballScore[killerid] = KillP[killerid];
- if(PlayerPaintballScore[killerid] > PaintballWinnerScore)
- {
- PaintballWinner = killerid;
- PaintballWinnerScore = PlayerPaintballScore[killerid];
- foreach(Player,i)
- {
- if(IsPlayerConnected(i))
- {
- if(PlayerPaintballing[i] != 0)
- {
- format(pinfo,sizeof(pinfo),"%s is now in lead with %d kills.",GetName(PaintballWinner),PaintballWinnerScore);
- SCM(i, COLOR_YELLOW, pinfo);
- }
- }
- }
- }
- return 1;
- }
- KillTimer(mowertimer[playerid]);
- if(PlayerData[playerid][pHeadValue] > 0)
- {
- if(IsPlayerConnected(killerid))
- {
- if(PlayerData[killerid][pGroup] == 10)
- {
- if(GoChase[killerid] == playerid)
- {
- new string[256], string2[128];
- new killer[MAX_PLAYER_NAME];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(killerid, killer, sizeof(killer));
- GetPlayerName(playerid, name, sizeof(name));
- PlayerData[killerid][pMoney] += PlayerData[playerid][pHeadValue];
- format(string,128,"Hitman %s has fullfiled the contract on %s and collected $%d, distance: %.0fm.",killer,name,PlayerData[playerid][pHeadValue], GetDistanceBetweenPlayers(killerid, playerid));
- SendToGroup(10, COLOR_HITMAN, string);
- format(string2,128,"( HOT News ):{3366FF} %s{FFFFFF} has been assassinated by a unknown hitman.",name);
- SendClientMessageToAll(COLOR_HITMAN, string2);
- PlayerData[playerid][pHeadValue] = -1;
- GotHit[playerid] = 0;
- GetChased[playerid] = 999;
- GoChase[killerid] = 999;
- }
- }
- }
- }
- if(IsPlayerConnected(killerid))
- {
- new currentveh;
- currentveh = GetPlayerVehicleID(playerid);
- if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER && !IsAPlane(currentveh))
- {
- new name[25], kill[25], string[128];
- GetPlayerName(playerid,name,sizeof(name));
- GetPlayerName(killerid,kill,sizeof(kill));
- format(string, sizeof(string), "{f03337}Warning: Player %s(%d) was killed by %s(%d) with drive-by.", name,playerid,kill,killerid);
- submitToHelpersAndAdmins(string, COLOR_WHITE);
- }
- }
- if(PlayerData[playerid][pAdminLevel] >= 1 && AdminDuty[playerid] == 1)
- {
- AdminDuty[playerid] = 0;
- }
- else if(PlayerData[playerid][pHelper] >= 1 && HelperDuty[playerid] == 1)
- {
- HelperDuty[playerid] = 0;
- }
- new turfkiller, turfplayerid;
- for(new i = 0; i <= sizeof(TurfInfo); i++)
- {
- if(IsPlayerInTurf(playerid, i) == 1)
- {
- turfplayerid = i;
- break;
- }
- }
- for(new i = 0; i <= sizeof(TurfInfo); i++)
- {
- if(IsPlayerInTurf(killerid, i) == 1)
- {
- turfkiller = i;
- break;
- }
- }
- new string[256];
- if(WarInfo[turfplayerid][wTime] > 0 && WarInfo[turfkiller][wTime] > 0)
- {
- if(turfplayerid == turfkiller)
- {
- if(PlayerData[playerid][pGroup] == WarInfo[turfplayerid][wAttacker] && PlayerData[killerid][pGroup] == WarInfo[turfplayerid][wFaction])
- {
- PlayerData[playerid][pWarDeaths] += 1;
- format(string, sizeof(string), "You have been killed by %s (%i)", PlayerData[killerid][pNormalName], killerid);
- SCM(playerid, COLOR_GENANNOUNCE, string);
- groupVariables[WarInfo[turfkiller][wFaction]][gScore] += 1;
- PlayerData[killerid][pWarScore] += 1;
- format(string, sizeof(string), "You have killed %s (%i).", PlayerData[playerid][pNormalName], playerid);
- SCM(killerid, COLOR_GENANNOUNCE, string);
- SCM(playerid, COLOR_LIGHTBLUE, "You will be spawned in the HQ.");
- }
- else if(PlayerData[killerid][pGroup] == WarInfo[turfkiller][wAttacker] && PlayerData[playerid][pGroup] == WarInfo[turfkiller][wFaction])
- {
- PlayerData[playerid][pWarDeaths] += 1;
- format(string, sizeof(string), "You have been killed by %s (%i).", PlayerData[killerid][pNormalName], killerid);
- SCM(playerid, COLOR_GENANNOUNCE, string);
- groupVariables[WarInfo[turfplayerid][wAttacker]][gScore] += 1;
- PlayerData[killerid][pWarScore] += 1;
- format(string, sizeof(string), "You have killed %s (%i).", PlayerData[playerid][pNormalName], playerid);
- SCM(killerid, COLOR_GENANNOUNCE, string);
- SCM(playerid, COLOR_LIGHTBLUE, "You will be spawned in group HQ.");
- }
- }
- }
- if((WarInfo[turfkiller][wTime] != 0 && (WarInfo[turfkiller][wAttacker] == PlayerData[playerid][pGroup] || WarInfo[turfkiller][wFaction] == PlayerData[playerid][pGroup]) && PlayerData[playerid][pGroup] != 0) || (PlayerData[killerid][pGroup] == 1
- || PlayerData[killerid][pGroup] == 2 || PlayerData[killerid][pGroup] == 3 || PlayerData[killerid][pGroup] == 5) || (PlayerData[playerid][pGroup] == 1 || PlayerData[playerid][pGroup] == 2 || PlayerData[playerid][pGroup] == 3 || PlayerData[playerid][pGroup] == 5) || (PlayerData[playerid][pGroup] == PlayerData[killerid][pGroup]) || (PlayerPaintballing[killerid] >= 1))
- {
- }
- else
- {
- WantedID[playerid] = killerid;
- SCM(playerid, COLOR_WHITE, "{E60000}[KILL]: {FFFFFF}%s murdered you, use [/call 112]. You have 60 seconds to announce the police.");
- WantedIDTime[playerid] = 60;
- }
- //SetTimerEx("Spawn", 3999, 0, "d", playerid);
- SetPlayerHealth(playerid, 0);
- killerid = INVALID_PLAYER_ID;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement