[AJUDA] NPC
#1

Vi as dъvidas dos caras lб no tуpico https://sampforum.blast.hk/showthread.php?tid=109701 mas deu 1 erro...

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 2 //1 para gravaзхes em veнculo e 2 para gravaзхes apй.

#include <a_npc>
main(){}
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);

#if RECORDING_TYPE == 2
#else
  public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("MoS 0.0.1");
    ConnectNPC("Biquini","meunpc");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}
#endif

public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid)) //Verifica se o jogador й um NPC.
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname)); //Obtendo o nome do(s) NPC(s).
    if(!strcmp(npcname, "Biquini", true)) //Checando se o nome do NPC й MeuPrimeiroNPC
    {
    GivePlayerWeapon(playerid, 23, 100);
    }
    return 1;
  }
  //Outras coisas para os jogadores normais vai aqui!
  return 1;
}
Код:
C:\Documents and Settings\Luciano\Desktop\Servidores\Masters of Stunt\filterscripts\Npc.pwn(9) : warning 235: public function lacks forward declaration (symbol "OnRecordingPlaybackEnd")
C:\Documents and Settings\Luciano\Desktop\Servidores\Masters of Stunt\filterscripts\Npc.pwn(9) : error 017: undefined symbol "StartRecordingPlayback"
C:\Documents and Settings\Luciano\Desktop\Servidores\Masters of Stunt\filterscripts\Npc.pwn(43) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Ajuda aк, primeira vez que tento fazer um NPC.
Reply
#2

Topo do GM:
pawn Код:
new StartRecordingPlayback;
Reply
#3

Se fosse new eu jб teria conseguido... coloquei esta bund* e deu nisso

Код:
C:\Documents and Settings\Luciano\Desktop\Servidores\Masters of Stunt\filterscripts\Npc.pwn(12) : warning 235: public function lacks forward declaration (symbol "OnRecordingPlaybackEnd")
C:\Documents and Settings\Luciano\Desktop\Servidores\Masters of Stunt\filterscripts\Npc.pwn(12) : error 012: invalid function call, not a valid address
C:\Documents and Settings\Luciano\Desktop\Servidores\Masters of Stunt\filterscripts\Npc.pwn(48) : warning 203: symbol is never used: "StartRecordingPlayback"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

pawn Код:
forward OnRecordingPlaybackEnd();
#pragma unused StartRecordingPlayback
Reply
#5

Agora deu isso

Код:
error 017: undefined symbol "StartRecordingPlayback"
Reply
#6

tira o pragma e vк se resolve o erro^^
Reply
#7

Tirei o pragma e o mesmo erro persiste.
Reply
#8

pawn Код:
native StartRecordingPlayback(playbacktype,recordname[]);
Reply
#9

Compilou. Sу que agora o NPC nгo aparece no local. Preciso por um SetPlayerPos?

Olhe meu code inteiro:

PHP код:
#include <a_samp>

#pragma tabsize 0
forward OnRecordingPlaybackEnd();
native StartRecordingPlayback(playbacktype,recordname[]);

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

#include <a_npc>
main(){}
public 
OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPERECORDING);

#if RECORDING_TYPE == 2
#else
  
public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPERECORDING);

public 
OnFilterScriptInit()
{
      print(
"MoS 0.0.1");
      
ConnectNPC("Biquini","meunpc");
    return 
1;
}

public 
OnFilterScriptExit()
{
    return 
1;
}
#endif

public OnPlayerSpawn(playerid)
{
  if(
IsPlayerNPC(playerid)) //Verifica se o jogador й um NPC.
  
{
    new 
npcname[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnpcnamesizeof(npcname)); //Obtendo o nome do(s) NPC(s).
    
if(!strcmp(npcname"Biquini"true)) //Checando se o nome do NPC й Biquini
    
{
    
GivePlayerWeapon(playerid23100);
    
SetPlayerSkin(playerid140);
    return 
1;
    }
  }
 return 
0;

Reply
#10

acredito que deva por um setplayerpos, pois se nгo acredito que ele fique na posiзгo inicial do sa-mp.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)