how to make a NPC to just stand? - 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: how to make a NPC to just stand? (
/showthread.php?tid=528030)
how to make a NPC to just stand? -
UserName31 - 25.07.2014
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
Re: how to make a NPC to just stand? -
Crayder - 25.07.2014
SetMyPos and use "npcidle" for the npcmode in ConnectNPC... On my phone so short to the point..
Re: how to make a NPC to just stand? -
Wizzy951 - 25.07.2014
Create a new npcmode (in the npcmodes folder and compile it) for instance lets call it
idlemedic. It should contain:
Now go to your gamemode/fs and add the following things:
pawn Код:
//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.
Re: how to make a NPC to just stand? -
UserName31 - 25.07.2014
Quote:
Originally Posted by Wizzy951
Create a new npcmode (in the npcmodes folder and compile it) for instance lets call it idlemedic. It should contain:
Now go to your gamemode/fs and add the following things:
pawn Код:
//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
Re: how to make a NPC to just stand? -
Crayder - 25.07.2014
It dont show what? That the npc connects? if so change maxnpcs in server.cfg
Re: how to make a NPC to just stand? -
Clad - 25.07.2014
Why don't you use this awsome release ?
https://sampforum.blast.hk/showthread.php?tid=303828
Re: how to make a NPC to just stand? -
UserName31 - 25.07.2014
Quote:
Originally Posted by Clad
|
thats the one i was trying rite now it dont work
Re: how to make a NPC to just stand? -
UserName31 - 25.07.2014
Quote:
Originally Posted by Crayder
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