PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
for(new i;i<=MAX_PLAYERS;i++)
{
if(Tdamage[i][playerid]>=20.0)
{
assist[i]++;
GivePlayerXP(playerid,5);
}
}
if(team[playerid] == TEAM_ZOMBIE)
{
switch(GetPlayerWeapon(playerid))
{
case 45:
{
new reasonillegalweapons[128];
new Admin[24] = "Anti-cheat";
format(reasonillegalweapons,sizeof(reasonillegalweapons),"Weapon hack %i",GetPlayerWeapon(playerid));
BanPlayer(playerid,reasonillegalweapons,Admin);
}
case 9:
{
if(GetDistanceBetweenPlayers(playerid,killerid) >= 10.0)
{
printf("%s has been kicked for fake killing - On Player Death", PlayerName(playerid));
//Kick(playerid);
}
}
case 1,2,3,4,5,6,7,8,10,11,12,13,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34:
{
pInfo[playerid][pFakeKills] += 1;
}
}
if(pInfo[playerid][pLadders] >= 5)
{
SendClientMessage(playerid,COLOR_RED,"You have been banned for fake killing");
pInfo[playerid][pBanned] = 1;
new Admin[24] = "Anti-cheat-FakeKills";
new reasonFake[128] = "Fake Killing - On Player Death - FakeKills";
BanPlayer(playerid,reasonFake,Admin);
}
}
if(pInfo[playerid][pDeaths] >= 10000000 && pInfo[playerid][pKills] == 0)
{
new Admin[24] = "Anti-cheat";
new reason3[128] = "Fake Killing - On Player Death";
BanPlayer(playerid,reason3,Admin);
pInfo[killerid][pKills] -= 20;
pInfo[playerid][Killstreak] = 0;
pInfo[killerid][pCoins] -= 4;
switch(Map[XPType])
{
case 1:
{
pInfo[killerid][pXP] -= 300;
}
case 2:
{
pInfo[killerid][pXP] -= 500;
}
case 3:
{
pInfo[killerid][pXP] -= 700;
}
case 4:
{
pInfo[killerid][pXP] -= 900;
}
case 5:
{
pInfo[killerid][pXP] -= 1100;
}
case 6:
{
pInfo[killerid][pXP] -= 1300;
}
case 7:
{
pInfo[killerid][pXP] -= 1500;
}
case 8:
{
pInfo[killerid][pXP] -= 1700;
}
case 9:
{
pInfo[killerid][pXP] -= 1900;
}
case 10:
{
pInfo[killerid][pXP] -= 2100;
}
}
}
if(pInfo[playerid][pLogged] == 1)
{
new string[256],gunname[32];
SendDeathMessage(killerid, playerid, reason);
playersAliveCount--;
pInfo[playerid][pDeaths]++;
pInfo[playerid][Killstreak] = 0;
if(IsBeingSpeced[playerid] == 1)//If the player being spectated, dies, then turn off the spec mode for the spectator.
{
foreach(Player,i)
{
if(spectatorid[i] == playerid)
{
TogglePlayerSpectating(i,false);// This justifies what's above, if it's not off then you'll be either spectating your connect screen, or somewhere in blueberry (I don't know why)
if(team[i] == TEAM_HUMAN)
{
HumanSetup(i);
SpawnPlayer(i);
}
else if(team[i] == TEAM_ZOMBIE)
{
ZombieSetup(i);
SpawnPlayer(i);
}
}
}
}
if(pInfo[playerid][IsPlayerInfected] == 1)
{
ZombieSetup(playerid);
CurePlayer(playerid);
}
if(team[playerid] == TEAM_HUMAN)
{
ZombieSetup(playerid);
}
pInfo[killerid][pKills]++;
pInfo[killerid][Killstreak]++;
pInfo[playerid][pDeaths]++;
pInfo[killerid][pKillsIn1Map]++;
pInfo[playerid][Killstreak] = 0;
switch(Map[XPType])
{
case 1:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,10);
case 1: GivePlayerXP(killerid,20);
}
}
case 2:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,20);
case 1: GivePlayerXP(killerid,30);
}
}
case 3:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,30);
case 1: GivePlayerXP(killerid,40);
}
}
case 4:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,40);
case 1: GivePlayerXP(killerid,50);
}
}
case 5:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,50);
case 1: GivePlayerXP(killerid,60);
}
}
case 6:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,60);
case 1: GivePlayerXP(killerid,70);
}
}
case 7:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,70);
case 1: GivePlayerXP(killerid,80);
}
}
case 8:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,80);
case 1: GivePlayerXP(killerid,90);
}
}
case 9:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,90);
case 1: GivePlayerXP(killerid,100);
}
}
case 10:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,100);
case 1: GivePlayerXP(killerid,110);
}
}
}
if(pInfo[killerid][pVipLevel] >= 1)
{
switch(Map[XPType])
{
case 1:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,15),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+15 X 2 XP",3500,5);
case 1: GivePlayerXP(killerid,25),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+25 X 2 XP",3500,5);
}
}
case 2:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,25),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+25 X 3 XP",3500,5);
case 1: GivePlayerXP(killerid,35),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+35 X 3 XP",3500,5);
}
}
case 3:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,35),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+35 X 3 XP",3500,5);
case 1: GivePlayerXP(killerid,45),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+45 X 3 XP",3500,5);
}
}
case 4:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,45),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+45 X 3 XP",3500,5);
case 1: GivePlayerXP(killerid,55),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+55 X 3 XP",3500,5);
}
}
case 5:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,55),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+55 X 3 XP",3500,5);
case 1: GivePlayerXP(killerid,65),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+65 X 3 XP",3500,5);
}
}
case 6:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,65),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+65 X 3 XP",3500,5);
case 1: GivePlayerXP(killerid,75),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+75 X 3 XP",3500,5);
}
}
case 7:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,75),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+75 X 3 XP",3500,5);
case 1: GivePlayerXP(killerid,85),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+85 X 3 XP",3500,5);
}
}
case 8:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,85),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+85 X 3 XP",3500,5);
case 1: GivePlayerXP(killerid,95),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+95 X 3 XP",3500,5);
}
}
case 9:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,95),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+95 X 3 XP",3500,5);
case 1: GivePlayerXP(killerid,105),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+105 X 3 XP",3500,5);
}
}
case 10:
{
switch(random(2))
{
case 0: GivePlayerXP(killerid,105),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+105 X 3 XP",3500,5);
case 1: GivePlayerXP(killerid,115),GameTextForPlayer(killerid,"~n~~n~~n~~n~~n~~w~+115 X 3 XP",3500,5);
}
}
}
}
if(team[killerid] == TEAM_ZOMBIE)
{
if(reason == 9)
{
ZombieSetup(playerid);
}
}
KillTimer(pInfo[playerid][IsPlayerInfectedTimer]);
GetWeaponName(reason,gunname,sizeof(gunname));
TextDrawShowForPlayer(killerid, TextdrawiKilled[killerid]);
format(string,sizeof(string),"~w~YOU HAVE KILLED~r~ %s~w~ WITH A %s",PlayerName(playerid),gunname);
TextDrawSetString(iKilled[killerid],string);
TextDrawShowForPlayer(killerid, iKilled[killerid]);
SetTimerEx("HideiKilled", 3000, 0, "i", killerid);
if(killerid != INVALID_PLAYER_ID)
{
if(IsPlayerConnected(killerid))
{
TextDrawShowForPlayer(playerid, TextdrawiKilled[playerid]);
format(string,sizeof(string),"~w~YOU HAVE BEEN KILLED BY ~r~ %s~w~ WITH %s",PlayerName(killerid),gunname);
TextDrawSetString(iKilled[playerid],string);
TextDrawShowForPlayer(playerid, iKilled[playerid]);
SetTimerEx("HideiKilled", 3000, 0, "i", playerid);
}
else
{
format(string,sizeof(string),PlayerName(playerid),gunname);
TextDrawSetString(iKilled[killerid], "~w~YOU DIED...");
TextDrawShowForPlayer(playerid, iKilled[playerid]);
SetTimerEx("HideiKilled", 3000, 0, "i", playerid);
}
}
if(killerid != INVALID_PLAYER_ID)
{
if(!PlayerShotPlayer[killerid][playerid])
{
new Admin[24] = "Anti-cheat";
new reason3[128] = "Fake Killing";
BanPlayer(playerid,reason3,Admin);
}
}
foreach(Player,i)
{
PlayerShotPlayer[i][playerid] = 0;
}
new Float:x,Float:y,Float:z;
if(team[playerid] == TEAM_ZOMBIE)
{
GetPlayerPos(playerid,Float:x,Float:y,Float:z);
meatDrops[playerid] = CreatePickup(2804,19,Float:x,Float:y,Float:z,0);
}
if(pInfo[playerid][pZombieClass] == BOOMERZOMBIE)
{
GetPlayerPos(playerid,Float:x,Float:y,Float:z);
CreateExplosion(Float:x,Float:y,Float:z,0,6.0);
foreach(Player,i)
{
GetClosestPlayer(i);
if(IsPlayerConnected(i))
{
switch(GetPlayerSkin(i))
{
case NON_IMMUNE:
{
if(IsPlayerInRangeOfPoint(i,7.0,Float:x,Float:y,Float:z))
{
if(pInfo[i][IsPlayerInfected] == 0)
{
if(pInfo[i][pAdminDuty] == 0)
{
InfectPlayerStandard(i);
}
else if(pInfo[i][pAdminDuty] == 1)
{
SendClientMessage(playerid,COLOR_RED,"That player can't be infected because is on admin duty!");
}
}
}
}
}
}
}
}
}
new kstring[256];
switch(pInfo[killerid][Killstreak])
{
case 5: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 5 killstreak "COL_WHITE"(+50 XP) (1 Coin)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 50,pInfo[killerid][pCoins] += 1;
case 10: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 10 killstreak "COL_WHITE"(+80 XP) (2 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 80,pInfo[killerid][pCoins] += 2;
case 15: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 15 killstreak "COL_WHITE"(+100 XP) (3 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 100,pInfo[killerid][pCoins] += 3;
case 20: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 20 killstreak "COL_WHITE"(+150 XP) (4 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 150,pInfo[killerid][pCoins] += 4;
case 25: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 25 killstreak "COL_WHITE"(+200 XP) (5 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 200,pInfo[killerid][pCoins] += 5;
case 30: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 30 killstreak "COL_WHITE"(+250 XP) (6 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 250,pInfo[killerid][pCoins] += 6;
case 35: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 35 killstreak "COL_WHITE"(+350 XP) (7 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 350,pInfo[killerid][pCoins] += 7;
case 40: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 40 killstreak "COL_WHITE"(+500 XP) (8 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 500,pInfo[killerid][pCoins] += 8;
case 45: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 45 killstreak "COL_WHITE"(+600 XP) (9 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 600,pInfo[killerid][pCoins] += 9;
case 50: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 50 killstreak "COL_WHITE"(+800 XP) (10 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 800,pInfo[killerid][pCoins] += 10;
case 55: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 55 killstreak "COL_WHITE"(+950 XP) (11 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 950,pInfo[killerid][pCoins] += 11;
case 60: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 60 killstreak "COL_WHITE"(+1000 XP) (12 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 1000,pInfo[killerid][pCoins] += 12;
case 65: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 65 killstreak "COL_WHITE"(+1200 XP) (13 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 1200,pInfo[killerid][pCoins] += 13;
case 70: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 70 killstreak "COL_WHITE"(+1500 XP) (14 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 1500,pInfo[killerid][pCoins] += 14;
case 75: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 75 killstreak "COL_WHITE"(+1600 XP) (15 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 1600,pInfo[killerid][pCoins] += 15;
case 80: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 80 killstreak "COL_WHITE"(+1800 XP) (16 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 1800,pInfo[killerid][pCoins] += 16;
case 85: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 85 killstreak "COL_WHITE"(+1900 XP) (17 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 1900,pInfo[killerid][pCoins] += 17;
case 90: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 90 killstreak "COL_WHITE"(+2000 XP) (18 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 2000,pInfo[killerid][pCoins] += 18;
case 95: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 95 killstreak "COL_WHITE"(+5000 XP) (19 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 5000,pInfo[killerid][pCoins] += 19;
case 100: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 100 killstreak "COL_WHITE"(+5500 XP) (20 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 5500,pInfo[killerid][pCoins] += 20;
case 105: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 105 killstreak "COL_WHITE"(+6000 XP) (21 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 6000,pInfo[killerid][pCoins] += 21;
case 110: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 110 killstreak "COL_WHITE"(+6500 XP) (22 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 6500,pInfo[killerid][pCoins] += 22;
case 115: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 115 killstreak "COL_WHITE"(+7000 XP) (23 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 7000,pInfo[killerid][pCoins] += 23;
case 120: format(kstring,sizeof(kstring),""chat""COL_PINK" %s has achieved a 120 killstreak "COL_WHITE"(+7500 XP) (24 Coins)",PlayerName(killerid)), SendClientMessageToAll(-1,kstring), pInfo[killerid][pXP] += 7500,pInfo[killerid][pCoins] += 24;
}
hideTextdrawsAfterConnect(playerid);
CheckToLevelOrRankUp(killerid);
return 1;
}