SA-MP Forums Archive
SetPlayerMarkerForPlayer won't show on radar - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SetPlayerMarkerForPlayer won't show on radar (/showthread.php?tid=515094)



SetPlayerMarkerForPlayer won't show on radar - seanny - 24.05.2014

I tested these two command in-game and they do set my name colour, but they don't set the blip on the radar.

pawn Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
    if(SituationInProgress[playerid] == 1)
    {
        if((0 < PlayerInfo[playerid][pFaction] < 21) && FactionInfo[PlayerInfo[playerid][pFaction]][fType] == 1)
        {
            SetPlayerMarkerForPlayer(forplayerid, playerid, 0x2641FEFF);
        }
    }
    return 1;
}

CMD:57(playerid, params[])
{
    new szString[165];
    if(FactionInfo[PlayerInfo[playerid][pFaction]][fType] != 1)
    {
        FactionOnly(playerid);
        return 1;
    }
    if(!IsPlayerInAnyVehicle(playerid))
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "* This can only be used inside a vehicle.");
        return 1;
    }
    if(SituationInProgress[playerid] == 0)
    {
        SituationInProgress[playerid] = 1;
        foreach(new i : Player)
        {
            if(PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction])
            {
                SetPlayerMarkerForPlayer(playerid, i, 0x2641FEFF);
            }
        }
        format(szString, sizeof(szString), "%s %s, 10-57, %s, over.", GetFactionRank(playerid), GetName(playerid), GetZone(playerid));
        SendDispatchMessage(szString);
    }
    else
    {
        SituationInProgress[playerid] = 0;
        foreach (new i : Player)
        {
            if(gPlayerLogged[i] == 1)
            {
                SetPlayerMarkerForPlayer(playerid, i, TEAM_HIT_COLOR);
                SetPlayerColour(playerid);
            }
        }
        format(szString, sizeof(szString), "%s %s, 10-99 on last 10-57, over.", GetFactionRank(playerid), GetName(playerid), GetZone(playerid));
        SendDispatchMessage(szString);
    }
    return 1;
}

CMD:panic(playerid, params[])
{
   
    new szString[128];
    if(FactionInfo[PlayerInfo[playerid][pFaction]][fType] != 1)
    {
        FactionOnly(playerid);
        return 1;
    }
    if(RequestingBackup[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_LIGHTRED,"* You have already used your panic button in the last minute.");
        return 1;
    }
    SetTimerEx("PanicReset", 60000, false, "d", playerid);
    RequestingBackup[playerid] = 1;
    foreach(new i : Player)
    {
        if(PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction])
        {
            SetPlayerMarkerForPlayer(playerid, i, 0xFF6347FF);
        }
    }
    SendClientMessage(playerid,COLOR_LIGHTRED,"[Panic]{FFFFFF} You have activated your panic beacon.");
    format(szString, sizeof(szString), "[COMM] %s %s has pressed %s panic button at %s, over.", GetFactionRank(playerid), GetName(playerid), GetZone(playerid));
    return SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_DBLUE, szString);
}

forward PanicReset(playerid);
public PanicReset(playerid)
{
    new str[128];
    foreach (new i : Player)
    {
        if(gPlayerLogged[i] == 1)
        {
            SetPlayerMarkerForPlayer(playerid, i, TEAM_HIT_COLOR);
            SetPlayerColour(playerid);
        }
    }
    SendClientMessage(playerid,COLOR_LIGHTRED,"[Panic]{FFFFFF} Your panic beacon has been reset.");
    RequestingBackup[playerid] = 0;
}



Re: SetPlayerMarkerForPlayer won't show on radar - Bingo - 24.05.2014

You have any colors used under players class like TEAM_COP color is blue etc?


Re: SetPlayerMarkerForPlayer won't show on radar - seanny - 24.05.2014

Cops are mostly white to other players (TEAM_HIT_COLOR) but I'm trying to make cops who called a pursuit (/57) blue and cops who need backup (/panic) red.


Re: SetPlayerMarkerForPlayer won't show on radar - Bingo - 24.05.2014

Uhm, Try SetPlayerColor, That also changes player name color as well as minimap color.


Re: SetPlayerMarkerForPlayer won't show on radar - seanny - 24.05.2014

But then that will show it to non-cops, I want it so that only cops can see cops requesting backup.