SA-MP Forums Archive
Npc With Player In One Car - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Npc With Player In One Car (/showthread.php?tid=238107)



Npc With Player In One Car - wheelman_WM - 11.03.2011

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


Re : Npc With Player In One Car - Shoko Lacho - 11.03.2011

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


Re: Npc With Player In One Car - wheelman_WM - 11.03.2011

Solved


Re : Npc With Player In One Car - Shoko Lacho - 11.03.2011

Just remove your OnPlayerSpawn and OnPlayerPickUpPickup empty callbacks.


Re: Npc With Player In One Car - wheelman_WM - 11.03.2011

But its teleporting me by every pickups i added in server


Re: Npc With Player In One Car - Roomeo - 11.03.2011

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


Re: Npc With Player In One Car - [WF]Demon - 11.03.2011

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


Re: Npc With Player In One Car - Roomeo - 11.03.2011

Oh Thank you Demon Wow


Re: Npc With Player In One Car - wheelman_WM - 11.03.2011

Still waiting for a reply


Re: Npc With Player In One Car - wheelman_WM - 11.03.2011

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