PDA

View Full Version : Idle NPC.


Laure
04/06/2014, 06:46 AM
Hi, i wanted to make a NPC which stands in a certain place holding a weapon and does no movement, i didnt see any tutorials regarding idle npcs , so if you guys know any Tutorials or if you can suggest me how to do it, i would appreciate that.
Thanks in advance.

]Rafaellos[
04/06/2014, 07:48 AM
Did you try to record it idle for 2-3 seconds? I think it should work, not sure tho.

Laure
04/06/2014, 07:50 AM
Fixed.

amirab
04/06/2014, 07:55 AM
use this in your OnGameModeInit:

ConnectNPC("MyNPC" , "npcidle"); // npcidle means you should have a .pwn file in your npcmodes
// you can find it in samp server files that uploaded in samp site


then use this in OnPlayerConnect:

if(IsPlayerNPC(playerid) return 1;


And use this in OnPlayerRequestClass:

if(IsPlayerNPC(playerid) return SpawnPlayer(playerid);


And Finally use this in OnPlayerSpawn:

new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid , pName , sizeof(pName));

if(!strcmp(playername,"Taxi1",true))
{
SetPlayerPos(playerid , x ,y ,z);
SetPlayerFacingAngle(playerid , angle);
}