CRIANDO NPC
#1

estou aprendendo a cria npc li o tutorial que tem aki e fiz esse pawno



PHP код:
#include <a_samp>
#include <a_npc>
public OnGameModeInit()
{
    
// Don't use these lines if it's a filterscript
    
SetGameModeText("aviao");
    
AddPlayerClass(0,1989.14086914,-2593.35913086,12.54687500269.1425000000);
    return 
1;
}
new 
aviaonpc;
public 
OnFilterScriptInit()
{
  print(
"aviao");
  
ConnectNPC("aviao","aviao");
  
aviaonpc CreateVehicle(592, -69.6176,2505.2476,17.20850.000,500);
  return 
1;
}
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"aviao"true)) //Checando se o nome do NPC й MeuPrimeiroNPC
    
{
      
PutPlayerInVehicle(playeridaviaonpc0); //Colocar o NPC dentro do veнculo que criamos para isso.
    
}
  return 
1;

mais quando copilo da esses erros
PHP код:
C:\Documents and Settings\Antonio\Desktop\Cуpia de samp host\gamemodes\aviao.pwn(34) : warning 217loose indentation
C
:\Documents and Settings\Antonio\Desktop\Cуpia de samp host\gamemodes\aviao.pwn(36) : error 030compound statement not closed at the end of file (started at line 26)
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
1 Error

aki tb o pawno na pasta npcmodes
PHP код:
#define RECORDING "aviao" //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й.
#include <a_npc>
main(){}
public 
OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPERECORDING);
#if RECORDING_TYPE == 1
  
public OnNPCEnterVehicle(vehicleidseatidStartRecordingPlayback(RECORDING_TYPERECORDING);
  public 
OnNPCExitVehicle() StopRecordingPlayback();
#else
  
public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPERECORDING);
#endif 
nome do gm : aviao, nome do .rec: aviao e nome do pwn na pasta npcmodes:aviao
Reply
#2

Amigo vc esta usando um fs? ou esta botando no gm? por que ali em seu script esta os 2 juntos
Reply
#3

estou usando em um gm
Reply
#4

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

new aviaonpc;

public OnGameModeInit()
{
    print("aviao connectado");
    ConnectNPC("aviao","aviao");
    aviaonpc = CreateVehicle(592, -69.6176,2505.2476,17.2085, 0.0, 0, 0,500);
    return 1;
}

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, "aviao", true)) //Checando se o nome do NPC й MeuPrimeiroNPC
    {
      PutPlayerInVehicle(playerid, aviaonpc, 0); //Colocar o NPC dentro do veнculo que criamos para isso.
    }
  return 1;
}
Reply
#5

ajeitei e ficou assim

PHP код:
#include <a_samp>
#include <a_npc>
new aviaonpc;
public 
OnGameModeInit()
{
    
// Don't use these lines if it's a filterscript
    
SetGameModeText("aviao");
    
AddPlayerClass(0,1989.14086914,-2593.35913086,12.54687500269.1425000000);
    print(
"aviao connectado");
    
ConnectNPC("aviao","aviao");
    
aviaonpc CreateVehicle(592, -69.6176,2505.2476,17.20850.000,500);
    return 
1;
}
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"aviao"true)) //Checando se o nome do NPC й MeuPrimeiroNPC
    
{
      
PutPlayerInVehicle(playeridaviaonpc0); //Colocar o NPC dentro do veнculo que criamos para isso.
    
}
  return 
1;

mais deu esse erro

PHP код:
C:\Documents and Settings\Antonio\Desktop\Cуpia de samp host\gamemodes\aviao.pwn(29) : warning 217loose indentation
C
:\Documents and Settings\Antonio\Desktop\Cуpia de samp host\gamemodes\aviao.pwn(31) : error 030compound statement not closed at the end of file (started at line 21)
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
1 Error

Reply
#6

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

new aviaonpc;

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("aviao");
    AddPlayerClass(0,1989.14086914,-2593.35913086,12.54687500, 269.1425, 0, 0, 0, 0, 0, 0);
    print("aviao connectado");
    ConnectNPC("aviao","aviao");
    aviaonpc = CreateVehicle(592, -69.6176,2505.2476,17.2085, 0.0, 0, 0,500);
    return 1;
}

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, "aviao", true)) //Checando se o nome do NPC й MeuPrimeiroNPC
        {
            PutPlayerInVehicle(playerid, aviaonpc, 0); //Colocar o NPC dentro do veнculo que criamos para isso.
        }
    }
    return 1;
}
tente.
Reply
#7

pegou
Reply
#8

error 030: compound statement not closed at the end of file (started at line 21) = vocк abriu uma chave e esqueзeu de fechalб, jб existe tutorial pra NPC? eu ia fazer um :/
Reply
#9

Quote:
Originally Posted by Willian_Luigi
Посмотреть сообщение
error 030: compound statement not closed at the end of file (started at line 21) = vocк abriu uma chave e esqueзeu de fechalб, jб existe tutorial pra NPC? eu ia fazer um :/
Tutorial em portuguкs: https://sampforum.blast.hk/showthread.php?tid=109701
Reply
#10

pessoal hj venho com uma pequena duvida, tem como eu entrar de carona em um bot ? e nao deixa ele todo preto ?.

pq o que eu fiz assim ficou todo preto e eu nao consiguo entrar nele.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)