30.05.2009, 15:50
while i was working on a possible solution, i see that a possible solution has already been given, while i thought differently of what you want compared to what Miokie thought what you want.
Anyways, i'll post what i did:
What i thought you said was when a player dies hsi score gets set to "0". i.e. the score you see when you press the TAB button. A person who kills someone gets +1 score and if his score is 5 or more, his marker will show to other players. When he dies, score gets set to 0 and marker is hidden.
Untested
edit: looks like it works miokies did the job from what ArnoVL says
Anyways, i'll post what i did:
What i thought you said was when a player dies hsi score gets set to "0". i.e. the score you see when you press the TAB button. A person who kills someone gets +1 score and if his score is 5 or more, his marker will show to other players. When he dies, score gets set to 0 and marker is hidden.
Untested
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
SetPlayerScore(killerid,(GetPlayerScore(killerid))+1); //killer gets +1 score
SetPlayerScore(playerid,0); // player who dies get 0 score
UpdateMyMarkerToAll(playerid, killerid);
return 1;
}
UpdateMyMarkerToAll(playerid, killerid)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerScore(playerid) == 0) return SetPlayerMarkerForPlayer( i, playerid, ( GetPlayerColor( killerid ) & 0xFFFFFF00 ) );
if(GetPlayerScore(killerid) >= 5)
{
SetPlayerMarkerForPlayer( i,killerid,0xFF0000FF );
SendClientMessage(playerid,0x99FF00AA,"Your marker is now showing");
}
else
{
SetPlayerMarkerForPlayer( i, killerid, ( GetPlayerColor( killerid ) & 0xFFFFFF00 ) );
SendClientMessage(playerid,0x99FF00AA,"Your marker is now hidden");
}
}
}
}
edit: looks like it works miokies did the job from what ArnoVL says

