SA-MP Forums Archive
[Ajuda] NPC Veнculo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] NPC Veнculo (/showthread.php?tid=630023)



NPC Veнculo - MKVplayer123 - 07.03.2017

Bom, estou fazendo um sistema de NPC no фnibus, enfim...

Eu criei tudo certinho, mais na hora de compilar aparece que deu erro na parte de criar o veнculo.

Quote:

error 017: undefined symbol "MeuPrimeiroNPCVehicle"
error 017: undefined symbol "MeuPrimeiroNPCVehicle"

Bom, aqui estб a linha que eu acho que estб o problema.

Код:
  MeuPrimeiroNPCVehicle = CreateVehicle(431,0.0,0.0,5.0,0.0,3,3,5000);
Mais irei mandar tudo o que eu fiz na GM em relaзгo a esse NPC.

Код:
public OnGameModeInit
    ConnectNPC("MeuPrimeiroNPC","Bus1");
    MeuPrimeiroNPCVehicle = CreateVehicle(431,0.0,0.0,5.0,0.0,3,3,5000);
Код:
public OnPlayerSpawn
	if(IsPlayerNPC(playerid)) return 1;
	{
	  new npcname[MAX_PLAYER_NAME];
	  GetPlayerName(playerid, npcname,sizeof(npcname));
	  if(!strcmp(npcname,"Bus1NPC", true))
	  {
		 PutPlayerInVehicle(playerid, MeuPrimeiroNPCVehicle, 0);
	  }
	  return 1;
	}
Agora todo o sistema do NPC.

Код:
#define RECORDING "Bus1"
#define RECORDING_TYPE 1

#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
Jб gravei o arquivo "Bus1.rec" entгo todo o sistema jб estб aн.


Re: NPC Veнculo - Jelly23 - 07.03.2017

No topo do gamemode:
PHP код:
new MeuPrimeiroNPCVehicle
Como o proprio erro diz, vocк nгo declarou a variavel.