SA-MP Forums Archive
hi i have a probleme with npc - 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: hi i have a probleme with npc (/showthread.php?tid=275786)



hi i have a probleme with npc - rive-sud - 11.08.2011

Hello when I add an NPC who drives a vehicle when I start my server I connect the bot to spawn and reproduce, but not in the vehicle in which he must be the spawn place it in the sky and the sky does not move..

Pic




Код:
#include <a_samp>

new test; // this name in order to find if vou have a bot of 30 in the same script!
public OnGameModeInit()
{

	// NPCS
	ConnectNPC("bot_1","test"); // Connection of your bot, bot_1 is the name and test the name of your bot folder npcmodes!

 	test =	AddStaticVehicle(420,1191.0925,-1325.0585,13.2580,359.6439,6,1); // To create the vehicle to the starting position of the recording taking the position in the savedpositions when you made / save!

	return 1;
}

public OnPlayerSpawn(playerid)
{
    if(!IsPlayerNPC(playerid)) return 0; // We deal only in NPC script will not add any other !!!

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

 	if(!strcmp(playername,"test",true)) { //Name your recording
        PutPlayerInVehicle(playerid, test, 0); // Idem
        SetSpawnInfo( playerid, 0, 255, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 ); // Leave this default will not change unless you want ^ ^
        ShowPlayerMarkers(0);
	}
    return 1;
}



Re: hi i have a probleme with npc - grand.Theft.Otto - 11.08.2011

Try reading this:

https://sampforum.blast.hk/showthread.php?tid=95034


Re : hi i have a probleme with npc - rive-sud - 11.08.2011

with that forum my npc dont connect


Re: hi i have a probleme with npc - =WoR=Varth - 12.08.2011

That's because you connect the NPC before you spawn the vehicle.
pawn Код:
public OnGameModeInit()
{
    test =  AddStaticVehicle(420,1191.0925,-1325.0585,13.2580,359.6439,6,1);
    ConnectNPC("bot_1","test");
    return 1;
}



Re : hi i have a probleme with npc - rive-sud - 12.08.2011

my bot is in a filterscript not in my game mode


Re: hi i have a probleme with npc - Kitten - 13.08.2011

this should work since its connecting the NPC on spawn first.

pawn Код:
public OnPlayerSpawn(playerid)
{
    ConnectNPC("bot_1","test");
    if(!IsPlayerNPC(playerid)) return 0;          // We deal only in NPC script will not add any other !!!

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

    if(!strcmp(playername,"test",true)) {         //Name your recording
        PutPlayerInVehicle(playerid, test, 0);    // Idem
                                                  // Leave this default will not change unless you want ^ ^
        SetSpawnInfo( playerid, 0, 255, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
        ShowPlayerMarkers(0);
    }
    return 1;
}



Re : hi i have a probleme with npc - rive-sud - 14.08.2011

i put that in fs?


Re: Re : hi i have a probleme with npc - =WoR=Varth - 15.08.2011

Quote:
Originally Posted by rive-sud
Посмотреть сообщение
my bot is in a filterscript not in my game mode
pawn Код:
public OnFilterScriptInit()
{
    test =  AddStaticVehicle(420,1191.0925,-1325.0585,13.2580,359.6439,6,1);
    ConnectNPC("bot_1","test");
    return 1;
}
Simple?


Re : hi i have a probleme with npc - rive-sud - 15.08.2011

no not work


Re: hi i have a probleme with npc - =WoR=Varth - 16.08.2011

pawn Код:
if(!strcmp(playername,"bot_1",true)) { //Name your recording