Bonsoir,
J'ai un problème avec mes NPC, et mon GM, il spawn dessous la map, vers les coordonnées 0,0,0..
Dans mon OnGameModeInit:
ConnectNPC("Npc_Test","beta1");
Dans mon SetPlayerSpawn:
if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "Npc_Test", true)) //Checking if the NPC's name is MyFirstNPC
{
SetPlayerPos(playerid,1523.3351,-1664.5812,13.5469); // Là j'ai mis ces coordonnées pour savoir si il spawnerais toujours sous la map, aux coordonnées x=0y=0z=0.
return 1;
}
}
Et le PWN associé au .rec:
#define RECORDING "beta1" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 2 //1 for in vehicle and 2 for on foot.
#include <a_npc>
main(){}
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#if RECORDING_TYPE == 2
public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
public OnNPCExitVehicle() StopRecordingPlayback();
#else
public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif
Merci d'avance.