05.04.2010, 12:12
the trick is to script it in the NPC filterscript, have a look 
of course i am too lazy to modify it to send random messages >-<

Код:
#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;
}
}
}

