would this work? and how
#1

im making a [BOT] Truck driver who does missions and i want it so when he gets a mission it'll playback the recorded file doing that mission simple rite?

well on my npc how would i create a command?


Код:
#define RECORDING "mynpc" //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>
#include <a_samp>
main()
{
    if(strcmp(cmd, "/npcwork", true) == 0)
	{
	 	return 1;
	}
	return 1;
}

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
because i get a error

Код:
C:\Users\************\Desktop\mynpc.pwn(8) : error 017: undefined symbol "cmd"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
and i cant make this in my gamemode because it says undefined startrecordingplayback
Reply
#2

I'm not sure about this.

But what I feel is wrong that you have the chat command under main()
It should be under a function named public OnPlayerText(playerid, text[])

And why do you make a command that just returns 1; ? It's like, making a command that exists, but does not do anything at all?
Reply
#3

Quote:
Originally Posted by Blt950
Посмотреть сообщение
I'm not sure about this.

But what I feel is wrong that you have the chat command under main()
It should be under a function named public OnPlayerText(playerid, text[])

And why do you make a command that just returns 1; ? It's like, making a command that exists, but does not do anything at all?
He made it return 1; so he could show us the code, and because he needs a code to put in that command to replay his bot.

And for the topic starter, instead of trying to replay it, just make a loop around the route for the driver when you /vrecord it. For example:

If your bot trucker starts at RS Haul in Los Santos/Flint County and the destination is Los Santos Police Department...

1. Start recording from RS Haul to LSPD
2. When you're at LSPD, go back the way you came when you came from RS Haul to the PD, or just make a different route back to the RS Haul.
3. When you arrive at RS Haul, slow down then do /stoprecord in the (approximate) spot you started to record it, including the angle of the truck, etc...
4. When that is done and you have it in your script, etc... it should start where you recorded it, go to lspd, go back the way you came then stop where you stopped recording it, then it will keep re-looping like that forever until the server shuts down lol.

Hope you kind of understood that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)