OnPlayerShot?
#10

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.
Reply


Messages In This Thread
OnPlayerShot? - by karoliko - 24.05.2016, 20:15
Re: OnPlayerShot? - by Stinged - 24.05.2016, 20:19
Re: OnPlayerShot? - by karoliko - 24.05.2016, 20:22
Re: OnPlayerShot? - by Stinged - 24.05.2016, 20:29
Re: OnPlayerShot? - by oMa37 - 24.05.2016, 20:30
Re: OnPlayerShot? - by karoliko - 24.05.2016, 20:38
Re: OnPlayerShot? - by MBilal - 24.05.2016, 20:48
Re: OnPlayerShot? - by Stinged - 24.05.2016, 21:02
Re: OnPlayerShot? - by karoliko - 24.05.2016, 21:12
Re: OnPlayerShot? - by Stinged - 24.05.2016, 21:19

Forum Jump:


Users browsing this thread: 1 Guest(s)