SA-MP Forums Archive
Need help with my NPC`s (gamemode 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: Need help with my NPC`s (gamemode problem) (/showthread.php?tid=257685)



Need help with my NPC`s (gamemode problem) - Defrago - 27.05.2011

Hi all. I have downloaded a SARP gamemode from here and now it`s our main gamemode. We want to put some NPC`s on our server but with this GM they doesn`t work. They run perfectly on the lvdm - from 0.3c server package (our bots is a filterscript). I had stopped bots kicking by adding
PHP код:
if(IsPlayerNPC(playerid)) return 1
in the reg system of this GM, but the bots now just don`t enter to their vehicles. I can`t find what is the problem, but it`s in GM. Please help.

An actual version of the GM... Some editions done.

P.S. Sorry for my bad english if so


Re: Need help with my NPC`s (gamemode problem) - cs_master - 27.05.2011

i think its bug and sarp gm is big u known so try other


Re: Need help with my NPC`s (gamemode problem) - Amel_PAtomAXx - 27.05.2011

try to put
pawn Код:
if(IsPlayerNPC(playerid))
{
PutPlayerInVehicle(playerid,vehicleid);
return 1;
}
playerid = your NPC
vehicleid = you need to create that example:
pawn Код:
new npcvehicle;
OnGameModeInit()
pawn Код:
npcvehicle = CreateVehicle(411,0,0,0,1,1,1,1);
try it..


Re: Need help with my NPC`s (gamemode problem) - cs_master - 27.05.2011

no i think its include problem plz check ur include is updated?


Re: Need help with my NPC`s (gamemode problem) - Defrago - 27.05.2011

This is my FS for bots:
Код:
new MyFirstNPCVehicle;
new GrooveBus;
new AllSATram;
new HyundaiCounty;
new MidnightTrain;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	ConnectNPC("Defrago_Driver1","defnpc1");
	ConnectNPC("Defrago_Driver2","defnpc2");
	ConnectNPC("Defrago_Driver3","defnpc3");
	ConnectNPC("Defrago_Driver4","defnpc4");
	ConnectNPC("Defrago_Driver5","defnpc5");
	
	MyFirstNPCVehicle = AddStaticVehicle( 437, 0.0, 0.0, 5.0, 0.0, -1, -1);
	GrooveBus = AddStaticVehicle( 437, 0.0, 0.0, 5.0, 0.0, -1, -1);
	AllSATram = AddStaticVehicle( 449, 0.0, 0.0, 5.0, 0.0, 144, 161);
	HyundaiCounty = AddStaticVehicle( 418, 0.0, 0.0, 5.0, 0.0, 6, 6);
	MidnightTrain = AddStaticVehicle( 538, 0.0, 0.0, 5.0, 0.0, 144, 161);
	return 1;
}
Код:
public OnPlayerSpawn(playerid)
{
	if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
		{
			new npcname[MAX_PLAYER_NAME];
			GetPlayerName(playerid, npcname, sizeof(npcname));
			if(!strcmp(npcname, "Defrago_Driver1", true)) //проверяем имя MyFirstNPC
			{
				PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); // Сажаем NPC В созданую для него машину
				return 1;
			}
			if(!strcmp(npcname, "Defrago_Driver2", true))
			{
				PutPlayerInVehicle(playerid, GrooveBus, 0); // Сажаем NPC В созданую для него машину
				return 1;
			}
			if(!strcmp(npcname, "Defrago_Driver3", true))
			{
				PutPlayerInVehicle(playerid, AllSATram, 0); // Сажаем NPC В созданую для него машину
				return 1;
			}
			if(!strcmp(npcname, "Defrago_Driver4", true))
			{
				PutPlayerInVehicle(playerid, HyundaiCounty, 0); // Сажаем NPC В созданую для него машину
				return 1;
			}
			if(!strcmp(npcname, "Defrago_Driver5", true))
			{
			    PutPlayerInVehicle(playerid, MidnightTrain, 0);
			    return 1;
			}
			return 1;
		}
	return 1;
}
(All other is default)

I`m part of the team so I can`t change GM (bots are important but not critical).

Код:
if(IsPlayerNPC(playerid)){PutPlayerInVehicle(playerid,vehicleid);return 1;}
- put it WHERE?


Re: Need help with my NPC`s (gamemode problem) - Defrago - 31.05.2011

Still need help (bump)


Re: Need help with my NPC`s (gamemode problem) - Defrago - 03.06.2011

Any ideas? (I will NOT pay for this!)