NPC is staying "on" policecar? But not "in"? - 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 is staying "on" policecar? But not "in"? (
/showthread.php?tid=119706)
NPC is staying "on" policecar? But not "in"? -
Mechscape - 09.01.2010
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");
Re: NPC is staying "on" policecar? But not "in"? -
Lajko1 - 09.01.2010
u create npc vehicles under OnGameModeInit ?
Re: NPC is staying "on" policecar? But not "in"? -
Jakku - 09.01.2010
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
Re: NPC is staying "on" policecar? But not "in"? -
Mechscape - 09.01.2010
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?
Re: NPC is staying "on" policecar? But not "in"? -
Jakku - 09.01.2010
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
Re: NPC is staying "on" policecar? But not "in"? -
Mechscape - 09.01.2010
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.