23.01.2011, 14:04
how to abuse it?
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid == INVALID_PLAYER_ID)
{
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
} else {
if(gTeam[killerid] != gTeam[playerid])
{
// Valid kill
SendDeathMessage(killerid,playerid,reason);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
GivePlayerMoney(killerid, 1000);
}
else
{
//Team Killer!
new warning[256];
format(warning, sizeof(warning), "Be careful! You have been punished for teamkilling.");
SendClientMessage(killerid, 0xFFFF00AA, warning);
SendDeathMessage(killerid,playerid,reason);
GivePlayerMoney(killerid, -1000);
SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
}
}
return 1;
}