Some questions for npcs
#1

Hi everybody reading my thread, I got 2 questions related with the npcs.
So the first is how can I set a 3D Label to npc ?
Second is can I remove the NPC map icon ? I mean this on‌e =>
Reply
#2

You can attach a 3D Text Label to a npc just as you attach it to a normal player. Also to hide a player marker on radar, use SetPlayerMarkerForPlayer.
Reply
#3

Quote:
Originally Posted by HellSphinX
Посмотреть сообщение
You can attach a 3D Text Label to a npc just as you attach it to a normal player. Also to hide a player marker on radar, use SetPlayerMarkerForPlayer.
Hm about the 3D Label I did it, but I have problem with the marker can you code it ?
Reply
#4

This should work:

pawn Код:
forward HideNPCMarkerForPlayer(npcid, playerid);
public HideNPCMarkerForPlayer(npcid, playerid)
{
    SetPlayerMarkerForPlayer(playerid, npcid, 0xFFFFFF00);
    return 1;
}
And you can do something like this to hide all NPCs for a player when they connect:

pawn Код:
public OnPlayerConnect(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerNPC(i))
        {
            HideNPCMarkerForPlayer(i, playerid);
        }
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by HellSphinX
Посмотреть сообщение
This should work:

pawn Код:
forward HideNPCMarkerForPlayer(npcid, playerid);
public HideNPCMarkerForPlayer(npcid, playerid)
{
    SetPlayerMarkerForPlayer(playerid, npcid, 0xFFFFFF00);
    return 1;
}
And you can do something like this to hide all NPCs for a player when they connect:

pawn Код:
public OnPlayerConnect(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerNPC(i))
        {
            HideNPCMarkerForPlayer(i, playerid);
        }
    }
    return 1;
}
Thank you a lot, I will try this.
Reply
#6

Quote:
Originally Posted by x96664
Посмотреть сообщение
It just hides the marker only for one of the npcs.
You have to add " 00 " at end of color define like " 0xFFFFFF00 ".

" 00 " - Is remove the color from map.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)