28.02.2013, 01:02
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(WantedPoints[playerid] >= 1)
{
if(!BOPE(playerid))
{
new price = WantedPoints[playerid] * 100;
if(PlayerInfo[killerid][pMembro] == BOPE || PlayerInfo[killerid][pLider] == BOPE)
{
ConsumingMoney[killerid] = 1;
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, 0xFF6347AA, gstring);
WantedPoints[playerid] = 0;
SetPlayerWantedLevel(playerid, 0);
}
if(BOPE(killerid))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && BOPE(i))
{
if(JaEstaRoubando[playerid] == 1)
{
new Nome[MAX_PLAYER_NAME];
GetPlayerName(killerid, Nome, sizeof(Nome));
if(GetPlayerState(i) == 2)
{
PlayerPlaySound(i, 2134, 0.0, 0.0, 0.0);
}
else
{
PlayerPlaySound(i, 1039, 0.0, 0.0, 0.0);
}
format(gstring, sizeof(gstring), "~w~Suspeito ~r~Morto~n~Bonus~g~R$1000");
GameTextForPlayer(i, gstring, 5000, 1);
format(gstring, sizeof(gstring), "* %s impediu ao roubo da prefeitura.", Nome);
SendFamilyMessage(BOPE, 0x8D8DFF00, gstring);
GivePlayerMoney(i, 1000);
}
else
{
if(GetPlayerState(i) == 2)
{
PlayerPlaySound(i, 2134, 0.0, 0.0, 0.0);
}
else
{
PlayerPlaySound(i, 1039, 0.0, 0.0, 0.0);
}
format(gstring, sizeof(gstring), "~w~Suspeito ~r~Morto~n~Bonus~g~R$500");
GameTextForPlayer(i, gstring, 5000, 1);
GivePlayerMoney(i, 500);
}
}
}
}
}
}