Npc With Player In One Car
#1

Hey I want to make a pickup when a player picks it he willl be teleported in a car with NPC.
Reply
#2

pawn Код:
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;
}
YourPickupModel > https://sampwiki.blast.hk/wiki/Game_Object_ID_List
YourPickupType > https://sampwiki.blast.hk/wiki/PickupTypes
Reply
#3

Solved
Reply
#4

Just remove your OnPlayerSpawn and OnPlayerPickUpPickup empty callbacks.
Reply
#5

But its teleporting me by every pickups i added in server
Reply
#6

i would help you but i really don't know what is NPC
Reply
#7

Non-Playing-Character i believe, basically a bot that does whatever you recorded into a file.
Reply
#8

Oh Thank you Demon Wow
Reply
#9

Still waiting for a reply
Reply
#10

Anyone plz help me it teleports player by every pickups in server
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)