Pickup
- class pysamp.pickup.Pickup(id: int, model: int, type: int, x: float, y: float, z: float, world: int)
Bases:
object
Pickups are global items that can be “picked” up by a player.
Pickups trigger an event TODO: PLACEHOLDER when picked up.
Benefit of having pickups compared to static pickups, is that you can recreate, destroy and modify pickups, while static pickups can only be created and have pre-made actions that make them work (such as health).
- classmethod create(model: int, type: int, x: float, y: float, z: float, virtual_world: int = 0) Pickup
Create a new global pickup.
- Parameters
model (int) – The pickup model to use. You can use any model here.
type (int) – The pickup type. See here for available types.
x (float) – The x coordinate to place the pickup at.
y (float) – The y coordinate to place the pickup at.
z (float) – The z coordinate to place the pickup at.
virtual_world (optional int) – Which world should it be visible in? The default value is 0.
- Returns
This method does not return anything.
Warning
Pickups that have a X or Y < -4096.0 or > 4096.0 will not show up and won’t trigger any events either.
Note
Only pickup type that can be picked up from within a car, is ID 14.
Certain pickup types come with ‘automatic responses’, for example using an M4 model in the pickup will automatically give the player the weapon and some ammo.
- destroy() bool
Destroy the pickup.
- Returns
No return value.
This removes the pickup from the world.
- id
The pickup ID (readonly int).
- model
The model the pickup is using (readonly int).
- type
The type of the pickup (readonly int).
- world
The virtual world the pickup exist in (readonly int).
- x
The pickup X postition (readonly float).
- y
The pickup Y postition (readonly float).
- z
The pickup Z postition (readonly float).