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
-
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.
-
UP..
-
Tu pourrai poster le rec ici s'il te plait ^^
-
#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 ?
-
bah non son code est bon, il spawn à pied et dans le .pwn du bot on vois bien que le record type est à 2.
-
Parce que je vois
//1 for in vehicle and 2 for on foot.
-
#define RECORDING_TYPE 2
-
Tu pourrai poster le rec ici s'il te plait ^^
http://solidfiles.com/d/5f9bc/ (http://solidfiles.com/d/5f9bc/)
tiens. :)
-
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)
-
[hs]lol => health 23.000000 <= c'est bien ce que je pense sa ^^[/hs]
-
j'ai pas compris Cristab ^^
-
c'est la vie du npc apparement mais on ne peu meme pas les tuer ^^
-
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.
-
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
-
Je me disais bien qu'il y avais un problème.
-
Ça ne marche toujours pas.. ^^
Je ne vois pas de quoi ça pourrait venir.