Big Problem with NPC
#1

Hello, i have a problem with my NPC.I want to make a Bus Driver NPC , i record (/vrecord) ingame, i make script for npcmodes and i add in my gamemode car and npc.NPC Join in Server , He's not in car , He's not driving.When i teleport to him , his gone in sky.]


Sorry for my bad english.
Reply
#2

Then you haven't followed the TUT very carefully. Go through the TUT one more time and try to work while reading, keeping track of you have done and what you have to do next.
Reply
#3

I FOLLOW THE TUT !
Reply
#4

Then show me the NPC script you placed in the filterscripts folder or the part of code for the NPC in your GM.
Reply
#5

Код:
#define RECORDING "los" //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
[GM]
Код:
 if(IsPlayerNPC(playerid)) //Verifica daca playerul este NPC
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname)); //Luam numele NPCului
    if(!strcmp(npcname, "LSBus", true)) //Verificam daca numele NPCului este "NUME"
    {
			SetPlayerSkin(playerid,0);
		  PutPlayerInVehicle(0, NPCVehicle, 0); //Punem NPCul in vehicul
    }
    return 1;
  }
Reply
#6

I want to see the part of the code you placed in your GM that is NPC related.
Reply
#7

Код:
if(IsPlayerNPC(playerid)) //Verifica daca playerul este NPC
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname)); //Luam numele NPCului
    if(!strcmp(npcname, "LSBus", true)) //Verificam daca numele NPCului este "NUME"
    {
		  
			SetPlayerSkin(playerid,0);
		  PutPlayerInVehicle(playerid, NPCVehicle, 0); //Punem NPCul in vehicul
    }
    return 1;
  }
This ?
Reply
#8

It would have been much easier if put in a FS but nvm.
The part you showed is from OnPlayerSpawn and there seems to be no problem with that part. Show me the part under OnGameModeInit and OnPlayerRequestClass which is related to your NPC.
Reply
#9

OnPlayerRequestClass :\ i don't have theat.

OnGameModeInit
ConnectNPC("LSBus", "los");
Reply
#10

And you didn't create a vehicle for the NPC?
Код:
NPCVehicle=CreateVehicle(.....................);
Under OnGameModeInit.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)