Posts: 624
Threads: 110
Joined: Apr 2012
Reputation:
0
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.
Posts: 731
Threads: 29
Joined: Feb 2012
Reputation:
0
Did you try to record it idle for 2-3 seconds? I think it should work, not sure tho.
Posts: 498
Threads: 24
Joined: Apr 2013
use this in your OnGameModeInit:
PHP код:
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:
PHP код:
if(IsPlayerNPC(playerid) return 1;
And use this in OnPlayerRequestClass:
PHP код:
if(IsPlayerNPC(playerid) return SpawnPlayer(playerid);
And Finally use this in OnPlayerSpawn:
PHP код:
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid , pName , sizeof(pName));
if(!strcmp(playername,"Taxi1",true))
{
SetPlayerPos(playerid , x ,y ,z);
SetPlayerFacingAngle(playerid , angle);
}