22.03.2016, 13:03
Hi!
I wrote a code for you which you can use. But: You have to optimize it (e.g. the query => IsPlayerCop) and so on.
I wrote a code for you which you can use. But: You have to optimize it (e.g. the query => IsPlayerCop) and so on.
PHP код:
//OnPlayerDeath:
public OnPlayerDeath(playerid,killerid,reason)
{
if(killerid != INVALID_PLAYER_ID && IsPlayerCop(killerid) && GetPlayerWantedLevel(playerid) > 0)
{
SetPlayerWantedLevel(playerid,0);
for(new i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i) || IsPlayerNPC(i))continue;
if(IsPlayerCop(i))
{
SetPlayerMarkerForPlayer(i,playerid,-1);//White color
}
}
}
return 1;
}
//When the player will get the wanteds:
for(new i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i) || IsPlayerNPC(i))continue;
if(IsPlayerCop(i))
{
SetPlayerMarkerForPlayer(i,playerid,0xFF0019FF);//Red color
}
}