SA-MP Forums Archive
NPC Trains and Planes Little Things, BIG PROBLEM! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: NPC Trains and Planes Little Things, BIG PROBLEM! (/showthread.php?tid=113205)



NPC Trains and Planes Little Things, BIG PROBLEM! - wilcock33 - 12.12.2009

hi all, this is a bit silly, but i just cant work it out

i am using the trains and plane npc's that come with the samp0.3 download, but when i run the npc's, the planes and the car Blade and the trains are the car slamvan

i know i have to change the vehicle id, but i dont know where, HELP!!!


Re: NPC Trains and Planes Little Things, BIG PROBLEM! - [03]Garsino - 12.12.2009

Quote:
Originally Posted by TFZ
hi all, this is a bit silly, but i just cant work it out

i am using the trains and plane npc's that come with the samp0.3 download, but when i run the npc's, the planes and the car Blade and the trains are the car slamvan

i know i have to change the vehicle id, but i dont know where, HELP!!!
Show us the script.


Re: NPC Trains and Planes Little Things, BIG PROBLEM! - wilcock33 - 12.12.2009

Код:
//-------------------------------------------------
//
// NPC initialisation for Grand Larceny
//
//-------------------------------------------------

#pragma tabsize 0
#include <a_samp>

//-------------------------------------------------

public OnFilterScriptInit()
{
	ConnectNPC("TrainDriverLV","train_lv");
	ConnectNPC("TrainDriverLS","train_ls");
	ConnectNPC("TrainDriverSF","train_sf");
	
	ConnectNPC("PilotLV","at400_lv");
	ConnectNPC("PilotSF","at400_sf");
	ConnectNPC("PilotLS","at400_ls");
	return 1;
}

//-------------------------------------------------
// IMPORTANT: This restricts NPCs connecting from
// an IP address outside this server. If you need
// to connect NPCs externally you will need to modify
// the code in this callback.

public OnPlayerConnect(playerid)
{
	if(IsPlayerNPC(playerid)) {
	  new ip_addr_npc[64+1];
	  new ip_addr_server[64+1];
	  GetServerVarAsString("bind",ip_addr_server,64);
	  GetPlayerIp(playerid,ip_addr_npc,64);
	  
		if(!strlen(ip_addr_server)) {
		  ip_addr_server = "127.0.0.1";
		}
		
		if(strcmp(ip_addr_npc,ip_addr_server,true) != 0) {
		  // this bot is remote connecting
		  printf("NPC: Got a remote NPC connecting from %s and I'm kicking it. OWNED!",ip_addr_npc);
		  Kick(playerid);
		  return 0;
		}
    printf("NPC: Connection from %s is allowed.",ip_addr_npc);
	}
	
	return 1;
}

//-------------------------------------------------

public OnPlayerRequestClass(playerid, classid)
{
	if(!IsPlayerNPC(playerid)) return 1;
	
	new playername[64];
	GetPlayerName(playerid,playername,64);

 	if(!strcmp(playername,"TrainDriverLV",true)) {
    SetSpawnInfo(playerid,69,255,1462.0745,0.0000,0.0000,0.0,-1,-1,-1,-1,-1,-1);
	}
	else if(!strcmp(playername,"TrainDriverSF",true)) {
	  SetSpawnInfo(playerid,69,255,-1942.7950,168.4164,27.0006,0.0,-1,-1,-1,-1,-1,-1);
	}
	else if(!strcmp(playername,"TrainDriverLS",true)) {
	  SetSpawnInfo(playerid,69,255,1700.7551,-1953.6531,14.8756,0.0,-1,-1,-1,-1,-1,-1);
	}
	else if(!strcmp(playername,"PilotLV",true)) {
	  SetSpawnInfo(playerid,69,61,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);
	}
	else if(!strcmp(playername,"PilotSF",true)) {
	  SetSpawnInfo(playerid,69,61,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);
	}
	else if(!strcmp(playername,"PilotLS",true)) {
	  SetSpawnInfo(playerid,69,61,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);
	}
	return 0;
}

//-------------------------------------------------
public OnPlayerSpawn(playerid)
{
	if(!IsPlayerNPC(playerid)) return 1; // We only deal with NPC players in this script

	new playername[64];
	GetPlayerName(playerid,playername,64);

	if(!strcmp(playername,"TrainDriverLV",true)) {
    PutPlayerInVehicle(playerid,1,0);
 	}
	else if(!strcmp(playername,"TrainDriverSF",true)) {
	  PutPlayerInVehicle(playerid,5,0);
	}
	else if(!strcmp(playername,"TrainDriverLS",true)) {
	  PutPlayerInVehicle(playerid,9,0);
	}
	else if(!strcmp(playername,"PilotLV",true)) {
	  PutPlayerInVehicle(playerid,13,0);
	}
	else if(!strcmp(playername,"PilotSF",true)) {
	  PutPlayerInVehicle(playerid,14,0);
	}
	else if(!strcmp(playername,"PilotLS",true)) {
	  PutPlayerInVehicle(playerid,15,0);
	}
	else if(!strcmp(playername,"TaxiTest",true)) {
	  PutPlayerInVehicle(playerid,968,0);
 	}

	return 1;
}
//-----------------------------------------
// EOF



Re: NPC Trains and Planes Little Things, BIG PROBLEM! - denbo1 - 12.12.2009

Quote:

Show us the Script

WHY BOTHER! ITS WITH THE BLOODY 0.3a SERVER PACK!!!!!!!!!!!!!!!!!!!!!!!!!!!!



Re: NPC Trains and Planes Little Things, BIG PROBLEM! - wilcock33 - 12.12.2009

go away dennis



Re: NPC Trains and Planes Little Things, BIG PROBLEM! - denbo1 - 12.12.2009

Thats not nice


Re: NPC Trains and Planes Little Things, BIG PROBLEM! - wilcock33 - 12.12.2009

So Can you help, please ignore my brother


Re: NPC Trains and Planes Little Things, BIG PROBLEM! - [03]Garsino - 12.12.2009

Quote:
Originally Posted by (|Mad_hero|)
Quote:

Show us the Script

WHY BOTHER! ITS WITH THE BLOODY 0.3a SERVER PACK!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Seriously, fuck you, he could have modified something thats not in the pack you jerk. Go take your comments somewhere else.


Re: NPC Trains and Planes Little Things, BIG PROBLEM! - wilcock33 - 12.12.2009

so, what do you think is wrong?


Re: NPC Trains and Planes Little Things, BIG PROBLEM! - [03]Garsino - 12.12.2009

Quote:
Originally Posted by TFZ
so, what do you think is wrong?
https://sampwiki.blast.hk/wiki/PutPlayerInVehicle

pawn Код:
PutPlayerInVehicle (playerid,vehicleid,seatid);

//playerid  ID of the player
//vehicleid ID of the vehicle
//seatid    ID of the seat (0-driver, 1-co-driver, 2&3-passengers, if the car has enough seats)
Now take a look at your code.