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



NPC Help??? - boyzhock12 - 24.03.2012

new AMOUNTOFNPCS;
public OnGameModeInit()
{
new blanknpcamount;
for(new playerid;playerid<GetMaxPlayers()-AMOUNTOFNPCS;playerid++) //Change AMOUNTOFNPCS to be the same of NPCs you plan on connecting
{
ConnectNPC("baovels","baovels");
blanknpcamount++;
}
//ConnectNPCs here
for(new playerid;playerid<blanknpcamount;playerid++)Kick(p layerid);
return 1;
}

How to add a ConnectNPC in the code so it reads two NPC. I tried out but failed when trying to add a Connect like this.
new AMOUNTOFNPCS;
public OnGameModeInit()
{
new blanknpcamount;
for(new playerid;playerid<GetMaxPlayers()-AMOUNTOFNPCS;playerid++) //Change AMOUNTOFNPCS to be the same of NPCs you plan on connecting
{
ConnectNPC("Army","Army");
ConnectNPC("FBI","FBI");
blanknpcamount++;
}
//ConnectNPCs here
for(new playerid;playerid<blanknpcamount;playerid++)Kick(p layerid);
return 1;
}