NPC HELP
#1

well i read the tut by KC but my problem is everything is fine i recorded it fine but the only thing is my NPC does not go in the vehicle heres my code

on my GM

Код:
new gg; //Global variable!
public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Under Contruction DC");
	ConnectNPC("TokyoKing","gg");
	gg = CreateVehicle(562, -2480.9185,-614.1309,132.5537,261.2576,3,3,3);
on my NPCmodes folder

Код:
#define RECORDING "gg" //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
Reply
#2

ANY HELPPPPPPPPPPPPPP
Reply
#3

make addstaticvehicle not createvehicle

and this you dont need ;
public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
public OnNPCExitVehicle() StopRecordingPlayback();

You need the OnplayerSpawn stuff for npc in the normal gamemode or Filterscript
Reply
#4

Put this in your GameMode
pawn Код:
public OnPlayerConnect(playerid)
{
  new Pname[24];
  if(IsPlayerNPC(playerid))
  {
   GetPlayerName(playerid, Pname, sizeof(Pname));
   if(!strcmp(Pname, "TokyoKing", true)) return PutPlayerInVehicle(playerid, gg, 0); // dunno exactly driver seat but thought it was 0
  }
  return 1;
}
Reply
#5

thxs
Reply
#6

what but i get this error i cant figure it out srry
Код:
error 017: undefined symbol "gg"
Reply
#7

nvm srry i fixed it
Код:
new gg;
XD
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)