NPC help please.
#1

Hello!

I've built a house, with some strippers in it, it's nice.
But sometimes, One or two of them are just standing still (annoying), and sometimes, all of them dance and it all works fine.
I don't know what's causing this, but i have tried to figure it out for a while now, but i cant fix it!
And there's also a bartender but he's supposed to stand still, and he does.

when they connect...
Код:
public OnFilterScriptInit()
{
	SetTimer("bot1",2000,false);
	return 1;
}
Код:
public bot1(playerid)
{
    ConnectNPC("Bartender","barbot");
    SetTimer("bot2",2000,false);
    return 1;
}
public bot2(playerid)
{
    ConnectNPC("Stripper1","stripbot1");
    SetTimer("bot3",2000,false);
    return 1;
}
public bot3(playerid)
{
    ConnectNPC("Stripper2","stripbot2");
    SetTimer("bot4",2000,false);
    return 1;
}
public bot4(playerid)
{
    ConnectNPC("Stripper3","stripbot3");
    return 1;
}
...And when the bots join..
Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(!IsPlayerNPC(playerid)) return 0; // We only deal with NPC players in this script
    new playername[64];
    GetPlayerName(playerid,playername,64);
     if(!strcmp(playername,"Bartender",true))
    {
        SetPlayerSkin(playerid,188);
        SpawnPlayer(playerid);
        return 1;
    }
    if(!strcmp(playername,"Stripper1",true))
    {
        SetPlayerSkin(playerid,246);
        SpawnPlayer(playerid);
        return 1;
    }
     if(!strcmp(playername,"Stripper2",true))
    {
        SetPlayerSkin(playerid,152);
        SpawnPlayer(playerid);
        return 1;
    }
     if(!strcmp(playername,"Stripper3",true))
    {
        SetPlayerSkin(playerid,256);
        SpawnPlayer(playerid);
        return 1;
    }
    return 1;
}
Reply
#2

OnPlayerSpawn callback? I guess there is the problem.
Reply
#3

what does the timer do? and is the dancing 'recorded' or did you add dancing animations later?
If you added them later then try to initiate the animations under OnPlayerStreamedin
Reply
#4

That timer connects the bots with 2 seconds between every bot.
I recorded their dances.

Can you please tell me how to add animations later? do i record a bot standing still and then add animation?
Reply
#5

I guess it is not possible.
If you have recorded it with the animation, it is strange, that sometimes it is working and sometimes not.
No idea.
Reply
#6

is there any good include file for NPC's?
Reply
#7

What you mean with "include file" ?
Reply
#8

.inc file

With good callbacks & Functions
Reply
#9

For NPC's?
I can't think of a useful include for a NPC, it's just a recorded path.

But you can check out this: https://sampforum.blast.hk/showthread.php?tid=174671
Reply
#10

Seems very good! Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)