[Ajuda] NPC
#1

Olб, boas pessoal...

Bom criei um Filter Script de NPC, mais estб dando erros,
Erros:


Код:
C:\Users\Cliente\Desktop\BRASIL ULTIMATE WAR EM LOS SANTOS!\npcmodes\meunpc.pwn(8) : warning 235: public function lacks forward declaration (symbol "OnRecordingPlaybackEnd")
C:\Users\Cliente\Desktop\BRASIL ULTIMATE WAR EM LOS SANTOS!\npcmodes\meunpc.pwn(8) : error 017: undefined symbol "StartRecordingPlayback"
C:\Users\Cliente\Desktop\BRASIL ULTIMATE WAR EM LOS SANTOS!\npcmodes\meunpc.pwn(47) : warning 235: public function lacks forward declaration (symbol "OnNPCEnterVehicle")
C:\Users\Cliente\Desktop\BRASIL ULTIMATE WAR EM LOS SANTOS!\npcmodes\meunpc.pwn(49) : error 017: undefined symbol "StartRecordingPlayback"
C:\Users\Cliente\Desktop\BRASIL ULTIMATE WAR EM LOS SANTOS!\npcmodes\meunpc.pwn(51) : warning 235: public function lacks forward declaration (symbol "OnNPCExitVehicle")
C:\Users\Cliente\Desktop\BRASIL ULTIMATE WAR EM LOS SANTOS!\npcmodes\meunpc.pwn(53) : error 017: undefined symbol "StopRecordingPlayback"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Script:

pawn Код:
#include <a_samp>
#include <a_npc>

#define RECORDING "meunpc" //Este й o nome do seu arquivo de gravaзгo, sem a extenзгo(.rec).
#define RECORDING_TYPE 1 //1 para gravaзхes em veнculo e 2 para gravaзхes apй.

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*/


//new MeuPrimeiroNPCVehicle;

public OnFilterScriptInit()
{
/*  print("meu filterscript");
    ConnectNPC("MeuPrimeiroNPC","meunpc");
    MeuPrimeiroNPCVehicle = CreateVehicle(425, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);*/

    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnNPCEnterVehicle(vehicleid, seatid)
{
    StartRecordingPlayback(RECORDING_TYPE, RECORDING);
}
public OnNPCExitVehicle()
{
    StopRecordingPlayback();
}
Help-me !
Reply
#2

Tira a include a_samp
Reply
#3

Quote:
Originally Posted by Supera
Посмотреть сообщение
Tira a include a_samp
Sairam os erros, agora tem 5 warnings.

Код:
C:\Users\Cliente\Desktop\BRASIL ULTIMATE WAR EM LOS SANTOS!\npcmodes\meunpc.pwn(18) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit")
C:\Users\Cliente\Desktop\BRASIL ULTIMATE WAR EM LOS SANTOS!\npcmodes\meunpc.pwn(26) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptExit")
C:\Users\Cliente\Desktop\BRASIL ULTIMATE WAR EM LOS SANTOS!\npcmodes\meunpc.pwn(31) : warning 235: public function lacks forward declaration (symbol "OnPlayerConnect")
C:\Users\Cliente\Desktop\BRASIL ULTIMATE WAR EM LOS SANTOS!\npcmodes\meunpc.pwn(36) : warning 235: public function lacks forward declaration (symbol "OnPlayerDisconnect")
C:\Users\Cliente\Desktop\BRASIL ULTIMATE WAR EM LOS SANTOS!\npcmodes\meunpc.pwn(41) : warning 235: public function lacks forward declaration (symbol "OnPlayerSpawn")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Warnings.
Reply
#4

Remove essas publics : OnFilterScriptInit, OnFilterScriptExit, OnPlayerConnect, OnPlayerDisconnect e OnplayerSpawn
Reply
#5

Quote:
Originally Posted by Supera
Посмотреть сообщение
Remove essas publics : OnFilterScriptInit, OnFilterScriptExit, OnPlayerConnect, OnPlayerDisconnect e OnplayerSpawn
Ok, feito, sairam os Warnings e Erros, mais e agora, como eu faria para o NPC spawnar sem a callback OnPlayerSpawn ?

E como eu faria para ele passar pelo sistema de Login em um outro FS de Admin ?
Reply
#6

da uma lida nesse tutorial.
https://sampforum.blast.hk/showthread.php?tid=109701

para fazer o npc spawnar em um sistema de login, sу usar em OnPlayerConnect
pawn Код:
if(IsPlayerNPC(playerid)) return 1;
Reply
#7

Mais mano eu tava lendo esse tutorial e criando o meu NPC, mais ali tem PutPlayerInVehicle... e outras funзхes, dessa parte pra frente eu nгo sei ..
Reply
#8

UP

Criei o NPC, mais nem da pra ver ele e nada no servidor !

code:

Код:
#include <a_samp>

#define RECORDING "meunpc" //nome do recording no caso o meu eh taxi
#define RECORDING_TYPE 1  // 1 pq eh de carro 2 se for ape


new MeuPrimeiroNPCHunter;

public OnFilterScriptInit()
{
	print("NPc By Vai_Besta");
	// NPCS
	ConnectNPC("MeuPrimeiroNPC","meunpc"); //se voce for botar mais eh so botar ConnectNPC("---","-----"); denovo

	MeuPrimeiroNPCHunter = CreateVehicle(425, 0.0, 0.0, 5.0, 0.0, 6, 6, 5000); // bote o carro ae mesmo nao vai muda nada

	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerRequestClass(playerid,classid)
{
    if(IsPlayerNPC(playerid)) return 1;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
	{
	    new npcname[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, npcname, sizeof(npcname));
	    if(!strcmp(npcname, "MeuPrimeiroNPC", true))  //aqui vc bota o nome do seu npc
		{
			PutPlayerInVehicle(playerid, MeuPrimeiroNPCHunter, 0); //Colocar o NPC dentro do veнculo que criamos para isso.
			return 1;
		}
		return 1;
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)