PutPlayerInVehicle and NPCs?
#1

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?
Reply
#2

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.

EDIT:

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

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

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?
Reply
#5

It disconnects without a trace after a random number of seconds.
Reply
#6

Show us the code .
Reply
#7

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)