SA-MP Forums Archive
Can bots pick up a pickup? - 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: Can bots pick up a pickup? (/showthread.php?tid=113886)



Can bots pick up a pickup? - SiJ - 16.12.2009

Hey,
I've set some pickups (Type: 14 - Pickupable, but only when in a vehicle. Falls through objects made with CreateObject, etc.)
and when bot drives through them with a car, nothing happens.. But then I sit as a passenger in bot vehicle, pickup get's picked up...
So does that means that bots cannot pick up pickups?


Re: Can bots pick up a pickup? - Jay_ - 16.12.2009

Pickups aren't synced, so unless you have a global event that takes place when someone/thing pickups a pickup, how could you know the NPC didn't get the pickup?


Re: Can bots pick up a pickup? - SiJ - 16.12.2009

Quote:
Originally Posted by Jay_
Pickups aren't synced, so unless you have a global event that takes place when someone/thing pickups a pickup, how could you know the NPC didn't get the pickup?
I can show you the code..
pawn Код:
public OnGameModeInit()
{
    BusStopPickup1 = CreatePickup(323,14,-1967.4030,724.0678,45.4586);
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if (pickupid == BusStopPickup1)
    {
      print("Pickup 1 picked up"); //When bot drives through pickup this line doesn't work. When I'm with bot, this line works
      foreach(Player,i)
        {
            if(PlayerToPoint(5.0,i,-1964.3035, 720.1036, 45.7245))
            {
                printf("%i is in bus station!",i);
            }
            else print("Nobody's in Bus Stop");
        }
        return 1;
    }
    return 1;
}



Re: Can bots pick up a pickup? - Jay_ - 16.12.2009

In that case, no, NPCs cannot pickup pickups


Re: Can bots pick up a pickup? - SiJ - 16.12.2009

Quote:
Originally Posted by Jay_
In that case, no, NPCs cannot pickup pickups
That's bad...
I'll try to change all stuff to IsPlayerInRangeOfPoint if that works..