#1

Okay I give up. I'd tried many way to create static NPC but I can't find the worked one.
How can I make a static NPC (Without record, just stand still) and set their position?


EDIT: SetMyPos didn't worked.
Reply
#2

Why not recording NPC for sec how he is standing still and then set it to repeat playback?
Reply
#3

just stand still, record it and then follow the tutorial
Reply
#4

In your gamemode under onplayerspawn you could do

pawn Код:
if(IsPlayerNPC,playerid))
{SetPlayerPos(,playerid,blalblabla (location)}
or use setspawninfo elsewhere
Reply
#5

Quote:
Originally Posted by Markx
Посмотреть сообщение
just stand still, record it and then follow the tutorial
Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
Why not recording NPC for sec how he is standing still and then set it to repeat playback?
I did that, and that's didn't worked.
I did 1 second recording in random place then use SetMyPos but no they aren't TP'ed to the location I given.

Quote:
Originally Posted by boelie
Посмотреть сообщение
In your gamemode under onplayerspawn you could do

pawn Код:
if(IsPlayerNPC,playerid))
{SetPlayerPos(,playerid,blalblabla (location)}
or use setspawninfo elsewhere
I did this too.
SetSpawnInfo didn't worked.
SetPlayerPos still the same.
Reply
#6

i asume they spawn at the spawn point then ?
Reply
#7

They spawn at the place where I record them.
Reply
#8

View this, and you should understand, else nothing nice will result:

https://sampforum.blast.hk/showthread.php?tid=95034
Reply
#9

You dont need any record for that, just connect a npc with the npcidle.pwn (which is basically empty)

pawn Код:
ConnectNPC("IDLER","npcidle");
than just do what the other told you

pawn Код:
new idler; //not needed if you only got one npc
pawn Код:
//OnPlayerConnect
    if(IsPlayerNPC(playerid)) {
        new //or any kind of counter
            name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof name);
        if(strcmp(name, "IDLER", false) == 0) {
            idler = playerid;
        }
    } else {
        //code
    }
    return true;
pawn Код:
//OnPlayerSpawn
    if(IsPlayerNPC(playerid)) {
        if(playerid == idler) {
            SetPlayerPos(playerid, 0.0, 0.0, 2.5);
        }
    } else {
        //code
    }
    return true;
Reply
#10

Quote:
Originally Posted by GangsTa_
Посмотреть сообщение
View this, and you should understand, else nothing nice will result:

https://sampforum.blast.hk/showthread.php?tid=95034
That's my ver very first guide about NPC and didn't helped

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
You dont need any record for that, just connect a npc with the npcidle.pwn (which is basically empty)

pawn Код:
ConnectNPC("IDLER","npcidle");
than just do what the other told you

pawn Код:
new idler; //not needed if you only got one npc
pawn Код:
//OnPlayerConnect
    if(IsPlayerNPC(playerid)) {
        new //or any kind of counter
            name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof name);
        if(strcmp(name, "IDLER", false) == 0) {
            idler = playerid;
        }
    } else {
        //code
    }
    return true;
pawn Код:
//OnPlayerSpawn
    if(IsPlayerNPC(playerid)) {
        if(playerid == idler) {
            SetPlayerPos(playerid, 0.0, 0.0, 2.5);
        }
    } else {
        //code
    }
    return true;
And guess what? This one is works
Thanks
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)