[BUG]a_npc.inc
#1

I can record, but can't make scripts with any NPC's

I got
Код:
#include <a_npc>
Inside my GM, when I use commands like:
Код:
SendCommand("dance");
It says
Код:
error 017: undefined symbol "SendCommand"
I have managed to fix this (via other scripters) via adding
Код:
native SendCommand(cmdtext[]);
Into GM, but when I start, it says
Код:
Runtime error 19: Function or File not found.
PLEASE HELP THX IN ADVANCE!!!
Reply
#2

You cannot use a_npc.inc inside a gamemode. It is used inside NPC scripts ONLY.
The reason why it returns Runtime Error 19 is because that function is not implemented in the samp-server executable, but in the samp-npc executable.
Reply
#3

Thankx that cleares much up!

(same country, I'm from belgium too) so i should make FS and then how I start it with samp-npc.exe?
Reply
#4

The files for the NPC go into the npcmodes directory. There are some files in it which will show you how it's being coded. Here's a list of callbacks that can be used inside a npcmode: https://sampwiki.blast.hk/wiki/Category:NPC

The only two functions that can be used inside a gm/fs are ConnectNPC and IsPlayerNPC.
Reply
#5

Yes I have .rec files in the scriptfiles, and NPC1.pwn/amx inside npcmodes map, But now what should I do?

Make another FS so I can paste
Код:
public OnPlayerSpawn(playerid)
{
	if(IsPlayerNPC(playerid))
	{
	    if(strcmp(NameOf(playerid),"NPC1",false)) SetPlayerSkin(playerid,12);
	    if(strcmp(NameOf(playerid),"NPC2",false)) SetPlayerSkin(playerid,55);
	    if(strcmp(NameOf(playerid),"NPC3",false)) SetPlayerSkin(playerid,226);
	    SendCommand("dance");
	}
}
inthere or at NPC1.pwn (one in npcmodes map) file?

Also: I still get this bug
error 017: undefined symbol "SendCommand"
Reply
#6

I have already noticed that you cannot use #include a_samp and #include a_npc at same time, but how do I setplayerskin then ..?

EDIT: oops sorry for double post
Reply
#7

Maybe you can set NPC's skin in the Spawn informations? Or is there an another function for setting npc's skins?
Reply
#8

Quote:
Originally Posted by r0b
Посмотреть сообщение
Maybe you can set NPC's skin in the Spawn informations? Or is there an another function for setting npc's skins?
Spawn information is included in <a_samp>, which i can't use if I want SendCommand();
Reply
#9

This is weird this makes me feel like no NPC's are possible at anytime
Reply
#10

Use: https://sampwiki.blast.hk/wiki/NPC:OnNPCSpawn in your npcmode. You can use SendCommand in there.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)