11.03.2011, 03:50
Hey I want to make a pickup when a player picks it he willl be teleported in a car with NPC.
new PickupNPC;
new BotVehicle;
public OnGameModeInit()
{
ConnectNPC("YourBotName", "YourRecordName");
BotVehicle = CreateVehicle(405, 0, 0, 0, 0, -1, -1, 0);
PickupNPC = CreatePickup((YourPickupModel YourPickupType, X, Y, Z, -1);
return 1;
}
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "YourBotName", true))
{
PutPlayerInVehicle(playerid, BotVehicle, 0);
}
}
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == PickupNPC)
{
PutPlayerInVehicle(playerid, BotVehicle, 1);
}
return 1;
}