I test it from myself. Help mee.
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
pInfo[killerid][Kills] += 1;
pInfo[playerid][Deaths] += 1;
new string[128], gunname[32], fName[MAX_PLAYER_NAME], sName[MAX_PLAYER_NAME];
if(killerid == INVALID_PLAYER_ID)
{
if(suicide[playerid] == false)
{
if(newlife[playerid] == false)
{
if(rapetodeath[playerid] == false)
{
if ((reason == 255) || (killerid == 255))
{
GetPlayerName(playerid,sName,MAX_PLAYER_NAME);
GetPlayerName(playerid,sName,MAX_PLAYER_NAME);
format(string,sizeof(string),"%s [%i] Has Died.",sName,playerid);
SendClientMessageToAll(0xBB0000FF,string);
GivePlayerMoney(playerid,-10000);
}
}
else
{
rapetodeath[playerid] = false;
}
}
else
{
GetPlayerName(playerid,sName,MAX_PLAYER_NAME);
format(string, sizeof(string), "%s [%i] Has used the command /newlife to pick a new skin.",sName,playerid);
SendClientMessageToAll(COLOR_PINK,string);
newlife[playerid] = false;
}
}
else
{
GetPlayerName(playerid,sName,MAX_PLAYER_NAME);
format(string, sizeof(string), "%s [%i] Has used the command /kill to suicide.",sName,playerid);
SendClientMessageToAll(COLOR_PINK,string);
suicide[playerid] = false;
}
}
else
{
if(gTeam[playerid] == TEAM_CIVILIAN && gTeam[killerid] == TEAM_COPS)
{
if(GetPlayerWantedLevel(playerid) == 0)
{
SetPlayerScore(killerid, GetPlayerScore(killerid)-1);
SendClientMessage(killerid,COLOR_RED,"Dont kill innocent people!!");
SendClientMessage(killerid,COLOR_BLUE,"Dont kill innocent people!!");
GivePlayerMoney(killerid, -10000);
SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
unfair[playerid] = true;
}
if(GetPlayerWantedLevel(playerid) <= 3 && GetPlayerWantedLevel(playerid) >= 1)
{
SendClientMessage(killerid,COLOR_RED,"Don't kill innocent suspects, Ticket them!");
SetPlayerScore(killerid, GetPlayerScore(killerid)-1);
GivePlayerMoney(killerid, -5000);
SendClientMessage(killerid,COLOR_BLUE,"Don't kill innocent suspects, Ticket them!");
}
if(GetPlayerWantedLevel(playerid) >= 4 && GetPlayerWantedLevel(playerid) <= 8)
{
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
GetPlayerName(playerid,sName,18);
GetPlayerName(killerid,fName,18);
format(string, sizeof(string), "Suspect %s [%i] has been taken down by officer %s [%i]",sName,playerid,fName,killerid);
SendClientMessageToAll(0x80FF00FF,string);
SendClientMessage(killerid,0xFFCC00FF,"Good job! you have killed a warrant criminal.");
GivePlayerMoney(killerid, 10000);
gojail1[playerid] = true;
}
if(GetPlayerWantedLevel(playerid) >= 9)
{
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
GetPlayerName(playerid,sName,18);
GetPlayerName(killerid,fName,18);
format(string, sizeof(string), "Most wanted %s [%i] has been taken down by officer %s [%i]",sName,playerid,fName,killerid);
SendClientMessageToAll(0x80FF00FF,string);
SendClientMessage(killerid,0xFFCC00FF,"Excellent job! you have killed a most wanted criminal.");
GivePlayerMoney(killerid, 10000);
gojail2[playerid] = true;
}
}
if(gTeam[playerid] == TEAM_CIVILIAN && gTeam[killerid] == TEAM_CIVILIAN || gTeam[playerid] == TEAM_COPS && gTeam[killerid] == TEAM_CIVILIAN)
{
if(rapetodeath[playerid] == true)
{
}
else
{
GetWeaponName(reason,gunname,sizeof(gunname));
GetPlayerName(playerid,sName, MAX_PLAYER_NAME);
GetPlayerName(killerid,fName,MAX_PLAYER_NAME);
format(string,sizeof(string),"%s [%i] Has Been Killed by %s [%i] with %s.",sName,playerid,fName,killerid,gunname);
SendClientMessageToAll(0xBB0000FF,string);
format(string,sizeof(string),"(MURDER) You Have Killed %s [%i]. The cops will be searching for you.",sName,playerid);
SendClientMessage(killerid, COLOR_ORANGE,string);
SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid)+4);
format(string,sizeof(string),"(MUDRDER) %s [%i] Has Been Murdered by %s [%i] with %s",sName,playerid,fName,killerid,gunname);
CopRadio(COLOR_BLUE, string);
GivePlayerMoney(playerid,-10000);
}
}
if(gTeam[playerid] == TEAM_COPS && gTeam[killerid] == TEAM_COPS)
{
SetPlayerScore(killerid, GetPlayerScore(killerid)-1);
SendClientMessage(killerid,0xFF0000FF,"Don't kill your team mates!!");
SendClientMessage(killerid,COLOR_BLUE,"Don't kill your team mates!!");
GivePlayerMoney(killerid,-10000);
unfair[playerid] = true;
}
}
if(gojail1[playerid] == true && GetPlayerWantedLevel(playerid) == 0)
{
gojail1[playerid] = false;
}
if(gojail2[playerid] == true && GetPlayerWantedLevel(playerid) == 0)
{
gojail2[playerid] = false;
}
playerspawned[playerid] = false;
Jailed[playerid] = false;
isafk[playerid] = false;
canrobdrag[playerid] = false;
canrobsand[playerid] = false;
canrobcalg[playerid] = false;
canrobburger[playerid] = false;
canrobstrip[playerid] = false;
canrobcluck[playerid] = false;
canrobammu[playerid] = false;
canrobbinco[playerid] = false;
canrobpizza[playerid] = false;
canrobburger2[playerid] = false;
KillTimer(timer1);
KillTimer(timer2);
SendDeathMessage(killerid,playerid,reason);
SetPlayerScore(playerid, GetPlayerScore(playerid)-1);
return 1;
}