Invisible for enemies
#1

Alright, so I have this code which I thought it would work, but apparently it's wrong, so does anyone know how to make your enemies invisible but your teammates visible (in radar) ?

Thanks in advance
Reply
#2

https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer
Quote:

playerid The player that will see the player's changed blip/nametag color
showplayerid The player whose color will be changed
color New color. Set the alpha to 00 for an invisible blip.
Reply
#3

use SetPlayerMarkerForPlayer
pawn Код:
SetPlayerMarkerForPlayer( playerid, showplayerid, 0xFFFFFF00));
Reply
#4

Here https://sampwiki.blast.hk/wiki/Colors_List Second topic
Reply
#5

This is My Command Invibile:
pawn Код:
CMD:invisible(playerid, params[])
{
    if(PlayerInfo[playerid][AdminLevel] >= 4)
    {
        if(strcmp(params,"on",true) == 0)
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                SetPlayerMarkerForPlayer(i, playerid, 0x00000000);
            }
            SendClientMessage(playerid, COLOR_YELLOW, "-XSBot-: You are Invisible");
        }
        else if(strcmp(params,"off",true) == 0)
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                SetPlayerMarkerForPlayer(i, playerid, PlayerInfo[playerid][Color]);
            }
            SendClientMessage(playerid, COLOR_YELLOW, "-XSBot-: You are Visible");
        }
        else return SendClientMessage(playerid, COLOR_YELLOW, "-XSBot-: Correct Usage: /invisible on/off");
    }
    else return SendErrorMessage(playerid, ADMIN_ERROR);
    return 1;
}
Reply
#6

I already know the function SetPlayerMarkerForPlayer, the question is where is the correct callback to use it? and how to make it work for only your enemies.
Reply
#7

Correct place would be OnPlayerSpawn (or when player chooses/changes team). To make it only for enemies, check their teams, and if team ids don't match, hide blip.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)