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.