NPC is staying "on" policecar? But not "in"?
#1



See... NPC should in policecar not on policecar.

There's too 2 NPC staying on two policecar.

What wrong?

OnPlayerSpawn
Код:
    if(!strcmp(npcname, "ppolitsei1", true))
    {
			TogglePlayerControllable(playerid, 0);
			SetPlayerSkin(playerid,280);
  			PutPlayerInVehicle(playerid, Patrull1, 0);
			return 1;
    }
    if(!strcmp(npcname, "ppolitsei2", true))
    {
			TogglePlayerControllable(playerid, 0);
			SetPlayerSkin(playerid,280);
			PutPlayerInVehicle(playerid, Patrull2, 0);
			return 1;
    }
patrullpolitsei1.pwn (npcmodes)
Код:
#define RECORDING "Patrullpolitsei1" //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
patrullpolitsei2.pwn (npcmodes)
Код:
#define RECORDING "Patrullpolitsei2" //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
Код:
	ConnectNPC("ppolitsei1","patrullpolitsei1");
	ConnectNPC("ppolitsei2","patrullpolitsei2");
Reply
#2

u create npc vehicles under OnGameModeInit ?
Reply
#3

Do you have anything which blocks the NPC from entering the vehicle? I had, he couldn't drive some vehicles until I edited the script a little
Reply
#4

Quote:
Originally Posted by Jakku
Do you have anything which blocks the NPC from entering the vehicle? I had, he couldn't drive some vehicles until I edited the script a little
Hmm, this 2 policecar can be drive only police's. ( pMember] == 1 ...) Now that makes problem?
Reply
#5

Quote:
Originally Posted by Picharelo
Quote:
Originally Posted by Jakku
Do you have anything which blocks the NPC from entering the vehicle? I had, he couldn't drive some vehicles until I edited the script a little
Hmm, this 2 policecar can be drive only police's. ( pMember] == 1 ...) Now that makes problem?
Yes. It makes it. Set the NPC as a police and it should work
Reply
#6

Quote:
Originally Posted by Jakku
Quote:
Originally Posted by Picharelo
Quote:
Originally Posted by Jakku
Do you have anything which blocks the NPC from entering the vehicle? I had, he couldn't drive some vehicles until I edited the script a little
Hmm, this 2 policecar can be drive only police's. ( pMember] == 1 ...) Now that makes problem?
Yes. It makes it. Set the NPC as a police and it should work
How? OnPlayerSpawn? to PlayerInfo[playerid][pMember] = 1; in NPC finding?

// Nvm, i got solved. Thanks Jakku.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)