05.10.2009, 14:26
if your using Addstaticvehicle in your gamemode the first vehicle is classed as id 1 then id 2 then id 3 etc etc but if you want a NPC to drive a train i recommend just creating the vehicle onplayerspawn with npc and then just put them in the vehicle IE
obviously this isn't the code you should use as i just ripped it straight from my GM as an example to you
Код:
public OnPlayerSpawn(playerid)
{
// For NPC Spawns
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "Traindriver1", true))// LS Train
{
new LSTrain = AddStaticVehicle(538,0,0,0,270.1690,1,1);
PutPlayerInVehicle(playerid, LSTrain, 0);
SetPlayerColor(playerid,COLOR_GREEN);
SetPlayerSkin(playerid,16); // Orange Jacket Guy
new Text3D:textlabel1,string[256];
format(string, sizeof(string), "Train Driver (%d)",playerid);
textlabel1 = Create3DTextLabel(string,COLOR_GREEN,0,0,0,25.0,0,1);
Attach3DTextLabelToPlayer(textlabel1,playerid,0,0,0);
}
}
}

