25.09.2014, 05:35
!PP!
Player Pickups
IntroductionPlayer Pickups
I guess I don't need to explain what pickups are. This include lets you to create pickups visible and pickupable by only selected players. Very useful for making gifts or prizes for special players.
Functions
Код:
CreatePlayerPickup(playerid, modelid, Float:x, Float:y, Float:z, Float:range);
modelid - object model, that is displayed as pickup
x, y, z - pickup coordinates
range - distance, from where player can pick up pickup(If you use larger modelid, you have to make bigger range)
returns pickupid, or -1 on failure
Код:
DestroyPlayerPickup(playerid, pickupid);
pickupid - pickupid to destroy pickup
returns 1 on success, 0 on failure
Код:
IsPlayerPickupCreated(playerid, pickupid);
pickupid - pickupid to check if pickup is created
returns 1 if pickup is created, 0 if it isn't.
Код:
OnPlayerPickUpPlayerPickup(playerid, pickupid)
pickupid - pickupid, which was picked up
Download
Pastebin
Notes
Pickups are pickupable only one time - after player picks it, you have to create another, if you want player to pick up it again. Player pickups are smaller than original pickups:
This include uses OnPlayerUpdate, to check if player is in pickup territory(if you're not using Streamer plugin by Incognito), or uses dynamic areas to check it(if you're using Streamer plugin). If you're using Streamer plugin, you should include this include after Streamer plugin.
Bugs
No bugs found yet. If you found any, report them to me, or write it in comments.
If you have any suggestions, how to upgrade this include, write them in comments.