Function OnPlayerDeath(playerid, killerid, reason)
{
Scheinwerfer[playerid][Schein_X] = 99999;
Scheinwerfer[playerid][Schein_Y] = 99999;
Scheinwerfer[playerid][Schein_Z] = 99999;
Scheinwerfer[playerid][Schein_A] = 99999;
Scheinwerfer[playerid][Schein_Objekt] = -1;
Scheinwerfer[playerid][Schein_Haben] = 0;
Scheinwerfer[playerid][Taschenlampe_Haben] = 0;
GW_OnPlayerDeath(playerid, killerid, reason);
M_OnPlayerDeath(playerid,killerid,reason);
new name[MAX_PLAYER_NAME];
new string[256];
PlayerInfo[playerid][pInvWeapon] = 0;
PlayerInfo[playerid][pInvAmmo] = 0;
PlayerInfo[playerid][pInvWeapon2] = 0;
PlayerInfo[playerid][pInvAmmo2] = 0;
if(OnDuty[playerid] == 1){ OnDuty[playerid] = 0; }
PlayerInfo[playerid][pHarndrang] = 0;
PlayerInfo[playerid][pHunger] = 0;
new playercash;
new victimteam;
new killerteam;
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
if(GetPlayerWeapon(playerid) == 31){ //m4
M4Drop= CreatePickup(356,4,x,y,z);
}
else if(GetPlayerWeapon(playerid) == 24) { //Deagle
DeagleDrop = CreatePickup(348,4,x,y,z);
}
else if(GetPlayerWeapon(playerid) == 29) { //Mp5
Mp5Drop = CreatePickup(353,4,x,y,z);
}
if(PlayerInfo[playerid][pLevel] > 1 && KHSperre[playerid] == 0 && PlayerInfo[playerid][pJailed] == 0 && PlayerInfo[playerid][pGangJailed] == 0 && PlayerPaintballing[playerid] == 0)
{
PlayerInfo[playerid][pTot] = 1;
}
if(gPlayerUsingLoopingAnim[playerid])
{
gPlayerUsingLoopingAnim[playerid] = 0;
// TextDrawHideForPlayer(playerid,txtAnimHelper);
}
if(BlindFold[playerid] == 1)
{
BlindFold[playerid] = 0;
}
if(PlayerInfo[playerid][pMauled] == 1)
{
PlayerInfo[playerid][pMauled] = 0;
}
InCargo[playerid] = 0; InLevi[playerid] = 0; InEnfo[playerid] = 0;
if(FirstSpawn[playerid] == 1)
{
FirstSpawn[playerid] = 0;
}
if(IsBlacklist[playerid]==1)
{
ClearBlack(playerid);
IsBlacklist[playerid]=0;
}
if(IsPlayerConnected(killerid) && !isFight[killerid])
{
new playerfaction = GetPlayerFaction(playerid);
new killerfaction = GetPlayerFaction(killerid);
for(new war;war<MAX_WARS;war++)
{
if(WarInfo[killerfaction][war] && WarInfo[killerfaction][war] == playerfaction)
{
GameTextForPlayer(killerid,"~g~GANGWAR - KILL",4444,3);
GameTextForPlayer(playerid,"~r~GANGWAR - KILL",4444,3);
isFight[killerid] = 2;
break;
}
if(WarInfo[playerfaction][war] && WarInfo[playerfaction][war] == killerfaction)
{
GameTextForPlayer(killerid,"~g~GANGWAR - KILL",4444,3);
GameTextForPlayer(playerid,"~r~GANGWAR - KILL",4444,3);
isFight[killerid] = 2;
break;
}
}
}
//-------------------- Neue WT system --------------------
/* if(!IsACop(killerid) && isFight[killerid] == 0 && PlayerInfo[killerid][pJailed] == 0)
{
if(isFight[killerid] == 0)
{
//WantedLevel[killerid] += 2;
//SetPlayerCriminal(killerid,playerid, "Mord");
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsACop(i))
{
SetTimerEx("OnPlayerStreamIn", 1000,0,"i",i);
}
}
}
}
if(isFight[killerid] == 1)
{
// SetPlayerCriminal(killerid,playerid, "Mord (Gangfight)");
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsACop(i))
{
SetTimerEx("OnPlayerStreamIn", 1000,0,"i",i);
}
}
}
if(isFight[killerid] == 2)
{
isFight[killerid] = 0;
//WantedLevel[killerid]++;
// SetPlayerCriminal(killerid,playerid,"Mord (Gangwar)");
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsACop(i))
{
SetTimerEx("OnPlayerStreamIn", 1000,0,"i",i);
}
}
}
for(new fs;fs<sizeof(FightSystem);fs++){
if(FightSystem[fs][fsFightTime]){
if(GetPlayerFaction(playerid) == FightSystem[fs][fsOwnerFaction]||
GetPlayerFaction(playerid) == FightSystem[fs][fsAttackFaction]) {
PlayerInfo[playerid][pTot] = 0;
}
}
}*/
//=======================
victimteam = gTeam[playerid];
killerteam = gTeam[killerid];
gPlayerSpawned[playerid] = 0;
GetPlayerName(playerid, name, sizeof(name));
PlayerInfo[playerid][pLocal] = 255;
if(killerid != 255)
if(reason == 38)
{
new kstring[128];
new kickname[MAX_PLAYER_NAME];
if(IsPlayerConnected(killerid))
{
GetPlayerName(killerid, kickname, sizeof(kickname));
format(string, 256, "Warnung: [%d]%s hat einen Spieler mit einer Minigun gekillt. ACHTUNG [CheatVerdacht].",killerid,kickname);
ABroadCast(COLOR_YELLOW,string,1);
printf("%s", kstring);
}
}
if(GetPVarInt(playerid, "IsOnFire"))
{
#if defined German
SendClientMessage(playerid, 0xff000000, "Du bist verbrannt!");
#else
SendClientMessage(playerid, 0xff000000, "You got fried!");
#endif
TogglePlayerBurning(playerid, false);
}
if (gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11)
{
DisablePlayerCheckpoint(playerid);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
}
new caller = Mobile[playerid];
if(caller != 255)
{
if(caller < 255)
{
SendClientMessage(caller, COLOR_GRAD2, " Die Verbindung wurde unterbrochen....");
CellTime[caller] = 0;
CellTime[playerid] = 0;
Mobile[caller] = 255;
}
Mobile[playerid] = 255;
CellTime[playerid] = 0;
}
ClearCrime(playerid);
if(PlayerPaintballing[playerid] != 0)
{
PlayerPaintballKills[killerid] ++;
if(PlayerPaintballKills[killerid] > PaintballWinnerKills)
{
new killer[MAX_PLAYER_NAME];
PaintballWinner = killerid;
PaintballWinnerKills = PlayerPaintballKills[killerid];
GetPlayerName(killerid, killer, sizeof(killer));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerPaintballing[i] != 0)
{
format(string, sizeof(string), "* %s ist mit %d Kills in Führung.",killer,PaintballWinnerKills);
SendClientMessage(i, COLOR_WHITE, string);
}
}
}
}
return 1;
}
if(GettingCK[playerid] < 999 || OnCK[playerid] < 999)
{
if(IsPlayerConnected(killerid))
{
if(GettingCK[killerid] < 999 || OnCK[playerid] < 999)
{
new killer[MAX_PLAYER_NAME];
new dier[MAX_PLAYER_NAME];
GetPlayerName(playerid, dier, sizeof(dier));
GetPlayerName(killerid, killer, sizeof(killer));
format(string, sizeof(string), "* %s hat deinen Charakter gesperrt, du kannst nun mit diesem Charakter nicht mehr Spielen.",killer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "** %s hat den Spieler %s erledigt**",killer,dier);
CKLog(string);
PlayerInfo[playerid][pCK] = 1;
if(GettingCK[playerid] < 999) { GettingCK[playerid] = 999; }
else if(OnCK[playerid] < 999) { OnCK[playerid] = 999; }
if(GettingCK[killerid] < 999) { GettingCK[killerid] = 999; }
else if(OnCK[killerid] < 999) { OnCK[killerid] = 999; }
KickPlayer[playerid] = 1;
}
}
}
if(PlayerInfo[playerid][pHeadValue] > 0)
{
if(IsPlayerConnected(killerid))
{
if(PlayerInfo[killerid][pMember] == 8 || PlayerInfo[killerid][pLeader] == 8)
{
if(GoChase[killerid] == playerid)
{
ConsumingMoney[killerid] = 1;
new killer[MAX_PLAYER_NAME];
GetPlayerName(killerid, killer, sizeof(killer));
new fkasse = PlayerInfo[playerid][pHeadValue]/2;
FraktionsKasse[7] += fkasse;
GivePlayerMoney(killerid, PlayerInfo[playerid][pHeadValue]/2);
format(string,128,"<< Hitman %s hat den Auftrag an %s erfüllt und bekommt: $%d >>",killer,name,PlayerInfo[playerid][pHeadValue]/2);
SendFamilyMessage(8, COLOR_YELLOW, string);
PlayerInfo[playerid][pHeadValue] = 0;
GotHit[playerid] = 0;
GetChased[playerid] = 999;
GoChase[killerid] = 999;
SendClientMessage(playerid,COLOR_GRAD1,"Ein Hitman hat den Auftrag an dir erfüllt!");
}
}
}
}
if(victimteam >= 4)
{
if(IsPlayerConnected(killerid))
{
new slice = 100; //$100
playercash = GetPlayerMoney(playerid);
if(gTeam[killerid] != 2 && PlayerInfo[killerid][pMember] != 7) { WantedPoints[killerid] += 2; } //+ 2 wanted points
if(SafeTime[playerid] <= 0)
{
if(gTeam[killerid] != gTeam[playerid])
{
if(GetPlayerState(killerid) == 1)
{
PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills] + 1;
}
else
{
PlayerInfo[killerid][pKills]++;
}
PlayerInfo[playerid][pDeaths]++;
}
}
if (((gTeam[killerid]) == 1) || ((gTeam[killerid]) == 3 && civnokill) || (gTeam[killerid] == gTeam[playerid] && gTeam[playerid] != 4))
{
slice = 0;
}
if (((gTeam[killerid]) != 4) && ((gTeam[killerid]) == gTeam[playerid]))//no team kill
{
slice = 0;
}
if (playercash > 0)
{
GivePlayerMoney(playerid, -slice);
}
else
{
slice = slice+500;
}
GivePlayerMoney(killerid, slice);
PlayerPlaySound(killerid, 1083, 0.0, 0.0, 0.0);
if (((gTeam[killerid]) == 3) && reason != 49 && PlayerInfo[killerid][pJailed] == 0 && !IsPlayerInArea(killerid, 560.538, -724.0283, 875.8406, -362.0141))
{
SetPlayerCriminal(killerid,255, "Vorsätzlicher Mord");
}
else if (((gTeam[killerid]) == 3) && reason == 49)
{
SetPlayerCriminal(killerid,255, "Fahrerflucht");
}
}
}
else if (victimteam == 2)
{
if(IsPlayerConnected(killerid))
{
// Cop kill
PlayerInfo[playerid][pKills]--;
if (gTeam[killerid] == 2)//cops kill cop
{
PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
GivePlayerMoney(killerid, -suecost);
GivePlayerMoney(playerid, suecost+100);//+100pays hospital bill
}
if (gTeam[killerid] >= 3)
{
WantedPoints[killerid] += 2; //+ 2 wanted points
if(reason != 49)
{
SetPlayerCriminal(killerid,255, "Vorsätzlicher Mord");
}
else if (reason == 49)
{
SetPlayerCriminal(killerid,255, "Fahrerflucht");
}
}
if(gTeam[killerid] >= 5 && SafeTime[playerid] <= 0)
{
if(GetPlayerState(killerid) == 1)
{
PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills]+2;
}
else
{
PlayerInfo[killerid][pKills]++;
}
WantedPoints[killerid]+=2;
}
}
}
else if (victimteam == 3)
{
if(IsPlayerConnected(killerid))
{
// Civ kill
if ((gTeam[killerid]) == 2 || PlayerInfo[killerid][pMember] == 7)//cops kill civ
{
if(WantedLevel[playerid] < 1)
{
PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
GivePlayerMoney(killerid, -suecost);
GivePlayerMoney(playerid, suecost+100);//+100pays hospital bill
}
}
else
{
WantedPoints[killerid] += 2;
}
if (((gTeam[killerid]) >= 3 || (gTeam[killerid]) == 1) && reason != 49)
{
SetPlayerCriminal(killerid,255, "Vorsätzlicher Mord");
}
else if (((gTeam[killerid]) >= 3 || (gTeam[killerid]) == 1) && reason == 49)
{
SetPlayerCriminal(killerid,255, "Fahrerflucht");
}
}
}
else if (victimteam == 1)
{
if(IsPlayerConnected(killerid))
{
// Civ kill
if ((gTeam[killerid]) == 2)//cops kill civ
{
PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
GivePlayerMoney(killerid, -suecost);
GivePlayerMoney(playerid, suecost+100);//+100pays hospital bill
}
else if ((gTeam[killerid]) == 1)//med kill civ
{
PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
GivePlayerMoney(killerid, -suecost);
GivePlayerMoney(playerid, suecost+100);//+100pays hospital bill
}
if (((gTeam[killerid]) == 4) && reason != 49)
{
SetPlayerCriminal(killerid,255, "Vorsätzlicher Mord");
}
else if (((gTeam[killerid]) == 3) && reason == 49)
{
SetPlayerCriminal(killerid,255, "Fahrerflucht");
}
}
}
if (victimteam >= 3 && WantedPoints[playerid] > 0 && killerteam == 2)
{
SetPlayerFree(playerid,killerid, "Gekillt");
}
killerid = INVALID_PLAYER_ID;
SetPlayerColor(playerid,COLOR_GRAD2);
if(IsPlayerInFrac(playerid, 4))
{
Medics --;
}
if(IsPlayerInFrac(playerid, 2))
{
Medics --;
}
return 1;
}
Alles anzeigen