NPC problem
#1

Hi guys,
I have a problem. When the NPC connect to a server, the server doesn't put him in the vehicle. I see red color of NPC at coords 0.0, 0.0, 0.0


OnPlayerSpawn
Код:
	if(IsPlayerNPC(playerid)) //UKOLIKO JE PRIJAVLJENI IGRAC BOT
	{
	    if(!strcmp(name, "Vozac_Tramvaja", true)) //UKOLIKO JE BOT KOJI VOZI TRAMVAJ
	    {
     		SetPlayerColor(playerid, 0xF00000FF);
     		SetPlayerSkin(playerid, 61);
     		PutPlayerInVehicle(playerid, bot_vozilo, false);
	    }
	    else //UKOLIKO JE TO NEKI DRUGI BOT
	    {
			Ban(playerid);
		}
	}
OnGameModeInit
Код:
	//KREIRANJE BOTOVA
	bot_vozilo = CreateVehicle(449, 0.0, 0.0, 5.0, 0.0, 3, 3, 3600);
	ConnectNPC("Vozac_Tramvaja","tramvaj");
NPC script
Код:
#define RECORDING 				"tramvaj"
#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
Reply
#2

OnPlayerSpawn
pawn Код:
if(IsPlayerNPC(playerid)) //UKOLIKO JE PRIJAVLJENI IGRAC BOT
{
    if(!strcmp(name, "Vozac_Tramvaja", true)) //UKOLIKO JE BOT KOJI VOZI TRAMVAJ
    {
    SetPlayerColor(playerid, 0xF00000FF);
    SetPlayerSkin(playerid, 61);
        PutPlayerInVehicle(playerid, Vehicle name, 0); // Change Vehicle Name
    }
    else //UKOLIKO JE TO NEKI DRUGI BOT
    {
    Ban(playerid);
    }
   } // Remove if errors
  return 1; //Remove if errors
}//Remove if errors
+rep if helped
Untested
Reply
#3

That won't help, bot_vozilo tagging train...
Reply
#4

might be weird but it worked for me once;

use addstaticvehicle instead of createvehicle
Reply
#5

Not working... Same problem
Reply
#6

is it only vehicle npc's or dont onfoot npcs spawn either ?

if they all dont

put this under onplayerspawn

[pawn]if(!IsPlayerNPC(playerid)) return 1;[pawn]

at onplayerrequestclass use setplayerspawninfo for the npc
Reply
#7

Still nothing...
My NPC is connected and vehicle is spawned but server isn't put NPC in vehicle(bot_vozilo or bot_vehicle[eng])
Reply
#8

Someone?
Reply
#9

Quote:
Originally Posted by kc
Посмотреть сообщение
My NPC just stands at the spawnpoint
Go back, and re-do the OnPlayerSpawn part of the tutorial.
You seem to have followed this tutorial, do it exactly the way this guy had explained it.
I used to experience the same problem and re-doing it helped.
Reply
#10

Doesn't work again.... I don't Know where is a problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)