SA-MP Forums Archive
NPC Joins and disconnects? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: NPC Joins and disconnects? (/showthread.php?tid=155552)



NPC Joins and disconnects? - Anthony_Brassi - 19.06.2010

First off, I've already used this tutorial, http://forum.sa-mp.com/index.php?topic=119947.0


Mini FS
pawn Код:
#define RECORDING "ambulance" //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
Blank GM, Doesn't work in my regular GM Either.
pawn Код:
#include <a_samp>
#include <core>
new AmbulanceDrivercar;
main()
{
}
public OnGameModeInit()
{
ConnectNPC ("Soap","ambulance3");
  AmbulanceDrivercar = AddStaticVehicle(416,2016.3534,1257.9493,10.8825,0.0613,1,3); //
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
                if(!strcmp(npcname, "Soap", true)) //Checking if the NPC's name is MyFirstNPC
                 {
             PutPlayerInVehicle(playerid, AmbulanceDrivercar, 0); //Putting the NPC into the vehicle we created for it.
            return 1;
    }
    }
        return 1;
        }



Re: NPC Joins and disconnects? - Kar - 19.06.2010

o sorry


Re: NPC Joins and disconnects? - Anthony_Brassi - 19.06.2010

'Blank GM, Doesn't work in my regular GM Either.'


Re: NPC Joins and disconnects? - AK47317 - 19.06.2010

hmm, maybe this help

pawn Код:
ConnectNPC("Soap", "ambulance");
EDIT: its happen to me too but idk how to fix it :P


Re: NPC Joins and disconnects? - Anthony_Brassi - 19.06.2010

Quote:
Originally Posted by AK47317
hmm, maybe this help

pawn Код:
ConnectNPC("Soap", "ambulance");
EDIT: its happen to me too but idk how to fix it :P
i fixed it, mini FS was #define RECORDING "ambulance"

should have been

#define RECORDING "ambulance3"