SA-MP Forums Archive
Adding just the names - 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: Adding just the names (/showthread.php?tid=333772)



Adding just the names - HazardGaming - 12.04.2012

Hello,
I want to know how to add bot's to my server.

But I only want a name to show in a player slot?

Thanks.


Re: Adding just the names - ikkentim - 12.04.2012

Npc's don't change the amount of online players, they only decrease the slots-count


Re: Adding just the names - HazardGaming - 12.04.2012

Yes, I know.

Do you have any idea on how to just add the names?


Re: Adding just the names - ikkentim - 12.04.2012

Use ConnectNPC(name[], script[]);
Make an NPC script that basically does nothing and i guess there you go


Re: Adding just the names - HazardGaming - 12.04.2012

And how would I do that?


Re: Adding just the names - ikkentim - 12.04.2012

in the npcscripts folder create a file called empty.pwn
Open it and compile it.
If it gives any errors, just past this in this code:

public OnNPCModeInit()
{
print("NPC script loaded");
return 1;
}

After you compiled that, put this on the end of your gamemode's OnGameModeInit():
ConnectNPC("CoolNpcName", "empty");

I think that should work


Re: Adding just the names - HazardGaming - 12.04.2012

whats with the Empty bit?


Re: Adding just the names - ikkentim - 12.04.2012

Ill tell you some NPC basics:

An NPC basically is an seperate script you are running. Those are the 'npcmodes' folder. In this script you can tell the NPC to do something you have recorded, If you don't tell the NPC to do anything, the don't even spawn.
From my point of view that is what you want.
The file in the 'npcmodes' folder I called 'empty.pwn'

In the 'empty.pwn' in '/npcmodes' folder, paste this:
pawn Код:
public OnNPCModeInit()
{
print("NPC script loaded");
return 1;
}
After you compiled that, put this on the end of your gamemode's OnGameModeInit():
ConnectNPC("CoolNpcName", "empty");


Re: Adding just the names - HazardGaming - 12.04.2012

ahh Thanks man!