RNPC PutPlayerInVehicle How to ?
#1

I try several way to put NPC in car as driver but :

1-st attempt : Npc just stand still.
- Under OnGameModeInit Created NPC
- Under OnGameModeInit Created Vehicle
- Under OnGameModeInit PutInVehicle
pawn Код:
public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    npc = ConnectRNPC("Racer");
    new veh = CreateVehicle(420, 0.0, 0.0, 25.0, 0.0, -1, -1, 0);
    PutPlayerInVehicle(npc, veh, 0);

    RNPC_CreateBuild(npc, PLAYER_RECORDING_TYPE_DRIVER);
    RNPC_SetAcceleration(0.003);
    RNPC_AddMovementAlt(0.0, 0.0, 25.0, 0.0, 500.0, 25.0, 0.15, false);
    RNPC_FinishBuild();

    RNPC_StartBuildPlayback(npc);
    return 1;
}
2-nd attempt: Npc crash from server.
-All this but in command

And right way to put rnpc in car is ?
Reply
#2

I don't think PutPlayerInVehicle is what you use for NPC's...

If your using this (which i recommend) use the function PutRNPCInVehicle(npcid, vehicleid, seatid)
Reply
#3

@jakejohnsonusa:

same as before standing on spawn i can make it to fallow me but not to go in car
any working example of PutRNPCInVehicle ?
Reply
#4

What are you using for RNPC? (Give me a link please)
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=412666 this as you told me
Reply
#6

What version is your plugin?

native PutRNPCInVehicle(npcid, vehicleid, seatid) // not working with 0.2.1 plugin
Reply
#7

Like in his Gamemode script example:

pawn Код:
CMD:putrnpcinvehicle2(playerid, params[])//Command, but you could do it after the NPC connects
{
    new target, veh;
    if(sscanf(params, "ud", target, veh)) return SendClientMessage(playerid, -1, " syntax: /putrnpcinvehicle2 [npcid][veh id]");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You must be in a vehicle");//Make sure they're not in a car already
    PutRNPCInVehicle(target, veh, 1);//HERE IS WHERE IT PUTS THEM IN THE CAR
    return 1;
}
Reply
#8

How to see version of plugin ?
Reply
#9

As long as you have clicked this part:

"Click here to download 1.1 Package (includes, RNPC Plugin 0.3.1, YSI package)"

You have the latest/best working version. (Which is 0.3.1)
Reply
#10

Yes i download 1.1 Package.

And just one question about this code
pawn Код:
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You must be in a vehicle");//Make sure they're not in a car already
is this mean i must be in some car to make RNPC enter to car ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)