PutPlayerInVehicle and NPCs?

Hi, I'm trying to make a NPC, but I'm having an issue - specifically, PutPlayerInVehicle does nothing.

- On spawn, nothing happens
- Using a command I made to force the NPC into the vehicle, the NPC appears in the middle of the vehicle and shortly disappears
- There are no traces that the NPC actually entered the vehicle, server, client and NPC side
- Works fine for players

What could it be?

You should go through all your loaded scripts and check if player is an NPC, if so return 1 at the top of each function/callback that may remove a player/NPC from the server.


pawn Код:
public OnPlayerConnect(playerid)
    if(IsPlayerNPC(playerid))return 1;
    //rest of code eg, check if registered, kick if no spawn ect ect
    return 1;

My OnPlayerConnect is pretty much empty, just "return 1;".

Not just OnPlayerConnect, any function/callback that may inadvertently kick an NPC.

You should check all of your loaded scripts - gamemodes and filterscripts.

You haven't really given enough information, does the NPC disconnect?

It disconnects without a trace after a random number of seconds.

Show us the code .

You connect the NPC with an invalid recording file or npc script I guess.

Read this tutorial:https://sampforum.blast.hk/showthread.php?tid=95034 It's about putting NPC in the vehicle.

Forum Jump:

Users browsing this thread: 1 Guest(s)