Invisible Map Icons for NPC's?
#1

Hey,
I can't seem to make my NPC's invisible! It works initially, and by initially I mean when the server restarts and a player is connected, from then on they will be invisible for that player, however if other players connect after the restart (or players that were connected, reconnect), the NPC's will become visible when player's are in range, again.

I set the NPC's colour to 0x00000000 (alpha invisible) in OnPlayerSpawn, and I also use SetPlayerMarkerForPlayer in OnPlayerStreamIn, but to no avail. Can anyone help?

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        drugs_NPCSpawn(playerid);
        police_NPCSpawn(playerid);
        SetPlayerColor(playerid, 0x00000000);
        return 1;
    }
        /*stuff that NPC's dont need*/
        return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    if(IsPlayerNPC(playerid))
    {
        SetPlayerMarkerForPlayer(playerid, forplayerid, 0x00000000);
    }
    return 1;
}
Regards,
Ash
Reply
#2

#e: Nevermind.
Reply
#3

So, as per https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer, it should actually be
pawn Код:
SetPlayerMarkerForPlayer(forplayerid, playerid, 0x00000000);
//arg1: The player that will see the player's changed blip
//arg2: The player whose colour will be changed
//
?

Seems to be working fine now! Thanks ******!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)