SA-MP Forums Archive
[Help] NPC Driver - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] NPC Driver (/showthread.php?tid=279454)



[Help] NPC Driver - Lуs - 27.08.2011

Hi guys, I'm Lуs and I need help with my NPC.

it is not placed on the bus that I created with the recording.

It's the script:

pawn Code:
#define RECORDING "rota1" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 1 //1 for in vehicle and 2 for on foot.

#include <a_npc>
main(){}
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);

#if RECORDING_TYPE == 1
  public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
  public OnNPCExitVehicle() StopRecordingPlayback();
#else
  public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif
OnGameModeInit:

pawn Code:
ConnectNPC("Motorista1","buzao1");

    NPCrota1 = AddStaticVehicle(437,1782.98864746,-2025.30139160,13.85988808,180.75000000,-1,-1); //Coach
OnPlayerSpawn:

pawn Code:
if(IsPlayerNPC(playerid))
    {
        if(!strcmp(Nome, "Motorista1", true))
        {
            PutPlayerInVehicle(playerid, NPCrota1, 0);
        }
        return 1;
     }
Please, help me!


Re: [Help] NPC Driver - Davz*|*Criss - 28.08.2011

Change this line:

pawn Code:
NPCrota1 = AddStaticVehicle(437,1782.98864746,-2025.30139160,13.85988808,180.75000000,-1,-1);
To

pawn Code:
NPCrota1 = CreateVehicle(437,1782.98864746,-2025.30139160,13.85988808,180.75000000,-1,-1);



Re: [Help] NPC Driver - [MG]Dimi - 29.08.2011

IF your NPC is only in vehicle you don't need to create new vehicle for him or to put him into the car. It will be done auto.