Invibisble npc
#1

Hey, i've began to put an npc in my gamemode which should be invisible for players, due to ID 0 getting bugged sometimes with ZCMD, so i took the Idlenpc, and placed it ongamemodeinit.
ConnectNPC("John", "npcidle");

Now, the npc spawns imiddiately nd i dont want the npc to spawn since the npc shouldn't be visible to players.
I've tried the following onplayerspawn
if(IsPlayerNPC(playerid))
{
SetPlayerInterior(playerid, 9999);
}

But unfortunately he just spawned in the game again.
Does anyone have an idea on how to fix this lol.
Reply
#2

You can change the npc's Virtual World

PHP код:
if(IsPlayerNPC(playerid))
{
SetPlayerWorld(playerid2);

Reply
#3

Well, that does not work unfortunately,
However when i am ingame and use the command /setworld john 898
It does work, so im a bit mindfeckd
Reply
#4

You can try this

PHP код:
public OnNPCSpawn()
{
    print(
"NPC spawned");
    
SendChat("Hello World. I'm a bot.");
    return 
1;

Reply
#5

Can't use that because YSI does not comply with that callback
Reply
#6

i think you need to define a_npc
Reply
#7

You can't include <a_npc> while working in the gamemode, <a_npc> and <a_samp> will destruct the code.
Reply
#8

bump, i really need assistance with this.
Reply
#9

Anyone any idea, i've tried so much
Reply
#10

Either delete the bot or try not using "public"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)