SA-MP Forums Archive
NPC ON FOOT BOT - 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: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: NPC ON FOOT BOT (/showthread.php?tid=154677)



NPC ON FOOT BOT - xXSurviverXx - 15.06.2010

i have made a ton of bots for vehicles all succesfull but i never tried making a on foot bot so yea i read the tutorial on Creating a new npc it mentions nothing about creating on foot bots and how to put them in server so when i try to connect my bot it just says incomming connection thats it all my other vehicle bots join just not this one heres the code.
yes i have put em all in the right place.

Код:
ConnectNPC("CJ","cjtest");
 if(!strcmp(npcname, "CJ", true))
    {
      // i dont know what to put here.
      return 1;
    }
thanks for all the help i get.


Re: NPC ON FOOT BOT - Nick Deeds - 15.06.2010

I've always done it VERY similar to how I create vehicle bots.


Re: NPC ON FOOT BOT - kross1996 - 21.02.2011

o dont know,i think something like this

SetPlayerPos(playerid,1199.8600, -2056.4299, 239.3500);
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
return 1;
}

if(!strcmp(npcname, "santa", true))
{
PutPlayerInVehicle(playerid, AnotherVehicleID, 0);
return 1;
}
return 1;
}
//Other stuff for normal players goes here!
return 1;
}
public OnFilterScriptInit()
{
print("my filterscript");
ConnectNPC("MyFirstNPC","mynpc");
MyFirstNPCVehicle = CreateVehicle(400, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
return 1;
}