Npc AttachTrailerToVehicle don't work
#1

Hi,

I got a NPC, that drives a linerunner, with thrailer. i searched down the model ID of the linerunner, and the trailer, so i wanted to attach them, and let the npc drive it.
But it don't attach, if i go to the NPC, i only see the linerunner, and not the trailer.. i tried it in the public OnGameModeInit, and in the npc information. Both don't work.
Does someone know how i can attach them, so the npc can drive it?
Reply
#2

Shit, i did this awhile back but since got rid of the script, hm..maybe if i remember the coding i will send back to you :/
Reply
#3

Quote:
Originally Posted by Steven82
Shit, i did this awhile back but since got rid of the script, hm..maybe if i remember the coding i will send back to you :/
That would be nice
Reply
#4

Please send your code with trailer and linerunner and onplayerconnect also
Reply
#5

on top:
Код:
new Linerunner,trailer;
OnGameModeInit:
Код:
ConnectNPC("Linerunner","Linerunner");
Linerunner = CreateVehilce(403, 0.0, 0.0, 5.0, 0.0, 2, 7, 5000);
Trailer = CreateVehilce(450, 0.0, 0.0, 5.0, 0.0, 2, 7, 5000);
AttachTrailerToVehicle(Trailer,Linerunner);
OnPlayerSpawn:
Код:
if(PIslayerNPC(playerid))
{
  new NPCname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, NPCname, sizeof(NPCname)); 
  if(!strcmp(npcname, "Dumper01", true))
  {
   PutPlayerInVehicle(playerid,Linerunner,0);
   AttachTrailerToVehicle(Trailer,Linerunner);
   return 1;
  }
}
i don't got a OnPlayerConnect in my fs.
Reply
#6

So, what did i do wrong?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)