Moving Camera from Point A to Point B
#1

Hey!

Basically I have been searching for one hour "how to move a camera(like, flying with just a camera, but from specific points) from Point A(x,y,z) to Point B(x,y,z), on the Connect (where you login,register) screen"

(Yes the NPC is connected, NPC name: onconnectfly)
pawn Код:
public OnPlayerConnect(playerid)
{
    new stringid[44];
    format(stringid, sizeof(stringid), "onconnectfly");
    TogglePlayerSpectating(playerid, 1);
    PlayerSpectatePlayer(playerid, stringid);
    return 1;
}
My idea: Having a NPC path, that you spectate but you put yourself in another virtual world so you can't see the NPC, so you just fly around on a specific path.

The problem: I can't get it to work, it gives me an error : error 035: argument type mismatch (argument 2) (on the line of PlayerSpectatePlayer)

Any help

EDIT: Of course if there is any other way to do what I want, it would be veeeery appreciated. Because the NPC going through my login system is bugging me haha
Reply
#2

It's
pawn Код:
PlayerSpectatePlayer(playerid, /*NPC ID HERE*/);
Reply
#3

Yeah but how do you get the NPC ID
Reply
#4

Well, go in game and do a /goto ID ... and search for your NPC ID...
Reply
#5

Well whenever you create the NPC, make him the first thing that spawns, so it's always ID 0.
Reply
#6

If you have only 1 NPC, yes but what about if you have more ?

I have 14 NPC's in my gamemode now so whenever I join my server, my ID is 15.
Reply
#7

Two ways i can think off hand (i havent realy worked with npcs before).
pawn Код:
#define MAX_BOTS        (15)
new BotIDS[MAX_BOTS] = {INVALID_PLAYER_ID, ...};//array to store npc ids

public OnPlayerConnect(playerid)
{
    static
        BotCount;
    if(IsPlayerNPC(playerid))
    {
        BotIDS[BotCount] = playerid;
        BotCount++;
    }
    return 1;
}
EDIT: The other way was very poor.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)