SA-MP Forums Archive
Big Problem with NPC - 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: Big Problem with NPC (/showthread.php?tid=155902)



Big Problem with NPC - DavidPaul - 20.06.2010

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.


Re: Big Problem with NPC - DJDhan - 20.06.2010

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.


Re: Big Problem with NPC - DavidPaul - 20.06.2010

I FOLLOW THE TUT !


Re: Big Problem with NPC - DJDhan - 20.06.2010

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


Re: Big Problem with NPC - DavidPaul - 20.06.2010

Код:
#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;
  }



Re: Big Problem with NPC - DJDhan - 20.06.2010

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


Re: Big Problem with NPC - DavidPaul - 20.06.2010

Код:
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 ?


Re: Big Problem with NPC - DJDhan - 20.06.2010

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.


Re: Big Problem with NPC - DavidPaul - 20.06.2010

OnPlayerRequestClass :\ i don't have theat.

OnGameModeInit
ConnectNPC("LSBus", "los");


Re: Big Problem with NPC - DJDhan - 20.06.2010

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