GTAOnline.net

San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: Jaeyth le 08 Juillet 2011, 18:58:47

Titre: Problème NPC..
Posté par: Jaeyth le 08 Juillet 2011, 18:58:47
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.
Titre: Re : Problème NPC..
Posté par: Jaeyth le 11 Juillet 2011, 05:27:25
UP..
Titre: Re : Problème NPC..
Posté par: Ssk le 11 Juillet 2011, 11:46:51
Tu pourrai poster le rec ici s'il te plait ^^
Titre: Re : Problème NPC..
Posté par: Xolokos le 11 Juillet 2011, 15:06:35
#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 OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#else
  public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
  public OnNPCExitVehicle() StopRecordingPlayback();
endif

Ca me parait blizzard l'autre code ? 1 dans une voiture 2 a pied et dans le tien si le type est == a 2 et tu dit que si il rentre dans une voiture tu commence le recording alors qu'il est a pieds ?
Titre: Re : Problème NPC..
Posté par: Ssk le 11 Juillet 2011, 15:45:05
bah non son code est bon, il spawn à pied et dans le .pwn du bot on vois bien que le record type est à 2.
Titre: Re : Problème NPC..
Posté par: Xolokos le 11 Juillet 2011, 17:39:55
Parce que je vois
Citer
//1 for in vehicle and 2 for on foot.
Titre: Re : Problème NPC..
Posté par: Ssk le 11 Juillet 2011, 17:52:28
#define RECORDING_TYPE 2
Titre: Re : Re : Problème NPC..
Posté par: Jaeyth le 11 Juillet 2011, 19:43:41
Tu pourrai poster le rec ici s'il te plait ^^

http://solidfiles.com/d/5f9bc/ (http://solidfiles.com/d/5f9bc/)

tiens. :)
Titre: Re : Problème NPC..
Posté par: Ssk le 11 Juillet 2011, 21:51:54
Le npc est parfait je viens de remarquer qu'il y a une erreur et effectivement Xolokos à raison je n'avais pas remarqué le changement dans son code, prend le sien ^^

Sinon voila le log du NPC
http://pastebin.gtaonline.fr/pastebin.php?show=1132 (http://pastebin.gtaonline.fr/pastebin.php?show=1132)
Titre: Re : Problème NPC..
Posté par: cristab le 11 Juillet 2011, 21:54:19
[hs]lol => health 23.000000 <= c'est bien ce que je pense sa ^^[/hs]
Titre: Re : Problème NPC..
Posté par: Ssk le 11 Juillet 2011, 22:12:26
j'ai pas compris Cristab ^^
Titre: Re : Problème NPC..
Posté par: cristab le 11 Juillet 2011, 22:17:32
c'est la vie du npc apparement mais on ne peu meme pas les tuer ^^
Titre: Re : Problème NPC..
Posté par: Jaeyth le 12 Juillet 2011, 03:09:08
Salut,

Effectivement, le define aurait dû être sur 1, et non 2.

En tout cas le bot est encore sous la map, à la ferme (coordonnées x=0y=0) (quand je /goto 0)

Keyth.
Titre: Re : Re : Problème NPC..
Posté par: Ssk le 12 Juillet 2011, 10:02:20
Salut,

Effectivement, le define aurait dû être sur 1, et non 2.

En tout cas le bot est encore sous la map, à la ferme (coordonnées x=0y=0) (quand je /goto 0)

Keyth.

NON NON le define doit rester à deux, c'est le code au milieu qui n'est pas bon.

Utilise celui ci qui est bon, normalement.



#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 OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#else
  public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
  public OnNPCExitVehicle() StopRecordingPlayback();
endif

Titre: Re : Problème NPC..
Posté par: Xolokos le 12 Juillet 2011, 11:08:32
Je me disais bien qu'il y avais un problème.
Titre: Re : Problème NPC..
Posté par: Jaeyth le 19 Juillet 2011, 12:07:21
Ça ne marche toujours pas.. ^^

Je ne vois pas de quoi ça pourrait venir.