SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 06/11/2009, 12:07 AM   #1
troy52192
Big Clucker
 
Join Date: Jul 2009
Location: USA,Fremont,CA,94538-1257
Posts: 183
Reputation: 2
Default [SOLVED]activate npc using cmd

How do I fix this issue where I can make the bot move just by a command? here is my code:

npcmode = Packer1
recording = Packer1
filterscript = truck
npc = PackerDriver1

this is Truck.pwn:
Code:
#include <a_samp>
#include <a_npc>
#define FILTERSCRIPT
new PackerTruck1;
public OnFilterScriptInit(){
	print(" _______________________________");
	print("| LOADING...          |");
	print("| Packer BOTS         |");
	print("| By Troy Version 1.00     |");
	print("|_______________________________|");
	ConnectNPC("PackerDriver1","Packer1");
	PackerTruck1 = AddStaticVehicle(443,-1899.8900,-1188.4087,39.9347,358.1578,0,0);}
public OnPlayerSpawn(playerid){
	new playername[64];
  if(!IsPlayerNPC(playerid)) return 0;
	GetPlayerName(playerid,playername,64);
	return 1;}
	public OnPlayerCommandText(playerid, cmdtext[]){
	if (strcmp("/bot1", cmdtext, true, 10) == 0){
	new playername[64];
	if(!strcmp(playername,"PackerDriver1",true)) {
 	PutPlayerInVehicle(playerid, PackerTruck1, 0);}
	return 1;}
 	return 0;}
This is Packer1.Pwn:
Code:
#define RECORDING "Packer1"
#define RECORDING_TYPE 1

#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
troy52192 is offline  
Old 06/11/2009, 11:30 AM   #2
FUNExtreme
Gangsta
 
Join Date: Mar 2008
Posts: 790
Reputation: 128
Default Re: activate npc using cmd

Make it connect when you type the command. And disconnect after movement (inside the npcmode)
__________________

FUNExtreme is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/bomb = Activate Car Bomb DeltaAirlines12 Scripting Help 3 28/10/2012 06:09 PM
[HowTo] Activate Variable W/ PassWord. shitbird Help Archive 11 22/06/2010 01:04 PM
Activate Function Using A Key MummyKillerSLO Help Archive 1 22/05/2010 09:36 AM
I can't activate my own server in the list HELP ME [C]_[H]KiLLeR Server Support 2 10/11/2009 04:53 PM
Activate NOS DragoNuno Help Archive 7 02/10/2009 08:48 PM


All times are GMT. The time now is 03:55 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.