NPC Recording
#1

Hey guys well I was considering adding a few NPC's into the game but I have a few questions. Now I know they take up a player slot. But is there a way to dedicate a slot to them? For example, I may only connect an NPC for a tutorial and once the tutorial is over, disconnect the NPC until another new player joins. But is there a way to keep that player slot once the NPC has disconnected off to stop the players being 30/30 and no spot for a NPC and it fucks up. :P


To sum it up, can you keep a player slot spare to use for a NPC for connecting a NPC when you need them.
Thanks.
Reply
#2

pawn Код:
public OnPlayerConnect(playerid)
{
    if(playerid == GetMaxPlayers() - 1 && !IsPlayerNPC(playerid))
    {
        SendClientMessage(playerid, COLOR_RED, "We're sorry, this slot is reserved.");
        Kick(playerid);
    }
    return 1;
}
That's as close as you can get.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
pawn Код:
public OnPlayerConnect(playerid)
{
    if(playerid == GetMaxPlayers() - 1 && !IsPlayerNPC(playerid))
    {
        SendClientMessage(playerid, COLOR_RED, "We're sorry, this slot is reserved.");
        Kick(playerid);
    }
    return 1;
}
That's as close as you can get.
Looking at that code it seems to do what I need. Thanks man!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)