[Tutorial] Creating a new NPC
#61

Well, I did what did you say exactly, but nothing really happen, I just get a message in server log which is
Code:
[14:45:49] Incoming connection: 127.0.0.1:63231
[14:46:30] Incoming connection: 127.0.0.1:63232
Reply
#62

When I do "/stoprecord" after "/ofrecord blah" my recordings folder is still empty... there is no such a file like blah.rec... What should I do?
Reply
#63

Quote:
Originally Posted by w84m3
View Post
When I do "/stoprecord" after "/ofrecord blah" my recordings folder is still empty... there is no such a file like blah.rec... What should I do?
Are you on Windows 7?
Reply
#64

It saves into your script files folder not your recording folder.
Reply
#65

Quote:
Originally Posted by w84m3
View Post
When I do "/stoprecord" after "/ofrecord blah" my recordings folder is still empty... there is no such a file like blah.rec... What should I do?
your record have saved in scriptfiles folder, not npc_records
Reply
#66

C:\Documents and Settings\arvuti24\Desktop\samp03csvr_win32\pawno\m ini.pwn(13) : error 021: symbol already defined: "OnRecordingPlaybackEnd"
C:\Documents and Settings\arvuti24\Desktop\samp03csvr_win32\pawno\m ini.pwn(16) : error 021: symbol already defined: "OnNPCSpawn"


---WHAT SHOULD I DO---
Reply
#67

Nice
Reply
#68

Quote:

C:\Users\HELLBOY\Desktop\Server\npcmodes\Optimuss_ Prime.pwn(14) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit")
C:\Users\HELLBOY\Desktop\Server\npcmodes\Optimuss_ Prime.pwn(17) : error 017: undefined symbol "ConnectNPC"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

I got some problem With this.
Well this is first time I'am Scripting I don't know what to do.

I did this
Quote:

#define RECORDING "Ballas"
#define RECORDING_TYPE 2

#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
public OnGameModeInit()
{
print("my gamemode");
ConnectNPC("MyFirstNPC","Ballas");
return 1;
}

If i did anything wrong Please let me know

Replay me Fast Please
Thanks
___________
OBSERVADOR
___________
No replys?
Reply
#69

How do for what a npc use a vehicle RC?

How create the vehicle?

CreateObject?
CreateVehicle?
Reply
#70

******* vid?
Reply
#71

I make all of this steps of the vehicle thing, but...when I load it it says that the npc joined and all that stuff, but the npc is NOT There.!

It doesnt appear.
Reply
#72

How can I make it so when a player enters the NPC's car a Dialog shows asking him where he would like to go, then when the players clicks on a location the NPC starts to drive there?
Reply
#73

Quote:
Originally Posted by -Luis
Посмотреть сообщение
How can I make it so when a player enters the NPC's car a Dialog shows asking him where he would like to go, then when the players clicks on a location the NPC starts to drive there?
That's really hard making with the current NPC functions.
Reply
#74

I got errors from compiling "everything is right"

Код:
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(15) : warning 235: public function lacks forward declaration (symbol "OnRecordingPlaybackEnd")
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(15) : error 017: undefined symbol "StartRecordingPlayback"
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(18) : warning 235: public function lacks forward declaration (symbol "OnNPCEnterVehicle")
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(18) : error 017: undefined symbol "StartRecordingPlayback"
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(19) : warning 235: public function lacks forward declaration (symbol "OnNPCExitVehicle")
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(19) : error 017: undefined symbol "StopRecordingPlayback"
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(522) : error 017: undefined symbol "AnotherVehicleID"
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(527) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
pawn Код:
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING); // line 15

#if RECORDING_TYPE == 1
  public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING); // line 18
  public OnNPCExitVehicle() StopRecordingPlayback(); // line 19
#else
  public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif
pawn Код:
if(IsPlayerNPC(playerid)) return 1; //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, "Bot01", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
      return 1;
    }
    if(!strcmp(npcname, "Bot02", true))
    {
      PutPlayerInVehicle(playerid, AnotherVehicleID, 0); // 522
      return 1;
    }
    return 1;
  }
    GameTextForPlayer(playerid, "~b~/cmds * ~r~/rules * ~g~/jobs", 5000, 1); // line 527
help??
Reply
#75

use include "a-npc" or something
Reply
#76

same problem >_<

i wish someone could help me lol
Reply
#77

I have my script:

pawn Код:
new MyFirstNPCVehicle; //Global variable!
public OnFilterScriptInit()
{
    print("\n-----------------------------------------");
    print("      Bus Driver NPC Script by Tuвn Anh");
    print("------------------------------------------\n");
    //SetGameModeText("NPC Mode");
    ConnectNPC("BusWilliams","williams");
    MyFirstNPCVehicle = CreateVehicle(437, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerSpawn(playerid)
{    
    if(IsPlayerNPC(playerid))
    {
        new string[128];
        new playername[MAX_PLAYER_NAME];
        SetPlayerSkin(playerid,165);
        GetPlayerName(playerid,playername,64);
        SetPlayerColor(playerid,0xFF8000FF);
        format(string, sizeof(string),"Hi all, I am %s(%d) Bus Driver. My ID car: %d", playername, playerid, MyFirstNPCVehicle);
        SendPlayerMessageToAll(playerid, string);
        Delete3DTextLabel(DutyLabel[playerid]);
        DutyLabel[playerid] = Create3DTextLabel("Bus Driver\nWilliams",0xFF000099,0,0,2,50,-1,1);
        Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);
        if(!strcmp(playername, "BusWilliams", true)) {
            SetSpawnInfo(playerid, 0, 165, 1529.6,-1691.2,13.3);
            PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 1);
            //return 1;
        }
        return 1;
    }
    //Other stuff for normal players goes here!
    return 1;
}
And NPCModes:

pawn Код:
#define RECORDING "williamsbusdriver" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 1 //1 for in vehicle and 2 for on foot.

#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
All most as are normal but command: PutPlayerInVehicle not work? Why?
Reply
#78

@jonnyboy:
I see:
Код:
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(15) : warning 235: public function lacks forward declaration (symbol "OnRecordingPlaybackEnd")
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(15) : error 017: undefined symbol "StartRecordingPlayback"
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(18) : warning 235: public function lacks forward declaration (symbol "OnNPCEnterVehicle")
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(18) : error 017: undefined symbol "StartRecordingPlayback"
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(19) : warning 235: public function lacks forward declaration (symbol "OnNPCExitVehicle")
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(19) : error 017: undefined symbol "StopRecordingPlayback"
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(522) : error 017: undefined symbol "AnotherVehicleID"
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(527) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
But

pawn Код:
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING); // line 15

#if RECORDING_TYPE == 1
  public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING); // line 18
  public OnNPCExitVehicle() StopRecordingPlayback(); // line 19
#else
  public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif

=> This error from file gm.pwn and it in folder gamemodes, but from file source I can know true position is npcmodes, and line 522, 527 with error 017: undefined symbol "AnotherVehicleID" => It must not the same time at a file.

Ex: My npcmode with name is "williams.amx":

pawn Код:
#define RECORDING "williamsbusdriver" //This is the filename of your recording without the extension, this file is npcmodes/recording/williamsbusriver.rec.
#define RECORDING_TYPE 1 //1 for in vehicle and 2 for on foot.

#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
And In my script I was call it:

pawn Код:
public OnFilterScriptInit()
{
    print("\n-----------------------------------------");
    print("      Bus Driver NPC Script by Tuвn Anh");
    print("------------------------------------------\n");
    //SetGameModeText("NPC Mode");
    ConnectNPC("BusWilliams","williams"); //set NPC name is BusWilliams, with npcmode williams.amx
    MyFirstNPCVehicle = CreateVehicle(437, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
    return 1;
}
I have called "#include <a_npc>" in my script !


Sorry for my bad english !
Reply
#79

so i need to make a filterscript to use them?
Reply
#80

@jonnyboy: Depending on whether you want to use script or game mode!
I use script to add to my server!
You should try read topic #1 again!

Someone can fix my problem [Link]?
Reply


Forum Jump:


Users browsing this thread: 9 Guest(s)