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



Train - NathNathii - 04.04.2013

I already posted this in 'Scripting Help' but someone said it doesnt have anything to do with scripting

My NPC Train works fine at my test server.
But when I try to connect it to my server on host, the train also spawns, but the BOT wont connect?

Test server


Server on host



Re: Train - NathNathii - 15.08.2013

This is a pretty old topic, but yeah, I do still have the same problem, could anyone help me..?


Re: Train - NathNathii - 17.08.2013

..Anyone?


Re: Train - Dopefull - 17.08.2013

Open server.cfg and be sure to change "0" to "1" ( This allows 1 NPC to connect to your server, just change the number to how many bots you want.

Do you have
Код:
{
    ConnectNPC("[BOT]Train", "train");
    return 1;
}
in your gamemode?


Re: Train - Kells - 17.08.2013

maybe u made some thing wrong?


Re: Train - NathNathii - 17.08.2013

Quote:
Originally Posted by Dopefull
Посмотреть сообщение
Open server.cfg and be sure to change "0" to "1" ( This allows 1 NPC to connect to your server, just change the number to how many bots you want.

Do you have
Код:
{
    ConnectNPC("[BOT]Train", "train");
    return 1;
}
in your gamemode?
No I don't, where should I put that?


Re: Train - Dopefull - 18.08.2013

Код:
public OnGameModeInit()
{
    ConnectNPC("[BOT]Train", "train");
    return 1;
}
REMEMBER! Change the names of the bots to the ones you have! Else it won't work, the names I wrote is just an example.


Re: Train - JimmyCh - 18.08.2013

You must use ConnectNPC to be able to see your NPC in game.
After looking at the SA-MP Wiki, you can see the following format:
pawn Код:
ConnectNPC(name[], script[])
Now to know what to put on name[] and script[], here's an explanation of each: (SA-MP Wiki's)
Код:
name[]	The name the NPC should connect as. Must follow the same rules as normal player names.
script[]	The NPC script name that is located in the npcmodes folder (without the .amx extension).
So just give your NPC a name on the first parameter, and the script name from npcmodes folder for the second one.

Note: Make sure you place the ConnectNPC under OnGameModeInIt else it will NOT work.