SA-MP Forums Archive
[Tutorial] Creating a new 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)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] Creating a new NPC (/showthread.php?tid=95034)

Pages: 1 2 3 4 5 6 7 8


Re: Creating a new NPC - Beastlynoob - 30.05.2011

Why am i getting


C:\Users\*****\Desktop\sailor2.pwn(13) : error 017: undefined symbol "MyFirstNPCVehicle"
C:\Users\*****\Desktop\sailor2.pwn(73) : error 017: undefined symbol "MyFirstNPCVehicle"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.



Re: Creating a new NPC - buster_ - 30.05.2011

hey, nice tut, but i got so much errors my compiler crashed


Re: Creating a new NPC - Robert_Crawford - 03.06.2011

Quote:
Originally Posted by buster_
Посмотреть сообщение
hey, nice tut, but i got so much errors my compiler crashed
Your missing brackets somewhere


Re: Creating a new NPC - abubaker98 - 06.06.2011

i have one quistion how to set the npc car id and the npc skin id answer faster


Re: Creating a new NPC - Gagi_Corleone - 07.06.2011

What is the problem?
Код:
[16:53:29] Incoming connection: 127.0.0.1:59481
[16:53:29] [npc:join] Pilot has joined the server (1:127.0.0.1)
[16:53:29] [npc:part] Pilot has left the server (1:2)
[16:53:29] Incoming connection: 127.0.0.1:59480
[16:53:29] [npc:join] NRG has joined the server (0:127.0.0.1)
[16:53:29] [npc:part] NRG has left the server (0:2)
I put in server.cfg maxnpc to 2 but it dosen't work


Re: Creating a new NPC - L84S - 25.06.2011

Quote:
Originally Posted by Gagi_Corleone
Посмотреть сообщение
What is the problem?
Код:
[16:53:29] Incoming connection: 127.0.0.1:59481
[16:53:29] [npc:join] Pilot has joined the server (1:127.0.0.1)
[16:53:29] [npc:part] Pilot has left the server (1:2)
[16:53:29] Incoming connection: 127.0.0.1:59480
[16:53:29] [npc:join] NRG has joined the server (0:127.0.0.1)
[16:53:29] [npc:part] NRG has left the server (0:2)
I put in server.cfg maxnpc to 2 but it dosen't work
You have antichit ?
and he throw your bot on the game.Read first post for it


Re: Creating a new NPC - Setkus - 15.08.2011

Could anyone help me? I recorded my npc, add mini script and did everythink like it says in the tutorial. But my npc only says incoming connection, and he didnt join. My server isnt passworted. So what i do wrong?


Re: Creating a new NPC - Setkus - 15.08.2011

Please, help me!


Re: Creating a new NPC - sansko - 15.08.2011

you need to change the maxnpc count in server.cfg


Re: Creating a new NPC - Setkus - 15.08.2011

Thanks, bro!


AW: Creating a new NPC - FaiSokumati - 16.08.2011

I use the SA-MP 0.3c R2 Windows Server. But i canґt use the Commands.
Here the Video
[ame]http://www.youtube.com/watch?v=lLRp_gk3te8[/ame]

Pls Help me


Re: Creating a new NPC - jat1801 - 17.08.2011

Help please I have two npc's but only one joins and goes into their vehicle.
This is the code
Code:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
	{
		if(strcmp(PlayerName(playerid), "[BOT]Dave") == 0)
		{
		    PutPlayerInVehicle(playerid,NPCBike,0);
		    SetPlayerColor(playerid,COLOR_DARKOLIVEGREEN);
		    SetPlayerSkin(playerid,50);
		    IsSpawned[playerid] =1;
		    print("[NPC SPAWN] Dave as been added.");
		}
		return 1;
	}
    if(IsPlayerNPC(playerid))
	{
		if(strcmp(PlayerName(playerid), "[BOT]Billy") == 0)
		{
		    PutPlayerInVehicle(playerid,NPCTram,0);
		    SetPlayerColor(playerid,COLOR_DARKOLIVEGREEN);
		    SetPlayerSkin(playerid,255);
		    IsSpawned[playerid] =1;
		    print("[NPC SPAWN] Billy has been placed in his tram.");
		}
		return 1;
	}
Please help me.


Re: Creating a new NPC - Setkus - 17.08.2011

Hey
I have a problem with NPC. Well, i made my file with name soldier and i connect my npc, he's connecting everything okey, but he is standing in spawn point. Is this possible that my file is too big? Help me please


Re: Creating a new NPC - Setkus - 17.08.2011

Someone, please help me!


Re: Creating a new NPC - Macros50 - 23.08.2011

Nice tutorial. Any question: How i can set the skin of my bot? I have 8 bot and all 8 in vehicle and all are with skin of CJ xD. How i can set another skin in these bots? Thanks!


Re: Creating a new NPC - System64 - 23.08.2011

SetPlayerSkin....


Re: Creating a new NPC - Macros50 - 24.08.2011

Thanks System64


Re: Creating a new NPC - sherlock - 30.08.2011

Quote:
Originally Posted by Macros50
View Post
Thanks System64
or you can change your skin and the npc will be with that skin (it is on my server anyway)

ex:if i am cj when i record the npc will be cj


Re: Creating a new NPC - bomm89 - 04.09.2011

Guys, if you follow the tutorial, the NPC will work, it works on my server...


Re: Creating a new NPC - whitedragon - 04.09.2011

Quote:
Originally Posted by jat1801
View Post
Help please I have two npc's but only one joins and goes into their vehicle.
This is the code
Code:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
	{
		if(strcmp(PlayerName(playerid), "[BOT]Dave") == 0)
		{
		    PutPlayerInVehicle(playerid,NPCBike,0);
		    SetPlayerColor(playerid,COLOR_DARKOLIVEGREEN);
		    SetPlayerSkin(playerid,50);
		    IsSpawned[playerid] =1;
		    print("[NPC SPAWN] Dave as been added.");
		}
		return 1;
	}
    if(IsPlayerNPC(playerid))
	{
		if(strcmp(PlayerName(playerid), "[BOT]Billy") == 0)
		{
		    PutPlayerInVehicle(playerid,NPCTram,0);
		    SetPlayerColor(playerid,COLOR_DARKOLIVEGREEN);
		    SetPlayerSkin(playerid,255);
		    IsSpawned[playerid] =1;
		    print("[NPC SPAWN] Billy has been placed in his tram.");
		}
		return 1;
	}
Please help me.
Try
pawn Code:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        if(strcmp(PlayerName(playerid), "[BOT]Dave") == 0)
        {
            PutPlayerInVehicle(playerid,NPCBike,0);
            SetPlayerColor(playerid,COLOR_DARKOLIVEGREEN);
            SetPlayerSkin(playerid,50);
            IsSpawned[playerid] =1;
            print("[NPC SPAWN] Dave as been added.");
                    return 1;
        }
        if(strcmp(PlayerName(playerid), "[BOT]Billy") == 0)
        {
            PutPlayerInVehicle(playerid,NPCTram,0);
            SetPlayerColor(playerid,COLOR_DARKOLIVEGREEN);
            SetPlayerSkin(playerid,255);
            IsSpawned[playerid] =1;
            print("[NPC SPAWN] Billy has been placed in his tram.");
                    return 1;
        }
                return 1;
    }