PDA

View Full Version : how to make a NPC to just stand?


UserName31
25/07/2014, 08:43 PM
how can i make a NPC TO STAND and dont move ?

example i am making a medic npc to stand outside of hospital with checkpoint infront of him

Crayder
25/07/2014, 09:11 PM
SetMyPos and use "npcidle" for the npcmode in ConnectNPC... On my phone so short to the point..

Wizzy951
25/07/2014, 09:14 PM
Create a new npcmode (in the npcmodes folder and compile it) for instance lets call it idlemedic. It should contain:

#include <a_npc>
main(){}

Now go to your gamemode/fs and add the following things:

//under ongamemode/filterscriptinit
ConnectNPC("Medic[BOT]","idlemedic");//Medic[BOT] stands for his name and idlemedic for the script name

//under onplayerspawn
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "Medic[BOT]", true))
{
//Here you set his position, interior and whatever you want
}
return 1;
}

//here continues your code in the onplayerspawn callback


P.S: It's not tested so if you encounter some issues you can pm me.

UserName31
25/07/2014, 09:34 PM
Create a new npcmode (in the npcmodes folder and compile it) for instance lets call it idlemedic. It should contain:

#include <a_npc>
main(){}

Now go to your gamemode/fs and add the following things:

//under ongamemode/filterscriptinit
ConnectNPC("Medic[BOT]","idlemedic");//Medic[BOT] stands for his name and idlemedic for the script name

//under onplayerspawn
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "Medic[BOT]", true))
{
//Here you set his position, interior and whatever you want
}
return 1;
}

//here continues your code in the onplayerspawn callback


P.S: It's not tested so if you encounter some issues you can pm me.

it dont show

Crayder
25/07/2014, 09:47 PM
It dont show what? That the npc connects? if so change maxnpcs in server.cfg

Clad
25/07/2014, 09:50 PM
Why don't you use this awsome release ?
http://forum.sa-mp.com/showthread.php?t=303828

UserName31
25/07/2014, 10:06 PM
Why don't you use this awsome release ?
http://forum.sa-mp.com/showthread.php?t=303828

thats the one i was trying rite now it dont work

UserName31
25/07/2014, 10:12 PM
It dont show what? That the npc connects? if so change maxnpcs in server.cfg

i did exacly how u told me but it wont show at all even changed the npcmax to 50