SA-MP Forums Archive
Problem with 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: Problem with NPC (/showthread.php?tid=495644)



Problem with NPC - Angel01 - 18.02.2014

Hello !

I have problem with NPC...

Код:
                else if(!strcmp(npcname,"Molly_Nilson",true))
		{
			NPC[2] = playerid;
			SetPlayerPosEx(NPC[2], 359.7139,173.5689,1008.3893);
			SetPlayerColor(NPC[2],TEAM_HIT_COLOR);
			SetSpawnInfo(NPC[2], 0, 76,0.0,0.0,0.0,0,0,0,0,0,0,0);
			SetPlayerFacingAngle(NPC[2], 266.9489);
			SetPlayerSkin(NPC[2], 76);
			return 1;
		}
Here u can see, i set PlayerPos, Color, Spawn, Skin, but... All 20 bots lose coordinates, color's, skin's...

They spawn beyond the world... Maybe everyone can help me ?

Sorry for my bad English.


Re: Problem with NPC - GamemodeRP123 - 18.02.2014

Try here!
https://sampwiki.blast.hk/wiki/NPC:Main_Page

_____________________________________________
Just press +rep if i helped you


Re: Problem with NPC - Yashas - 18.02.2014

That code is supposed to be at OnPlayerSpawn not on OnPlayerConnect.Where is that code?


Re: Problem with NPC - Raza2013 - 18.02.2014

https://sampwiki.blast.hk/wiki/NPC:Main_Page


Re: Problem with NPC - Angel01 - 18.02.2014

Yashas, public OnPlayerSpawn(playerid)

They are here.


Re: Problem with NPC - Angel01 - 18.02.2014

So, everyone can help ?


Re: Problem with NPC - GamemodeRP123 - 18.02.2014

Код:
public OnNPCConnect(myplayerid)
{
    printf("I successfully connected the server with ID %i!", myplayerid);
}


Re: Problem with NPC - Cvnnor - 18.02.2014

I'd recommend using a filterscript to load the NPC's, and then use the callbacks on this page to provide yourself and fellow administrators with print statements to let you know that they spawned successfully once you've loaded the filterscript.


Re: Problem with NPC - Angel01 - 18.02.2014

I dont want add NPC to Filterscript's, i think would be better if they stay inside GM


Re: Problem with NPC - Angel01 - 20.02.2014

So, everyone can help ?