SA-MP Forums Archive
Invibisble npc - 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: Invibisble npc (/showthread.php?tid=599243)



Invibisble npc - yvoms - 23.01.2016

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.


Re: Invibisble npc - Arshman - 23.01.2016

You can change the npc's Virtual World

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




Re: Invibisble npc - yvoms - 23.01.2016

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


Re: Invibisble npc - Arshman - 23.01.2016

You can try this

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




Re: Invibisble npc - yvoms - 23.01.2016

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


Re: Invibisble npc - Arshman - 23.01.2016

i think you need to define a_npc


Re: Invibisble npc - yvoms - 23.01.2016

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


Re: Invibisble npc - yvoms - 24.01.2016

bump, i really need assistance with this.


Re: Invibisble npc - yvoms - 25.01.2016

Anyone any idea, i've tried so much


Re: Invibisble npc - Champagne - 25.01.2016

Either delete the bot or try not using "public"