10.10.2010, 12:13
It is unique script.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerInGroup(killerid))
{
new buffer[32];
GetPVarString(killerid, "Group Name", buffer, sizeof(buffer));
if(buffer[0] != '\0' && buffer[1] != '\0')
{
SetGroupScore(buffer, GetGroupScore(buffer) + 1);
}
}
SendDeathMessage(killerid, playerid, reason);
GivePlayerMoneyEx(killerid, GetPlayerMoneyEx(playerid));
SetPVarInt(killerid, "Kills", GetPVarInt(killerid, "Kills") + 1);
SetPVarInt(playerid, "Deaths", GetPVarInt(playerid, "Deaths") + 1);
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
SavePlayerData(playerid);
SavePlayerData(killerid);
if(IsPlayerConnected(killerid) && killerid != playerid && killerid != -1)
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(GetPVarType(i, "Bounty On") == PLAYER_VARTYPE_INT && GetPVarInt(i, "Bounty On") == playerid)
{
GivePlayerMoneyEx(killerid, GetPVarInt(i, "Bounty Value"));
new string[128], playerName[MAX_PLAYER_NAME], killerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, sizeof(playerName));
GetPlayerName(killerid, killerName, sizeof(killerName));
format(string, sizeof(string), "SERVER: Player %s has killed wanted player %s and got a reward of $%i.", killerName, playerName, GetPVarInt(i, "Bounty Value"));
SendClientMessageToAll(COLOR_RED, string);
DeletePVar(i, "Bounty On");
DeletePVar(i, "Bounty Value");
}
}
}
TextDrawHideForPlayer(playerid, txtTimeDisp);
TextDrawHideForPlayer(playerid, LocationTextdraw[playerid]);
TextDrawHideForPlayer(playerid, WebsiteTextdraw);
TextDrawHideForPlayer(playerid, BoxTextdraw);
if(gPlayerUsingLoopingAnim[playerid])
{
gPlayerUsingLoopingAnim[playerid] = 0;
}
return 1;
}