Your code was fine, I just wanted your defines to change the transparency of the color.
(Note, your SetPlayerMarkerForPlayer has the arguments mixed up)
Код:
#define ChangeAlpha(%0,%1) (%0 & 0xFFFFFF00) | %1
forward Timer_HideMarker(playerid, i);
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(gTeam[playerid] == Terroristas && gTeam[i] != Terroristas)
SetPlayerMarkerForPlayer(playerid, i, RojoMarcado);
else if(gTeam[playerid] == Policias && gTeam[i] != Policias)
SetPlayerMarkerForPlayer(playerid, i, AzulMarcado);
else continue;
SetTimerEx("Timer_HideMarker", 2000, false, "ii", playerid, i);
}
}
return 1;
}
public Timer_HideMarker(playerid, i)
{
if (gTeam[playerid] == Terroristas) SetPlayerMarkerForPlayer(playerid, i, ChangeAlpha(RojoMarcado, 0x00));
else if (gTeam[playerid] == Policias) SetPlayerMarkerForPlayer(playerid, i, ChangeAlpha(AzulMarcado, 0x00));
return 1;
}
EDIT: Sorry, I noticed a small bug in my code, fixed it.
NOTE: I also updated ChangeAlpha, I was using the old macro I had, and not the current one I'm normally using.