Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerDeath(playerid, killerid, reason)
- {
- new string[256];
- for(new i; i<15; i++) {
- if(playerid == PlantDestroyer[i]) {
- format(string, sizeof(string), "%s (%s) failed to destroy %s's weed plantation because he was killed.", GetName(playerid), NumeFactiune(PlayerInfo[playerid][pMember]), NumeFactiune(i));
- SendRadioMessage(1, 0x3350FFFF, string);
- SendRadioMessage(2, 0x3350FFFF, string);
- SendRadioMessage(3, 0x3350FFFF, string);
- SendFamilyMessage(GetPlayerVirtualWorld(PlantDestroyer[i]), 0x3350FFFF, string);
- PlantDestroy[i] = 0;
- PlantDestroyer[i] = INVALID_PLAYER_ID;
- if(PlantPercentage[i] < 96) {
- PlantPercentage[i] += 5;
- format(string, sizeof(string), "UPDATE `factions` SET `PlantPercentage`='%d' WHERE `ID`='%d'", PlantPercentage[GetPlayerVirtualWorld(PlantDestroyer[i])], GetPlayerVirtualWorld(PlantDestroyer[i]));
- mysql_query(SQL, string);
- } else {
- PlantPercentage[i] = 100;
- format(string, sizeof(string), "UPDATE `factions` SET `PlantPercentage`='%d' WHERE `ID`='%d'", PlantPercentage[GetPlayerVirtualWorld(PlantDestroyer[i])], GetPlayerVirtualWorld(PlantDestroyer[i]));
- mysql_query(SQL, string);
- }
- }
- }
- inDrugs[playerid] = 0;
- if(CP[playerid] == 44) {
- new engine,lights,alarm,doors,bonnet,boot,objective;
- GetVehicleParamsEx(JobCars[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(JobCars[playerid],engine,lights,alarm,0,bonnet,boot,objective);
- DestroyVehicle(JobCars[playerid]);
- format(string, sizeof(string), "You failed the mission because you got out of the car.");
- SendClientMessage(playerid, COLOR_ADMCHAT, string);
- CP[playerid] = 0;
- DisablePlayerCheckpoint(playerid);
- PlayerInfo[playerid][pWorking] = 0;
- workerz[4] --;
- }
- if(CP[playerid] == 45) {
- new engine,lights,alarm,doors,bonnet,boot,objective;
- GetVehicleParamsEx(JobCars[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(JobCars[playerid],engine,lights,alarm,0,bonnet,boot,objective);
- DestroyVehicle(JobCars[playerid]);
- format(string, sizeof(string), "You failed the mission because you got out of the car.");
- SendClientMessage(playerid, COLOR_ADMCHAT, string);
- CP[playerid] = 0;
- DisablePlayerCheckpoint(playerid);
- PlayerInfo[playerid][pWorking] = 0;
- workerz[9] --;
- }
- if(PlayerInfo[playerid][pWorking] == 6) {
- new engine,lights,alarm,doors,bonnet,boot,objective;
- GetVehicleParamsEx(JobCars[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(JobCars[playerid],engine,lights,alarm,0,bonnet,boot,objective);
- DestroyVehicle(JobCars[playerid]);
- format(string, sizeof(string), "You failed the mission because you got out of the car.");
- SendClientMessage(playerid, COLOR_ADMCHAT, string);
- CP[playerid] = 0;
- DisablePlayerCheckpoint(playerid);
- PlayerInfo[playerid][pWorking] = 0;
- tractor[playerid] = 0;
- tractorP[playerid] = 0;
- workerz[6] --;
- }
- if(killerid != INVALID_PLAYER_ID)
- {
- if(GetDistanceBetweenPlayers(killerid, playerid) > 40 && reason == 24)
- {
- new string5[472];
- format(string5, sizeof(string5), "{f03337}Distance Hack: %s killed %s from %.0f meters with Desert Eagle (40m Max)", GetName(killerid), GetName(playerid), GetDistanceBetweenPlayers(killerid, playerid));
- ABroadCast(COLOR_WHITE, string5, 1);
- format(string5, sizeof(string5), "{f03333}Distance Hack: %s is in zone %s and %s is in zone %s", GetName(killerid),GetPlayerZone(killerid), GetName(playerid), GetPlayerZone(playerid));
- ABroadCast(COLOR_WHITE, string5, 1);
- }
- if(GetDistanceBetweenPlayers(killerid, playerid) > 100 && reason == 31)
- {
- new string5[472];
- format(string5, sizeof(string5), "{f03337}Distance Hack: %s killed %s from %.0f meters with M4 (100m Max)", GetName(killerid), GetName(playerid), GetDistanceBetweenPlayers(killerid, playerid));
- ABroadCast(COLOR_WHITE, string5, 1);
- format(string5, sizeof(string5), "{f03333}Distance Hack: %s is in zone %s and %s is in zone %s", GetName(killerid),GetPlayerZone(killerid), GetName(playerid), GetPlayerZone(playerid));
- ABroadCast(COLOR_WHITE, string5, 1);
- }
- if(GetDistanceBetweenPlayers(killerid, playerid) > 35 && reason == 32)
- {
- new string5[472];
- format(string5, sizeof(string5), "{f03337}Distance Hack: %s killed %s from %.0f meters with TEC9 (35m Max)", GetName(killerid), GetName(playerid), GetDistanceBetweenPlayers(killerid, playerid));
- ABroadCast(COLOR_WHITE, string5, 1);
- format(string5, sizeof(string5), "{f03333}Distance Hack: %s is in zone %s and %s is in zone %s", GetName(killerid),GetPlayerZone(killerid), GetName(playerid), GetPlayerZone(playerid));
- ABroadCast(COLOR_WHITE, string5, 1);
- }
- if(GetDistanceBetweenPlayers(killerid, playerid) > 45 && reason == 27)
- {
- new string5[472];
- format(string5, sizeof(string5), "{f03337}Distance Hack: %s killed %s from %.0f meters with Combat Shotgun (45m Max)", GetName(killerid), GetName(playerid), GetDistanceBetweenPlayers(killerid, playerid));
- ABroadCast(COLOR_WHITE, string5, 1);
- format(string5, sizeof(string5), "{f03333}Distance Hack: %s is in zone %s and %s is in zone %s", GetName(killerid),GetPlayerZone(killerid), GetName(playerid), GetPlayerZone(playerid));
- ABroadCast(COLOR_WHITE, string5, 1);
- }
- if(GetDistanceBetweenPlayers(killerid, playerid) > 105 && reason == 33)
- {
- new string5[472];
- format(string5, sizeof(string5), "{f03337}Distance Hack: %s killed %s from %.0f meters with Rifle (105m Max)", GetName(killerid), GetName(playerid), GetDistanceBetweenPlayers(killerid, playerid));
- ABroadCast(COLOR_WHITE, string5, 1);
- format(string5, sizeof(string5), "{f03333}Distance Hack: %s is in zone %s and %s is in zone %s", GetName(killerid),GetPlayerZone(killerid), GetName(playerid), GetPlayerZone(playerid));
- ABroadCast(COLOR_WHITE, string5, 1);
- }
- // anti distance hack
- new name[MAX_PLAYER_NAME];
- new Float:px,Float:py,Float:pz;
- gPlayerUsingLoopingAnim[playerid] = 0;
- gPlayerSpawned[playerid] = 0;
- GetPlayerName(playerid, name, sizeof(name));
- PlayerInfo[playerid][pLocal] = INVALID_PLAYER_ID;
- GetPlayerPos(playerid, px, py, pz);
- new currentveh = GetPlayerVehicleID(playerid);
- printf("DEATH: %s was killed by %s with gun %d",name,GetName(killerid),reason);
- playerdeath[playerid] = 0;
- curatj[playerid] = 0;
- PlayerEnterTime[playerid]+=221;
- if(PlayerInfo[playerid][pTraining] == 1 && PlayerInfo[killerid][pTraining] == 1) {
- format(string, sizeof(string), "You killed %s.", GetName(playerid));
- SCM(killerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "You were killed by %s.", GetName(killerid));
- SCM(playerid, COLOR_LIGHTBLUE, string);
- }
- if(CP[playerid] == 50)
- {
- CP[playerid] = 0;
- RemovePlayerAttachedObject(playerid,0);
- DisablePlayerCheckpoint(playerid);
- RemovePlayerAttachedObject(playerid,1);
- format(string, sizeof(string), "Because you succesfully killed the robber you received %.1f% Popularity.", 0.1);
- SCM(killerid, COLOR_LIGHTRED, string);
- PlayerInfo[killerid][pPopularity] += 0.1;
- format(string, sizeof(string), "UPDATE `users` SET `Popularity`='%.1f' WHERE `NormalName`='%s'", PlayerInfo[killerid][pPopularity], PlayerInfo[killerid][pNormalName]);
- mysql_query(SQL, string);
- }
- if(CP[playerid] == 51)
- {
- CP[playerid] = 0;
- RemovePlayerAttachedObject(playerid,0);
- DisablePlayerCheckpoint(playerid);
- RemovePlayerAttachedObject(playerid,1);
- }
- if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER && !IsAPlane(currentveh))
- {
- GetPlayerName(playerid,name,sizeof(name));
- new kill[25];
- 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);
- ABroadCast(COLOR_WHITE,string,1);
- }
- if(XDeaths[playerid] == 0)
- {
- LastDeath[playerid] = gettime();
- }
- XDeaths[playerid]++;
- if(XDeaths[playerid] == 2)
- {
- if((gettime() - LastDeath[playerid]) <= 2)
- {
- KickEx(playerid);
- return 1;
- }else
- if((gettime() - LastDeath[playerid]) > 2)
- {
- XDeaths[playerid]=0;
- }
- }
- if(killerid == playerid)
- {
- KickEx(killerid);
- return 1;
- }
- if(PlayerCuffed2[playerid] == 1)
- {
- PlayerCuffed2[playerid] = 0;
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
- RemovePlayerAttachedObject(playerid,1);
- }
- if(PlayerInfo[killerid][pJailed] > 0)
- {
- format(string, sizeof(string), "{f03337}Warning: Player %s(%d) was killed by Jailed Player %s(%d).", GetName(playerid),playerid,GetName(killerid),killerid);
- ABroadCast(COLOR_WHITE,string,1);
- return 1;
- }
- if(reason == 38 && GetPlayerState(killerid) != PLAYER_STATE_DRIVER)
- {
- new kickname[25];
- if(IsPlayerConnected(killerid))
- {
- GetPlayerName(killerid, kickname, sizeof(kickname));
- format(string, 256, "{f03337}Warning: [%d]%s just killed a player with minigun, be sure he's not fake-killing.",killerid,kickname);
- ABroadCast(COLOR_WHITE,string,1);
- }
- }
- if(IsAMember(killerid) && IsACop(playerid) && PlayerInfo[killerid][pWantedLevel] > 0 && OnDuty[playerid] == 1) {
- format(string, sizeof(string), "Because you killed a cop on duty and you were having wanted you received %.1f% Popularity.", 0.1);
- SCM(killerid, COLOR_LIGHTGREEN, string);
- PlayerInfo[killerid][pPopularity] += 0.1;
- format(string, sizeof(string), "UPDATE `users` SET `Popularity`='%.1f' WHERE `NormalName`='%s'", PlayerInfo[killerid][pPopularity], PlayerInfo[killerid][pNormalName]);
- mysql_query(SQL, string);
- format(string, sizeof(string), "Because you were on duty and got killed by a gangster with wanted you lost %.1f% Popularity.", 0.1);
- SCM(playerid, COLOR_LIGHTGREEN, string);
- PlayerInfo[playerid][pPopularity] -= 0.1;
- format(string, sizeof(string), "UPDATE `users` SET `Popularity`='%.1f' WHERE `NormalName`='%s'", PlayerInfo[playerid][pPopularity], PlayerInfo[playerid][pNormalName]);
- mysql_query(SQL, string);
- }
- if(IsAMember(playerid) && IsACop(killerid) && PlayerInfo[playerid][pWantedLevel] > 0 && OnDuty[killerid] == 1) {
- format(string, sizeof(string), "Because you killed a gangster with wanted and were on duty you received %.1f% Popularity.", 0.1);
- SCM(killerid, COLOR_LIGHTGREEN, string);
- PlayerInfo[killerid][pPopularity] += 0.1;
- format(string, sizeof(string), "UPDATE `users` SET `Popularity`='%.1f' WHERE `NormalName`='%s'", PlayerInfo[killerid][pPopularity], PlayerInfo[killerid][pNormalName]);
- mysql_query(SQL, string);
- format(string, sizeof(string), "Because you had been on the police wanted list and got killed by an on-duty cop you lost %.1f% Popularity.", 0.1);
- SCM(playerid, COLOR_LIGHTGREEN, string);
- PlayerInfo[playerid][pPopularity] -= 0.1;
- format(string, sizeof(string), "UPDATE `users` SET `Popularity`='%.1f' WHERE `NormalName`='%s'", PlayerInfo[playerid][pPopularity], PlayerInfo[playerid][pNormalName]);
- mysql_query(SQL, string);
- }
- if(fight2[playerid] != 999)
- {
- SetPlayerVirtualWorld(fight2[playerid],0);
- fight2[fight2[playerid]] = 999;
- GivePlayerCash(fight2[playerid],2000);
- Update(fight2[playerid],pCashx);
- SCM(fight2[playerid],COLOR_LIGHTBLUE,"You won the fight and received $2,000.");
- new randomrp = random(6);
- if(randomrp == 5)
- {
- PlayerInfo[fight2[playerid]][pExp] += 1;
- Update(fight2[playerid],pRP);
- SCM(fight2[playerid],COLOR_LIGHTBLUE,"You received one respect points for win this race.");
- }
- new fightname[25];
- GetPlayerName(fight2[playerid],fightname,sizeof(fightname));
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInRangeOfPoint(i,15.0,1510.2313,-1058.1528,25.0625))
- {
- format(string,sizeof(string),"** %s won the fight.",fightname);
- SendClientMessage(i,COLOR_WHITE,string);
- }
- }
- if(PlayerInfo[fight2[playerid]][pChar] > 0)
- {
- SetPlayerSkin(fight2[playerid], PlayerInfo[fight2[playerid]][pChar]);
- }
- else
- {
- SetPlayerSkin(fight2[playerid], PlayerInfo[fight2[playerid]][pModel]);
- }
- TogglePlayerControllable(fight2[playerid], 1);
- SetPlayerPos(fight2[playerid],1510.46,-1059.55,25.0625);
- fighta = 0;
- fight2[playerid] = 999;
- fightr[playerid] = 1;
- return 1;
- }
- if(fight2n[playerid] != 999)
- {
- SetPlayerVirtualWorld(fight2n[playerid],0);
- fight2n[fight2n[playerid]] = 999;
- GivePlayerCash(fight2n[playerid],2000);
- Update(fight2n[playerid],pCashx);
- SCM(fight2n[playerid],COLOR_LIGHTBLUE,"You won the fight and received $2,000.");
- new randomrp = random(6);
- if(randomrp == 5)
- {
- PlayerInfo[fight2n[playerid]][pExp] += 1;
- Update(fight2n[playerid],pRP);
- SCM(fight2n[playerid],COLOR_LIGHTBLUE,"You received one respect points for win this race.");
- }
- new fightname[25];
- GetPlayerName(fight2n[playerid],fightname,sizeof(fightname));
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInRangeOfPoint(i,15.0,1328.1801,-1558.2500,13.5469))
- {
- format(string,sizeof(string),"** %s won the ninja fight.",fightname);
- SendClientMessage(i,COLOR_WHITE,string);
- }
- }
- ResetPlayerWeaponsEx(fight2n[playerid]);
- ResetPlayerWeapons(fight2n[playerid]);
- if(PlayerInfo[fight2n[playerid]][pChar] > 0)
- {
- SetPlayerSkin(fight2n[playerid], PlayerInfo[fight2n[playerid]][pChar]);
- }
- else
- {
- SetPlayerSkin(fight2n[playerid], PlayerInfo[fight2n[playerid]][pModel]);
- }
- TogglePlayerControllable(fight2n[playerid], 1);
- SetPlayerPos(fight2n[playerid],1328.1801,-1558.2500,13.5469);
- fightnin = 0;
- fight2n[playerid] = 999;
- fightrn[playerid] = 1;
- return 1;
- }
- if(startrace == 1 && playerrace[playerid] != 0)
- {
- playerrace[playerid] = 0;
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- if(playerrace[i] != 0)
- {
- playerrace[i] = 0;
- SetPlayerPos(i, SBizzInfo[23][sbEntranceX],SBizzInfo[23][sbEntranceY],SBizzInfo[23][sbEntranceZ]);
- SetPlayerInterior(i, 0);
- DisablePlayerCheckpoint(i);
- }
- }
- startrace=0;
- racewinner=999;
- SetVehicleToRespawn(hotc[1]);
- SetVehicleToRespawn(hotc[2]);
- Gas[hotc[1]] = GasMax;
- Gas[hotc[1]] = GasMax;
- }
- if(startsrace == 1 && playerraces[playerid] != 0)
- {
- playerraces[playerid] = 0;
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- if(playerraces[i] != 0)
- {
- playerraces[i] = 0;
- SetPlayerPos(i, SBizzInfo[25][sbEntranceX],SBizzInfo[25][sbEntranceY],SBizzInfo[25][sbEntranceZ]);
- SetPlayerInterior(i, 0);
- DisablePlayerCheckpoint(i);
- }
- }
- startsrace=0;
- raceswinner=999;
- SetVehicleToRespawn(sanr[1]);
- SetVehicleToRespawn(sanr[2]);
- Gas[sanr[1]] = GasMax;
- Gas[sanr[1]] = GasMax;
- }
- if(TakingLesson[playerid] == 1)
- {
- TakingLesson[playerid] = 0;
- DisablePlayerCheckpoint(playerid);
- SetVehicleToRespawn(currentveh);
- }
- if(gPlayerUsingLoopingAnim[playerid])
- {
- gPlayerUsingLoopingAnim[playerid] = 0;
- }
- if(PlayerInfo[playerid][pCarLicT] == 0 && PlayerInfo[playerid][pCarLic] == 1)
- {
- PlayerInfo[playerid][pCarLic] = 0;
- PlayerInfo[playerid][pCarLicT] = 0;
- new str[128];
- format(str,128,"UPDATE users SET `CarLic`='0',`CarLicT`='0' WHERE `NormalName`='%s'",PlayerInfo[playerid][pNormalName]);
- mysql_query(SQL,str);
- SCM(playerid,COLOR_GRAD1,"Your driving license has expired.");
- }
- if(PlayerInfo[playerid][pFlyLicT] == 0 && PlayerInfo[playerid][pFlyLic] == 1)
- {
- PlayerInfo[playerid][pFlyLic] = 0;
- PlayerInfo[playerid][pFlyLicT] = 0;
- new str[128];
- format(str,128,"UPDATE users SET `FlyLic`='0',`FlyLicT`='0' WHERE `NormalName`='%s'", PlayerInfo[playerid][pNormalName]);
- mysql_query(SQL,str);
- SCM(playerid,COLOR_GRAD1,"Your flying license has expired.");
- }
- if(PlayerInfo[playerid][pBoatLicT] == 0 && PlayerInfo[playerid][pBoatLic] == 1)
- {
- PlayerInfo[playerid][pBoatLic] = 0;
- PlayerInfo[playerid][pBoatLic] = 0;
- new str[128];
- format(str,128,"UPDATE users SET `BoatLic`='0',`BoatLicT`='0' WHERE `NormalName`='%s'", PlayerInfo[playerid][pNormalName]);
- mysql_query(SQL,str);
- SCM(playerid,COLOR_GRAD1,"Your boat license has expired.");
- }
- if(PlayerInfo[playerid][pFishLicT] == 0 && PlayerInfo[playerid][pFishLic] == 1)
- {
- PlayerInfo[playerid][pFishLic] = 0;
- PlayerInfo[playerid][pFishLicT] = 0;
- new str[128];
- format(str,128,"UPDATE users SET `FishLic`='0',`FishLicT`='0' WHERE `NormalName`='%s'", PlayerInfo[playerid][pNormalName]);
- mysql_query(SQL,str);
- SCM(playerid,COLOR_GRAD1,"Your fish license has expired.");
- }
- if(PlayerInfo[playerid][pGunLicT] == 0 && PlayerInfo[playerid][pGunLic] == 1)
- {
- PlayerInfo[playerid][pGunLic] = 0;
- PlayerInfo[playerid][pGunLicT] = 0;
- new str[128];
- format(str,128,"UPDATE users SET `GunLic`='0',`GunLicT`='0' WHERE `NormalName`='%s'", PlayerInfo[playerid][pNormalName]);
- mysql_query(SQL,str);
- SCM(playerid,COLOR_GRAD1,"Your gun license has expired.");
- }
- new fpm,fkm,var[128];
- fpm = PlayerInfo[playerid][pMember];
- fkm = PlayerInfo[killerid][pMember];
- for(new turf = 1; turf < sizeof(TurfInfo); turf++)
- {
- if(GetPlayerVirtualWorld(playerid) == 420) {
- if(IsPlayerInTurf(playerid, turf) && IsPlayerInTurf(killerid, turf))
- {
- if(IsAMember(playerid) && IsAMember(killerid))
- {
- if(WarInfo[turf][wFaction] == fpm && WarInfo[turf][wAttacker] == fkm || WarInfo[turf][wFaction] == fkm && WarInfo[turf][wAttacker] == fpm)
- {
- if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER) return SCM(playerid,COLOR_WHITE, "No points for you.");
- if(fkm == WarInfo[turf][wAttacker] || fkm == WarInfo[turf][wFaction])
- {
- WarScoreF[fkm][turf] += 1.0;
- }
- ucideri[killerid] ++;
- decese[playerid] ++;
- format(var, sizeof(var), "UPDATE `users` SET `k`='%d' WHERE `NormalName`='%s'",ucideri[killerid], PlayerInfo[killerid][pNormalName]);
- mysql_query(SQL ,var);
- format(var, sizeof(var), "UPDATE `users` SET `d`='%d' WHERE `NormalName`='%s'",decese[playerid], PlayerInfo[playerid][pNormalName]);
- mysql_query(SQL ,var);
- if(PlayerInfo[killerid][pMember] == WarInfo[turf][wAttacker])
- {
- if(ucideri[killerid] > bestscoreat[turf])
- {
- bestscoreat[turf] = ucideri[killerid];
- bestmemberat[turf] = killerid;
- }
- }
- if(PlayerInfo[killerid][pMember] == WarInfo[turf][wFaction])
- {
- if(ucideri[killerid] > bestscoredf[turf])
- {
- bestscoredf[turf] = ucideri[killerid];
- bestmemberdf[turf] = killerid;
- }
- }
- if(PlayerInfo[playerid][pMember] == WarInfo[turf][wAttacker])
- {
- if(decese[playerid] > worstscoreat[turf])
- {
- worstscoreat[turf] = decese[playerid];
- worstmemberat[turf] = playerid;
- }
- }
- if(PlayerInfo[playerid][pMember] == WarInfo[turf][wFaction])
- {
- if(decese[playerid] > worstscoredf[turf])
- {
- worstscoredf[turf] = decese[playerid];
- worstmemberdf[turf] = playerid;
- }
- }
- format(string, sizeof(string), "Turf %s (%d): You killed %s", TurfName(turf),turf,GetName(playerid));
- SCM(killerid, TEAM_AZTECAS_COLOR, string);
- format(string, sizeof(string), "Turf %s (%d): You were killed by %s", TurfName(turf),turf,GetName(killerid));
- SCM(playerid, TEAM_AZTECAS_COLOR, string);
- new Float:HPP[MAX_PLAYERS];
- GetPlayerHealth(killerid, HPP[killerid]);
- if(HPP[killerid] + 10 >= 100) {
- SetPlayerHealthEx(killerid, 100);
- } else {
- SetPlayerHealthEx(killerid, HPP[killerid] + 10);
- }
- new weap[128];
- SendClientMessage(killerid, COLOR_LIGHTBLUE, "You received 10 Health Points.");
- if(GetPlayerWeapon(playerid) == 24 || GetPlayerWeapon(playerid) == 27 || GetPlayerWeapon(playerid) == 32 || GetPlayerWeapon(playerid) == 31 || GetPlayerWeapon(playerid) == 33) {
- new faw[MAX_PLAYERS];
- faw[killerid] = GetPlayerWeapon(killerid);
- GivePlayerWeaponEx(killerid, GetPlayerWeapon(playerid), 150);
- GetWeaponName(GetPlayerWeapon(playerid), weap, sizeof(weap));
- format(string,sizeof(string), "You received a %s with 150 ammo.", weap);
- SendClientMessage(killerid, COLOR_LIGHTBLUE, string);
- SetPlayerArmedWeapon(killerid, faw[killerid]);
- }
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][pMember] == WarInfo[turf][wAttacker] || PlayerInfo[i][pMember] == WarInfo[turf][wFaction])
- SendDeathMessageToPlayer(i, killerid, playerid, reason);
- }
- return 1;
- }
- }
- }
- }
- }
- if(IsACop(killerid) && OnDuty[killerid] == 1)
- {
- if(PlayerInfo[playerid][pWantedLevel] >= 1)
- {
- new price = PlayerInfo[playerid][pWantedLevel] * 1000;
- new count;
- new wantedlost2 = PlayerInfo[playerid][pWantedLevel];
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- if(IsACop(i) && CrimInRange(30.0, playerid,i) && OnDuty[i] == 1)
- {
- count = 1;
- format(string, sizeof(string), "~w~Running Suspect ~r~Killed~n~~r~Bonus ~g~$%d", price);
- GameTextForPlayer(i, string, 5000, 1);
- ConsumingMoney[i] = 1;
- GivePlayerCash(i, price/2);
- Update(i, pCashx);
- }
- }
- if(count == 1)
- {
- GivePlayerCash(playerid, - price);
- PlayerInfo[playerid][pWantedDeaths] += 1;
- PlayerInfo[playerid][pJailed] = 1;
- PlayerInfo[playerid][pJailTime] = (PlayerInfo[playerid][pWantedLevel])*(150);
- new sendername[30];
- GetPlayerName(killerid,sendername,sizeof(sendername));
- format(string, sizeof(string), "* You are in Jail for %d Seconds and lose $%d because of running away and getting shot by the Officer %s.", PlayerInfo[playerid][pJailTime], price,sendername);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- TogglePlayerControllable(playerid, 0);
- SetTimerEx("UnFreezeStation", 1000, false, "i", playerid);
- WantedPoints[playerid] = 0;
- PlayerInfo[playerid][pWantedLevel] = 0;
- SetPlayerWantedLevel(playerid, 0);
- Update(playerid,pWantedLevelx);
- Update(playerid,pJailedx);
- Update(playerid,pJailTimex);
- ClearCrime(playerid);
- new deathname[25];
- GetPlayerName(playerid,deathname,sizeof(deathname));
- if(PlayerInfo[killerid][pMember] == 1 || PlayerInfo[killerid][pLeader] == 1)
- {
- format(string, sizeof(string), "HQ: All Units. LSPD Officer %s has completed assignment",sendername);
- SendTeamMessage(1, COLOR_DBLUE, string);
- SendTeamMessage(2, COLOR_DBLUE, string);
- SendTeamMessage(3, COLOR_DBLUE, string);
- format(string, sizeof(string), "HQ: %s has been processed, got killed having wanted %d",deathname,wantedlost2);
- SendTeamMessage(1, COLOR_DBLUE, string);
- SendTeamMessage(2, COLOR_DBLUE, string);
- SendTeamMessage(3, COLOR_DBLUE, string);
- }
- else if(PlayerInfo[killerid][pMember] == 2 || PlayerInfo[killerid][pLeader] == 2)
- {
- format(string, sizeof(string), "HQ: All Units. FBI Agent %s has completed assignment",sendername);
- SendTeamMessage(1, COLOR_DBLUE, string);
- SendTeamMessage(2, COLOR_DBLUE, string);
- SendTeamMessage(3, COLOR_DBLUE, string);
- format(string, sizeof(string), "HQ: %s has been processed, got killed having wanted %d",deathname,wantedlost2);
- SendTeamMessage(1, COLOR_DBLUE, string);
- SendTeamMessage(2, COLOR_DBLUE, string);
- SendTeamMessage(3, COLOR_DBLUE, string);
- }
- else if(PlayerInfo[killerid][pMember] == 3 || PlayerInfo[killerid][pLeader] == 3)
- {
- format(string, sizeof(string), "HQ: All Units. NG Soldier %s has completed assignment",sendername);
- SendTeamMessage(1, COLOR_DBLUE, string);
- SendTeamMessage(2, COLOR_DBLUE, string);
- SendTeamMessage(3, COLOR_DBLUE, string);
- format(string, sizeof(string), "HQ: %s has been processed, got killed having wanted %d",deathname,wantedlost2);
- SendTeamMessage(1, COLOR_DBLUE, string);
- SendTeamMessage(2, COLOR_DBLUE, string);
- SendTeamMessage(3, COLOR_DBLUE, string);
- }
- }
- }
- }
- if (gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11)
- {
- DisablePlayerCheckpoint(playerid);
- gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
- }
- new caller = Mobile[playerid];
- if(caller != INVALID_PLAYER_ID)
- {
- SendClientMessage(caller, COLOR_GRAD2, "The line just went dead....");
- CellTime[caller] = 0;
- CellTime[playerid] = 0;
- Mobile[caller] = INVALID_PLAYER_ID;
- Mobile[playerid] = INVALID_PLAYER_ID;
- CellTime[playerid] = 0;
- }
- if(PlayerPaintballing[playerid] != 0)
- {
- format(string, sizeof(string), "{ffc000}[Paintball]: You killed %s.",GetName(playerid));
- SendClientMessage(killerid, COLOR_WHITE, string);
- format(string, sizeof(string), "{ffc000}[Paintball]: You were killed by %s.",GetName(killerid));
- SendClientMessage(playerid, COLOR_WHITE, string);
- foreach(Player, i) {
- if(PlayerPaintballing[i] != 0)
- SendDeathMessageToPlayer(i, killerid, playerid, reason);
- }
- new pinfo[128];
- KillP[killerid]++;
- format(pinfo,sizeof(pinfo),"You have %d kills and %d deaths.", KillP[killerid],DeathP[killerid]);
- PlayerTextDrawSetString(killerid, Paintball[2][killerid], pinfo);
- PlayerTextDrawShow(killerid, Paintball[2][killerid]);
- DeathP[playerid]++;
- format(pinfo,sizeof(pinfo),"You have %d kills and %d deaths.", KillP[playerid],DeathP[playerid]);
- PlayerTextDrawSetString(playerid, Paintball[2][playerid], pinfo);
- PlayerTextDrawShow(playerid, Paintball[2][playerid]);
- PlayerPaintballScore[killerid] = KillP[killerid]-DeathP[killerid];
- if(PlayerPaintballScore[killerid] > PaintballWinnerScore)
- {
- PaintballWinner = killerid;
- PaintballWinnerScore = PlayerPaintballScore[killerid];
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(PlayerPaintballing[i] != 0)
- {
- format(pinfo,sizeof(pinfo),"Lead is %s with %d score.",GetName(PaintballWinner),PaintballWinnerScore);
- PlayerTextDrawSetString(i, Paintball[1][i], pinfo);
- PlayerTextDrawShow(i, Paintball[1][i]);
- }
- }
- }
- }
- return 1;
- }
- if(PlayerInfo[playerid][pHeadValue] > 0)
- {
- if(IsPlayerConnected(killerid))
- {
- if(PlayerInfo[killerid][pMember] == 11)
- {
- if(GoChase[killerid] == playerid)
- {
- new killer[MAX_PLAYER_NAME];
- GetPlayerName(killerid, killer, sizeof(killer));
- GivePlayerCash(killerid, PlayerInfo[playerid][pHeadValue]);
- format(string,128,"<< Hitman %s has fulfilled the contract on %s (%.2f meters) and collected $%s. >>",killer,name,GetDistanceBetweenPlayers(killerid, playerid),FormatNumber(PlayerInfo[playerid][pHeadValue]));
- SendFamilyMessage(11, COLOR_YELLOW, string);
- PlayerInfo[playerid][pHeadValue] = 0;
- GotHit[playerid] = 0;
- GetChased[playerid] = 999;
- GoChase[killerid] = 999;
- new str[256];
- format(str,sizeof(str),"UPDATE users SET `HeadValue`='0' WHERE `NormalName`='%s'",PlayerInfo[playerid][pNormalName]);
- mysql_query(SQL,str);
- Update(killerid, pCashx);
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- ShowPlayerNameTagForPlayer(i, killerid, 1);
- }
- togfind[killerid] = 0;
- PlayerInfo[killerid][pHitT] = 600;
- format(string, sizeof(string), "UPDATE users SET `HitT`='%d' WHERE `NormalName`='%s'", PlayerInfo[killerid][pHitT], PlayerInfo[killerid][pNormalName]);
- mysql_query(SQL,string);
- if(PlayerInfo[killerid][pWantedLevel] >= 6) { }
- else { WantedPoints[killerid] += 2; }
- if(WantedPoints[killerid] > 13)
- {
- WantedPoints[killerid] = 13;
- }
- if(reason != 49)
- {
- SetPlayerCriminal(killerid,INVALID_PLAYER_ID, "First Degree Murder");
- }
- else if(reason == 49)
- {
- SetPlayerCriminal(killerid,INVALID_PLAYER_ID, "Hit And Run");
- }
- }
- }
- }
- return 1;
- }
- if(gTeam[playerid] == 3)
- {
- if(IsPlayerConnected(killerid))
- {
- if(gTeam[killerid] == 3 || gTeam[killerid] == 4 || gTeam[killerid] == 5 || (gTeam[killerid] == 11 && GoChase[killerid] == 999))
- {
- new namekill[25];
- GetPlayerName(killerid,namekill,sizeof(namekill));
- strmid(WantedName[playerid], namekill, 0, strlen(namekill), 255);
- WantedReason[playerid] = reason;
- format(string,sizeof(string),"{9b2d2d}%s murdered you, use /call 112. You have 60 seconds to announce the police.",GetName(killerid));
- SCM(playerid,COLOR_WHITE,string);
- WantedTimer[playerid] = SetTimerEx("ClearWanted",60000,false,"d",playerid);
- }
- }
- return 1;
- }
- if(gTeam[playerid] == 2)
- {
- if(IsPlayerConnected(killerid))
- {
- if(gTeam[killerid] == 3 || gTeam[killerid] == 4 || gTeam[killerid] == 5 || (gTeam[killerid] == 11 && GoChase[killerid] == 999))
- {
- new namekill[25];
- GetPlayerName(killerid,namekill,sizeof(namekill));
- strmid(WantedName[playerid], namekill, 0, strlen(namekill), 255);
- WantedReason[playerid] = reason;
- format(string,sizeof(string),"{9b2d2d}%s murdered you, use /call 112. You have 60 seconds to announce the police.",GetName(killerid));
- SCM(playerid,COLOR_WHITE,string);
- WantedTimer[playerid] = SetTimerEx("ClearWanted",60000,false,"d",playerid);
- }
- }
- return 1;
- }
- if(gTeam[playerid] == 4)
- {
- if(IsPlayerConnected(killerid))
- {
- if(gTeam[killerid] == 3 || gTeam[killerid] == 4 || gTeam[killerid] == 5 || (gTeam[killerid] == 11 && GoChase[killerid] == 999))
- {
- new namekill[25];
- GetPlayerName(killerid,namekill,sizeof(namekill));
- strmid(WantedName[playerid], namekill, 0, strlen(namekill), 255);
- WantedReason[playerid] = reason;
- format(string,sizeof(string),"{9b2d2d}%s murdered you, use /call 112. You have 60 seconds to announce the police.",GetName(killerid));
- SCM(playerid,COLOR_WHITE,string);
- WantedTimer[playerid] = SetTimerEx("ClearWanted",60000,false,"d",playerid);
- }
- }
- return 1;
- }
- if(gTeam[playerid] == 5)
- {
- if(IsPlayerConnected(killerid))
- {
- if(gTeam[killerid] == 3 || gTeam[killerid] == 4 || (gTeam[killerid] == 11 && GoChase[killerid] == 999))
- {
- new namekill[25];
- GetPlayerName(killerid,namekill,sizeof(namekill));
- strmid(WantedName[playerid], namekill, 0, strlen(namekill), 255);
- WantedReason[playerid] = reason;
- format(string,sizeof(string),"{9b2d2d}%s murdered you, use /call 112. You have 60 seconds to announce the police.",GetName(killerid));
- SCM(playerid,COLOR_WHITE,string);
- WantedTimer[playerid] = SetTimerEx("ClearWanted",60000,false,"d",playerid);
- }
- }
- return 1;
- }
- if(gTeam[playerid] == 11)
- {
- if(IsPlayerConnected(killerid))
- {
- if(gTeam[killerid] == 3 || gTeam[killerid] == 4 || gTeam[killerid] == 5)
- {
- new namekill[25];
- GetPlayerName(killerid,namekill,sizeof(namekill));
- strmid(WantedName[playerid], namekill, 0, strlen(namekill), 255);
- WantedReason[playerid] = reason;
- format(string,sizeof(string),"{9b2d2d}%s murdered you, use /call 112. You have 60 seconds to announce the police.",GetName(killerid));
- SCM(playerid,COLOR_WHITE,string);
- WantedTimer[playerid] = SetTimerEx("ClearWanted",60000,false,"d",playerid);
- }
- }
- return 1;
- }
- killerid = INVALID_PLAYER_ID;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment