05.03.2018, 14:46
First of all: Put your code between [code] tags, even if they are printfs. I don't have to explain why.
Second: Post your code. Without your code we can't help you, we don't know what u have already.
In order to successfully put a NPC in a vehicle, make sure the following is done in your script:
I will call the bot Mike in ths example.
If the code above does not work. Your problem is related to elsewhere in your script. Something is preventing the NPC from entering the vehicle.
Second: Post your code. Without your code we can't help you, we don't know what u have already.
In order to successfully put a NPC in a vehicle, make sure the following is done in your script:
I will call the bot Mike in ths example.
PHP код:
new botvehicle;
public OnGameModeInit()
{
ConnectNPC("Mike","mode"); // since your NPC is already connected and standing on top of the vehicle you probably will not need this
botvehicle = AddStaticVehicle(420, 0, 0, 0,0, 0, 1);
}
public OnPlayerSpawn(playerid)
{
if(!IsPlayerNPC(playerid)) return 0;
new playername[64];
GetPlayerName(playerid,playername,64); // Getting the name of the bot
if(!strcmp(playername,"Mike",true)) {
PutPlayerInVehicle(playerid, botvehicle, 0);
}
return 1;
}