05.05.2013, 17:42
It compiled, gave me no errors at all, but it does nothing aswell. If i kill a civilian with 4+ wanted level, it does none of what i have wrote
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(gTeam{killerid} == CIVILIAN)
{
SetPlayerWantedLevel(killerid,GetPlayerWantedLevel(killerid) + 10);
SendClientMessage(killerid, COLOR_RED, "[Murder Committed] Your wanted level has increased by 10!");
SetPlayerWantedLevel(playerid, 0);
return 1;
}
if(gTeam{playerid} == CIVILIAN && gTeam{killerid} == POLICE || gTeam{killerid} == SWAT || gTeam{killerid} == ARMY)
{
if(GetPlayerWantedLevel(playerid) == 0)
{
SetPlayerScore(killerid, GetPlayerScore(killerid)-1);
SendClientMessage(killerid, COLOR_WHITE, "DONT KILL innocent players! /pc! /rules!");
//GivePlayerCash(killerid, -10000);
//SetPlayerHealth(killerid, 0.0);
return 1;
}
else if(GetPlayerWantedLevel(playerid) <= 3 && GetPlayerWantedLevel(playerid) >= 1)
{
SendClientMessage(killerid, COLOR_WHITE, "DONT KILL innocent suspects! /pc! Ticket them! /tk!");
SetPlayerScore(killerid, GetPlayerScore(killerid)-1);
//SetPlayerHealth(killerid, 0.0);
return 1;
}
else if(GetPlayerWantedLevel(playerid) >= 4)
{
if(gTeam{killerid} == POLICE)
{
new str2[200];
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
format(str2, sizeof(str2), "Suspect %s [%d] has been taken down by Officer %s [%d]",GetName(playerid),playerid,GetName(killerid),killerid);
SendClientMessageToAll(COLOR_RED,str2);
SendClientMessage(killerid, COLOR_BLUE, "You have received $2000 for taking down a Medium Wanted Level criminal!");
GivePlayerMoney(killerid, 2000);
SetPlayerWantedLevel(playerid, 0);
return 1;
}
}
else if(gTeam{killerid} == ARMY)
{
new str2[200];
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
format(str2, sizeof(str2), "S.A Army Member %s [%d] has been taken down %s (%d) by deadly force!",GetName(killerid),killerid,GetName(playerid),playerid);
SendClientMessageToAll(ARMY_COLOUR,str2);
SendClientMessage(killerid, ARMY_COLOUR," Good Job! You have received $5000 for taking down a Medium Wanted Level criminal.");
GivePlayerMoney(killerid, 5000);
SetPlayerWantedLevel(playerid, 0);
return 1;
}
else if(gTeam{killerid} == SWAT)
{
new str2[200];
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
format(str2, sizeof(str2), "SWAT Member %s [%d] has been taken down suspect %s (%d)!",GetName(killerid),killerid,GetName(playerid),playerid);
SendClientMessageToAll(SWAT_COLOUR,str2);
SendClientMessage(killerid, SWAT_COLOUR," Good Job! You have received $2500 for taking down a Medium Wanted Level criminal.");
GivePlayerMoney(killerid, 2500);
SetPlayerWantedLevel(playerid, 0);
return 1;
}
}
else if(GetPlayerWantedLevel(playerid) >= 9)
{
if(gTeam{killerid} == POLICE)
{
new str2[200];
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
format(str2, sizeof(str2), "Suspect %s [%d] has been taken down by Officer %s [%d]",GetName(playerid),playerid,GetName(killerid),killerid);
SendClientMessageToAll(COLOR_RED,str2);
SendClientMessage(killerid, COLOR_BLUE, "You have received $5000 for taking down a High Wanted Level criminal!");
GivePlayerMoney(killerid, 5000);
SetPlayerWantedLevel(playerid, 0);
return 1;
}
else if(gTeam{killerid} == ARMY)
{
new str2[200];
SetPlayerScore(killerid, GetPlayerScore(killerid)+3);
format(str2, sizeof(str2), "S.A Army Member %s [%d] has been taken down %s (%d) by deadly force!",GetName(killerid),killerid,GetName(playerid),playerid);
SendClientMessageToAll(SWAT_COLOUR,str2);
SendClientMessage(killerid, SWAT_COLOUR," Good Job! You have received $10000 for taking down a High Wanted Level criminal.");
GivePlayerMoney(killerid, 10000);
SetPlayerWantedLevel(playerid, 0);
return 1;
}
else if(gTeam{killerid} == SWAT)
{
new str2[200];
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
format(str2, sizeof(str2), "SWAT Member %s [%d] has been taken down suspect %s (%d)!",GetName(killerid),killerid,GetName(playerid),playerid);
SendClientMessageToAll(SWAT_COLOUR,str2);
SendClientMessage(killerid, SWAT_COLOUR," Good Job! You have received $7500 for taking down a High Wanted Level criminal.");
GivePlayerMoney(killerid, 7500);
SetPlayerWantedLevel(playerid, 0);
return 1;
}
}
SendDeathMessage(killerid, playerid, reason);
SetPlayerWantedLevel(playerid, 0); //reset wanted level
return 1;
}