Quote:
Originally Posted by BenzoAMG
Oh crap lol, I forgot to add the SendClientMessageToAll xD
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; }
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.
|
Because before I also use this. But different before when a player(killer) when it exactly hits wanted level of 6, it automatically send to server but without any timer.
But for now maybe I can use with timer. As you said 2 minutes will not effect the server. so i'm happy to hear that. Thanks alot. And I ask too much I know you know that
D
EDIT:
Or you know I will use this?
Код:
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);
//SetPlayerWantedLevel(playerid, 0);
}
}
return 1;
}
but I will change
Код:
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);
to
Код:
new pname[MAX_PLAYER_NAME];
GetPlayerName(i, pname, MAX_PLAYER_NAME);
format(fstr, sizeof(fstr), "Player %s(%d) has a wanted level of 6. Kill them to get a bonus score!", pname, i);
SendClientMessageToAll(0xFFFF00FF, fstr);
is it okay?