How can I do this?
#6

the trick is to script it in the NPC filterscript, have a look
Код:
#define RECORDING "PirateShip" //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>
new CyclesMin=20;
new CyclesMax=30;
new CyclesATM=0;
forward TimerPirateShip();
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
main()
{
  printf("PirateShip");
}
public OnNPCModeInit()
{
	SetTimer("TimerPirateShip",2000,1);
}
public TimerPirateShip()
{
	CyclesATM++;
	if(CyclesATM>CyclesMin)
	{
		if(CyclesATM>CyclesMax || random(10)<2)
		{
			new Amount=100000;
			new NPCcmd[32];
			format(NPCcmd,sizeof(NPCcmd),"/dt %d",Amount);
			SendCommand(NPCcmd);
			new msg[128];
			format(msg,128,"/Aq I lost a Treasure, it is worth $%d! Can someone bring it back?",Amount);
			SendCommand(msg);
			format(msg,128,"I lost a Treasure, it is worth $%d! Can someone bring it back?",Amount);
			SendChat(msg);
			CyclesATM=0;
		}
	}
}
of course i am too lazy to modify it to send random messages >-<
Reply


Messages In This Thread
How can I do this? - by Jeffry - 04.04.2010, 14:17
Re: How can I do this? - by Torran - 04.04.2010, 14:19
Re: How can I do this? - by ScottCFR - 04.04.2010, 14:20
Re: How can I do this? - by Jeffry - 04.04.2010, 14:21
Re: How can I do this? - by Jeffry - 05.04.2010, 11:56
Re: [UNSOLVED]How can I do this? - by Babul - 05.04.2010, 12:12
Re: [UNSOLVED]How can I do this? - by Jeffry - 05.04.2010, 12:29
Re: [UNSOLVED]How can I do this? - by Babul - 05.04.2010, 12:36
Re: [UNSOLVED]How can I do this? - by Jeffry - 05.04.2010, 12:54
Re: [UNSOLVED]How can I do this? - by Desert - 05.04.2010, 13:34

Forum Jump:


Users browsing this thread: 3 Guest(s)