22.10.2013, 16:23
Oh crap lol, I forgot to add the SendClientMessageToAll xD
A 2 minute timer will not really effect your server at all, multiple 1 second timers can cause issues though, but this shouldn't be a problem. Another alternative would be to run this every time a player gets a wanted level of 6, meaning you would have to make a custom function for your SetPlayerWantedLevel functions that would also do a check along with it, and then announcing it.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID && killerid != playerid)
{
if(GetPlayerWantedLevel(playerid) >= 6)
{
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
new fstr[150], dname[MAX_PLAYER_NAME], kname[MAX_PLAYER_NAME];
GetPlayerName(playerid, dname, MAX_PLAYER_NAME);
GetPlayerName(killerid, kname, MAX_PLAYER_NAME);
format(fstr, sizeof(fstr), "Player %s(%d) has killed %s(%d) with a wanted level of 6, and has claimed a bonus score!", kname, killerid, dname, playerid);
SendClientMessageToAll(0xFFFF00FF, fstr);
//SetPlayerWantedLevel(playerid, 0);
}
}
return 1;
}