20.06.2013, 16:29
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
//if(emguerra[playerid] == 1)
//{
//format(gstring, 128, "%s saiu da zona de guerra!", PlayerName(playerid));
//SendClientMessageToAll(GetPlayerColor(playerid), gstring);
//emguerra[playerid] = 0;
//}*/
//new dmessage[128];
//new deathreason[20];
new Float:px,Float:py,Float:pz;
PlayerInactivity[playerid] = 0;
//DropGrana(playerid);
gPlayerSpawned[playerid] = 0;
PlayerInfo[playerid][pLocal] = 255;
GetPlayerPos(playerid, px, py, pz);
spawnado[playerid] = 0;
if (gPlayerTerminal[playerid] != 0)
{
BusrouteEnd(playerid);
}
if(PlayerPaintballing[killerid] == 0 && IsPlayerInFazenda(playerid) == 0 && IsPlayerInFavela(playerid) == 0 && IsPlayerInSkate(playerid) == 0
&& IsPlayerInEstacao(playerid) == 0 && IsPlayerInCasarao(playerid) == 0 && IsPlayerInArenaX1(playerid) == 0)
{
SetPlayerCriminal(killerid, 255, "Assassinato");
PlayerInfo[killerid][pKills] += 1;
}
if(TendoGuerra == 1 && IsPlayerInTerritorio(playerid) && IsPlayerInTerritorio(killerid))
{
if(PlayerInfo[killerid][pMembro] == 3 || PlayerInfo[killerid][pLider] == 3)
{
if(PlayerInfo[playerid][pMembro] == 6 || PlayerInfo[playerid][pLider] == 6)
{
Territorio[talmortos] += 1;
}
if(PlayerInfo[playerid][pMembro] == 15 || PlayerInfo[playerid][pLider] == 15)
{
Territorio[almortos] += 1;
}
}
if(PlayerInfo[killerid][pMembro] == 6 || PlayerInfo[killerid][pLider] == 6)
{
if(PlayerInfo[playerid][pMembro] == 3 || PlayerInfo[playerid][pLider] == 3)
{
Territorio[exemortos] += 1;
}
if(PlayerInfo[playerid][pMembro] == 15 || PlayerInfo[playerid][pLider] == 15)
{
Territorio[almortos] += 1;
}
}
if(PlayerInfo[killerid][pMembro] == 15 || PlayerInfo[killerid][pLider] == 15)
{
if(PlayerInfo[playerid][pMembro] == 3 || PlayerInfo[playerid][pLider] == 3)
{
Territorio[exemortos] += 1;
}
if(PlayerInfo[playerid][pMembro] == 6 || PlayerInfo[playerid][pLider] == 6)
{
Territorio[talmortos] += 1;
}
}
}
if(InvitedDuel[killerid] == true)
{
new Float: healthkiller;
new namekiller[24],namedeather[24],string[80];
GetPlayerName(killerid, namekiller, 24);
GetPlayerName(playerid, namedeather, 24);
GetPlayerHealth(killerid,healthkiller);
format(string, sizeof(string), "»»[BSL-DUEL]«« : %s Ganhou Duelo de %s com %0.0f de energia (Colete & Vida)", namekiller, namedeather, healthkiller);
SendClientMessageToAll(0x0000BBAA, string);
InvitedDuel[killerid] = true;
InvitedDuel[playerid] = true;
IdDuel[playerid] = playerid;
IdDuel[killerid] = killerid;
//ArenaUsada > 1;
healthkiller = 0;
SpawnPlayer(killerid);
SpawnPlayer(playerid);
}
{
new Fala[70];
format(Fala,sizeof(Fala),"Vocк morreu para %s [ID: %d]",PlayerName(killerid),killerid);
SendClientMessage(playerid,0xA92BAAAA,Fala);
format(Fala,sizeof(Fala),"Vocк matou %s [ID: %d]",PlayerName(playerid),playerid);
SendClientMessage(killerid,0xA92BAAAA,Fala);
}
//==================================[DM]=====================================//
if(playerintdm[playerid] == 1)
{
new tdmPlayerName[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, tdmPlayerName, sizeof(tdmPlayerName));
if(GetPlayerColor(playerid) == 0x0000BBAA)
{
format(string, sizeof(string), "%s foi derrubado fora da equipe do DM, a equipe azul", tdmPlayerName);
blueplayers = blueplayers-1;
}
else
{
format(string, sizeof(string), "%s foi derrubado fora da equipe do DM, a equipe vermelha", tdmPlayerName);
redplayers = redplayers-1;
}
SendClientMessageToAll(0x33AA33AA, string);
playerintdm[playerid] = 0;
playerinminigame[playerid] = 0;
if(tdmrank == 0)
{
tdmplaying = 0;
tdmrank = 0;
tdmon = 0;
KillTimer(tdmtimer);
return 1;
}
if((blueplayers == 0 || redplayers == 0) && tdmplaying == 1)
{
if(blueplayers == 0)
{
format(string, sizeof(string), "Time vermelho ganhou o Evento DM");
} else if(redplayers == 0)
{
format(string, sizeof(string), "Time azul ganhou o Evento DM");
}
SendClientMessageToAll(0x33AA33AA, string);
for(new i=0; i<MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && playerintdm[i] == 1)
{
playerintdm[i] = 0;
playerinminigame[i] = 0;
SetPlayerVirtualWorld(i,0);
SetPlayerInterior(playerid, 0);
SetPlayerColor(i,oldplayercolor[i]);
SetPlayerPos(i, spawnX, spawnY, spawnZ);
}
}
tdmplaying = 0;
tdmrank = 0;
tdmon = 0;
KillTimer(tdmtimer);
return 1;
}
tdmrank--;
}
//==================================[SUSPEITO MORTO]=========================//
if(WantedPoints[playerid] >= 1)
{
//if(gTeam[killerid] == 2 && CrimInRange(30.0, playerid,killerid))
//{
new price = WantedPoints[playerid] * 100;
if(PlayerInfo[killerid][pMembro] == 1 || PlayerInfo[killerid][pLider] == 1)
{
format(gstring, sizeof(gstring), "~w~Suspeito ~r~Morto~n~Bonus~g~R$%d", price);
GameTextForPlayer(killerid, gstring, 5000, 1);
ConsumingMoney[killerid] = 1;
GivePlayerMoney(killerid, price / 2);
PlayerPlaySound(killerid, 1058, 0.0, 0.0, 0.0);
GivePlayerMoney(playerid, - price);
PlayerInfo[playerid][pJailed] = 1;
PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(180);
format(gstring, sizeof(gstring), "* Vocк estб preso por %d Segundos na Policia Militar, e perdeu R$%d por trocar tiros e fugir dos policiais.", PlayerInfo[playerid][pJailTime], price);
SendClientMessage(playerid, COLOR_LIGHTRED, gstring);
WantedPoints[playerid] = 0;
SetPlayerWantedLevel(playerid, 0);
PlayerInfo[playerid][pDrogas] = 0;
PlayerInfo[playerid][pDrogas2] = 0;
PlayerInfo[playerid][pDrogas3] = 0;
PlayerInfo[playerid][pMats] = 0;
}
if(PlayerInfo[killerid][pMembro] == 2 || PlayerInfo[killerid][pLider] == 2)
{
format(gstring, sizeof(gstring), "~w~Suspeito ~r~Morto~n~Bonus~g~R$%d", price);
GameTextForPlayer(killerid, gstring, 5000, 1);
ConsumingMoney[killerid] = 1;
GivePlayerMoney(killerid, price / 2);
PlayerPlaySound(killerid, 1058, 0.0, 0.0, 0.0);
GivePlayerMoney(playerid, - price);
PlayerInfo[playerid][pJailed] = 3;
PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(180);
format(gstring, sizeof(gstring), "* Vocк estб preso por %d Segundos na HQ BOPE, e perdeu R$%d por trocar tiros e fugir dos policiais.", PlayerInfo[playerid][pJailTime], price);
SendClientMessage(playerid, COLOR_LIGHTRED, gstring);
WantedPoints[playerid] = 0;
SetPlayerWantedLevel(playerid, 0);
PlayerInfo[playerid][pDrogas] = 0;
PlayerInfo[playerid][pDrogas2] = 0;
PlayerInfo[playerid][pDrogas3] = 0;
PlayerInfo[playerid][pMats] = 0;
}
if(PlayerInfo[killerid][pMembro] == 3 || PlayerInfo[killerid][pLider] == 3)
{
format(gstring, sizeof(gstring), "~w~Suspeito ~r~Morto~n~Bonus~g~R$%d", price);
GameTextForPlayer(killerid, gstring, 5000, 1);
ConsumingMoney[killerid] = 1;
GivePlayerMoney(killerid, price / 2);
PlayerPlaySound(killerid, 1058, 0.0, 0.0, 0.0);
GivePlayerMoney(playerid, - price);
PlayerInfo[playerid][pJailed] = 7;
PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(180);
format(gstring, sizeof(gstring), "* Vocк estб preso por %d Segundos no Exйrcito, e perdeu R$%d por trocar tiros e fugir dos policiais.", PlayerInfo[playerid][pJailTime], price);
SendClientMessage(playerid, COLOR_LIGHTRED, gstring);
WantedPoints[playerid] = 0;
SetPlayerWantedLevel(playerid, 0);
PlayerInfo[playerid][pDrogas] = 0;
PlayerInfo[playerid][pDrogas2] = 0;
PlayerInfo[playerid][pDrogas3] = 0;
PlayerInfo[playerid][pMats] = 0;
}
if(PlayerInfo[killerid][pMembro] == 16 || PlayerInfo[killerid][pLider] == 16)
{
format(gstring, sizeof(gstring), "~w~Suspeito ~r~Morto~n~Bonus~g~R$%d", price);
GameTextForPlayer(killerid, gstring, 5000, 1);
ConsumingMoney[killerid] = 1;
GivePlayerMoney(killerid, price / 2);
PlayerPlaySound(killerid, 1058, 0.0, 0.0, 0.0);
GivePlayerMoney(playerid, - price);
PlayerInfo[playerid][pJailed] = 4;
PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(180);
format(gstring, sizeof(gstring), "* Vocк estб preso por %d Segundos na Policia Civil, e perdeu R$%d por trocar tiros e fugir dos policiais.", PlayerInfo[playerid][pJailTime], price);
SendClientMessage(playerid, COLOR_LIGHTRED, gstring);
WantedPoints[playerid] = 0;
SetPlayerWantedLevel(playerid, 0);
PlayerInfo[playerid][pDrogas] = 0;
PlayerInfo[playerid][pDrogas2] = 0;
PlayerInfo[playerid][pDrogas3] = 0;
PlayerInfo[playerid][pMats] = 0;
}
if(PlayerInfo[killerid][pMembro] == 11 || PlayerInfo[killerid][pLider] == 11)
{
format(gstring, sizeof(gstring), "~w~Suspeito ~r~Morto~n~Bonus~g~R$%d", price);
GameTextForPlayer(killerid, gstring, 5000, 1);
ConsumingMoney[killerid] = 1;
GivePlayerMoney(killerid, price / 2);
PlayerPlaySound(killerid, 1058, 0.0, 0.0, 0.0);
GivePlayerMoney(playerid, - price);
PlayerInfo[playerid][pJailed] = 5;
PlayerInfo[playerid][pJailTime] = (WantedPoints[playerid])*(180);
format(gstring, sizeof(gstring), "* Vocк estб preso por %d Segundos na Policia Federal, e perdeu R$%d por trocar tiros e fugir dos policiais.", PlayerInfo[playerid][pJailTime], price);
SendClientMessage(playerid, COLOR_LIGHTRED, gstring);
WantedPoints[playerid] = 0;
SetPlayerWantedLevel(playerid, 0);
PlayerInfo[playerid][pDrogas] = 0;
PlayerInfo[playerid][pDrogas2] = 0;
PlayerInfo[playerid][pDrogas3] = 0;
PlayerInfo[playerid][pMats] = 0;
}
//}
}
//=================[NOVO ROUBAR]================
if(ProvocoBanco[playerid] == 1)
{
format(gstring, sizeof(gstring), "%s e os %s nгo conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid) , playerid);
SendClientMessageToAll(GetPlayerColor(playerid), gstring);
ProvocoBanco[playerid] = 0; roubando[playerid] = 0; roubobanco = 0; KillTimer(tempobanco); temporoubobanco = 0;
}
if(ProvocoLot[playerid] == 1)
{
format(gstring, sizeof(gstring), "%s e os %s nгo conseguiram roubar o cofre da Lotйrica! ID:[%d]", PlayerName(playerid), NomeORG(playerid) , playerid);
SendClientMessageToAll(GetPlayerColor(playerid), gstring);
ProvocoLot[playerid] = 0; roubando[playerid] = 0; roubolot = 0; KillTimer(tempolot); temporoubolot = 0;
}
if(ProvocoLoja1[playerid] == 1)
{
format(gstring, sizeof(gstring), "%s e os %s nгo conseguiram roubar o cofre da Loja de Armas 1! ID:[%d]", PlayerName(playerid), NomeORG(playerid) , playerid);
SendClientMessageToAll(GetPlayerColor(playerid), gstring);
ProvocoLoja1[playerid] = 0; roubando[playerid] = 0; rouboloja1 = 0; KillTimer(tempoloja1); temporouboloja1 = 0;
}
if(ProvocoLoja2[playerid] == 1)
{
format(gstring, sizeof(gstring), "%s e os %s nгo conseguiram roubar o cofre da Loja de Armas 2! ID:[%d]", PlayerName(playerid), NomeORG(playerid) , playerid);
SendClientMessageToAll(GetPlayerColor(playerid), gstring);
ProvocoLoja2[playerid] = 0; roubando[playerid] = 0; rouboloja2 = 0; KillTimer(tempoloja2); temporouboloja2 = 0;
}
if(ProvocoPrefe[playerid] == 1)
{
format(gstring, sizeof(gstring), "%s e os %s nгo conseguiram roubar o cofre da Prefeitura! ID:[%d]", PlayerName(playerid), NomeORG(playerid) , playerid);
SendClientMessageToAll(GetPlayerColor(playerid), gstring);
ProvocoPrefe[playerid] = 0; roubando[playerid] = 0; rouboprefe = 0; KillTimer(tempoprefe); temporouboprefe = 0;
}
//=======================[FIM ROUBAR]========================
if(ProvocoFazenda[playerid] == 1)
{
GangZoneStopFlashForAll(GZFazenda);
GangZoneShowForAll(GZFazenda, 0xFFFFFF96);
GuerranaFazenda = 0;
ProvocoFazenda[playerid] = 0;
donofazenda = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraFazenda);
}
if(ProvocoCasarao[playerid] == 1)
{
GangZoneStopFlashForAll(GZCasarao);
GangZoneShowForAll(GZCasarao, 0xFFFFFF96);
GuerranoCasarao = 0;
ProvocoCasarao[playerid] = 0;
donocasarao = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraCasarao);
}
if(ProvocoEstacao[playerid] == 1)
{
GangZoneStopFlashForAll(GZEstacao);
GangZoneShowForAll(GZEstacao, 0xFFFFFF96);
GuerranaEstacao = 0;
ProvocoEstacao[playerid] = 0;
donoestacao = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraEstacao);
}
if(ProvocoFavela[playerid] == 1)
{
GangZoneStopFlashForAll(GZFavela);
GangZoneShowForAll(GZFavela, 0xFFFFFF96);
GuerranaFavela = 0;
ProvocoFavela[playerid] = 0;
donoFavela = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraFavela);
}
if(ProvocoSkate[playerid] == 1)
{
GangZoneStopFlashForAll(GZSkate);
GangZoneShowForAll(GZSkate, 0xFFFFFF96);
GuerranoSkate = 0;
ProvocoSkate[playerid] = 0;
donoskate = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraSkate);
}
if(GetPlayerState(killerid) == 2)
{
new carroDB = GetPlayerVehicleID(killerid);
new nomexd[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(killerid, nomexd, sizeof(nomexd));
if(IsAPlane(carroDB))
{
return 1;
}
format(string, sizeof(string), "[ADM_Boot]: %s [id:%d] Cometeu DB em %s [id:%d], e serб kickado por um ADMIN.", PlayerName(killerid), killerid,PlayerName(playerid));
SendClientMessageToAll(COLOR_LIGHTRED, string);
ABroadCast(COLOR_YELLOW,gstring,1);
printf("%s", gstring);
}
if(reason == 38)
{
new string[128];
if(IsPlayerConnected(killerid))
{
format(string, sizeof(string), "[ADM_Boot]: %s [id:%d] usou minigun em %s [id:%d] e foi kickado e preso por 120 minutos.", PlayerName(killerid), killerid,PlayerName(playerid));
SendClientMessageToAll(COLOR_LIGHTRED, string);
ABroadCast(COLOR_YELLOW,gstring,1);
printf("%s", gstring);
PlayerInfo[killerid][pJailed] = 2;
PlayerInfo[killerid][pJailTime] = 7200;
Kick(killerid);
}
}
if(reason == 35)
{
if(IsPlayerConnected(killerid))
{
format(gstring, 128, "AdmAviso: [%d]%s usou Bazuka em %s.",killerid,PlayerName(killerid),PlayerName(playerid));
ABroadCast(COLOR_YELLOW,gstring,1);
printf("%s", gstring);
}
}
if(reason == 36)
{
if(IsPlayerConnected(killerid))
{
format(gstring, 128, "AdmAviso: [%d]%s usou Bazuka =2= em %s.",killerid,PlayerName(killerid),PlayerName(playerid));
ABroadCast(COLOR_YELLOW,gstring,1);
printf("%s", gstring);
}
}
if(reason == 26)
{
if(IsPlayerConnected(killerid))
{
format(gstring, 128, "AdmAviso: [%d]%s usou 12 Cano cerrado em %s.",killerid,PlayerName(killerid),PlayerName(playerid));
ABroadCast(COLOR_YELLOW,gstring,1);
printf("%s", gstring);
}
}
if(reason == 32)
{
if(IsPlayerConnected(killerid))
{
format(gstring, 128, "AdmAviso: [%d]%s usou TEC9 em %s.",killerid,PlayerName(killerid),PlayerName(playerid));
ABroadCast(COLOR_YELLOW,gstring,1);
printf("%s", gstring);
}
}
if (gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11)
{
DisablePlayerCheckpoint(playerid);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_Nenhum;
}
new caller = Mobile[playerid];
if(caller != 255)
{
if(caller < 255)
{
SendClientMessage(caller, COLOR_GRAD2, "Morreram do outro lado da linha....");
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)
{
PaintballWinner = killerid;
PaintballWinnerKills = PlayerPaintballKills[killerid];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerPaintballing[i] != 0)
{
format(gstring, sizeof(gstring), "* %s estб em 1є com %d Kills.",PlayerName(killerid),PaintballWinnerKills);
SendClientMessage(i, COLOR_WHITE, gstring);
}
}
}
}
}
if(PlayerInfo[playerid][pHeadValue] > 0)
{
if(IsPlayerConnected(killerid))
{
if(gTeam[killerid] == 10 || PlayerInfo[killerid][pLider] == 8 || PlayerInfo[killerid][pMembro] == 8)
{
if(GoChase[killerid] == playerid)
{
new string[128];
ConsumingMoney[killerid] = 1;
GivePlayerMoney(killerid, PlayerInfo[playerid][pHeadValue]);
format(string,128,"Vocк foi morto por contrato por um hitman no valor de R$%d e nгo foi DM!",PlayerName(killerid),PlayerInfo[playerid][pHeadValue]);
//SendClientMessage(playerid, 0x33FF00FF, gstring);
SendClientMessage(playerid, COLOR_YELLOW, gstring);
format(string, sizeof(string),"<< O Hitman Cumpriu o contrato em %s e recebeu R$%d >>",PlayerName(playerid),PlayerInfo[playerid][pHeadValue],sendername);
SendClientMessageToAll(0xFFFF00AA, string);
PlayerInfo[playerid][pHeadValue] = 0;
GotHit[playerid] = 0;
GetChased[playerid] = 999;
GoChase[killerid] = 999;
}
}
}
}
if(PlayerInfo[killerid][pHeadValue] > 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLider] == 8 || PlayerInfo[playerid][pMembro] == 8)
{
if(GoChase[playerid] == killerid)
{
ConsumingMoney[playerid] = 1;
format(gstring,128,"<< Assasino %s foi morto por %s e perdeu o contrato >>",PlayerName(playerid),PlayerName(killerid));
SendFamilyMessage(8, COLOR_YELLOW, gstring);
PlayerInfo[killerid][pHeadValue] = 0;
GotHit[killerid] = 0;
GetChased[killerid] = 999;
GoChase[playerid] = 999;
}
}
}
}
killerid = INVALID_PLAYER_ID;
SetPlayerColor(playerid,COLOR_GRAD2);
return 1;
}

