[problem]PutPlayerInVehicle
#1

When i use the function PutPlayerInVehicle for a NPC, the NPC doesn't go in and then disconnects from the server a couple seconds later whats going on? (My other NPC's that aren't vehicle NPC's don't disconnect either way)

Код:
#include <a_samp>

new vehicle;

public OnFilterScriptInit()
{
	ConnectNPC("1st","1st");
 	vehicle =	AddStaticVehicle(492,1071.8664,-1854.9331,13.1725, -90, 0, 0); // bus1
	return 1;
}

public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid))
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname));
    if(!strcmp(npcname, "1st", true))
    {
      PutPlayerInVehicle(playerid, vehicle, 0);
    }
    return 1;
  }
  return 1;
}
ive noticed that if i remove PutPlayerInVehicle from the filterscript, the NPC doesn't disconnect
Reply
#2

thats at least weird but try removing all the space between vehicle=Add...
btw you #define filterscript??
and add new vehicle; under IfDefinedFilterscript..., right under it
Reply
#3

AddStaticVehicle doesn't return a value, use CreateVehicle instead.
Reply
#4

Quote:
Originally Posted by radhakr
AddStaticVehicle doesn't return a value, use CreateVehicle instead.
Oh yea, do that, radhakr's right
Reply
#5

Quote:
Originally Posted by patchkinson
Quote:
Originally Posted by radhakr
AddStaticVehicle doesn't return a value, use CreateVehicle instead.
Oh yea, do that, radhakr's right
Oh thanks, but it doesn't work, the NPC still disconnects after 5 seconds ...
Reply
#6

Dude look at my script in Creating a npc
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)