Weapon Pickup.
#1

So i'm trying to create a weapon pickup, in this case a 'tec9' when you pick it up it'll give you the tec9, i've been trying to find something to help me, but all threads around from around 2008.

Anyone can show me how please?
Reply
#2

CreatePickup.
&
OnPlayerPickUpPickUp
Reply
#3

Quote:
Originally Posted by Darnell
View Post
i've tried this, but i don't know where to add the line of code wher eit gives the player the weapon and all
Reply
#4

pawn Code:
new Pickupname; // Global variable for your pickup NOTE: Outside any callback
Pickupname = CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld); // Stores the createpickup in the variable NOTE: Put this in ongamemodeinit
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == Pickupname) // Checks if you picked up the pickup
    {
    // if you pickup the variable "Pickupname"
    }
    return 1;
}
https://sampwiki.blast.hk/wiki/OnPlayerPickUpPickup
https://sampwiki.blast.hk/wiki/CreatePickup
https://sampwiki.blast.hk/wiki/PickupTypes
https://sampwiki.blast.hk/wiki/GivePlayerWeapon
If you need any help, just post again
Reply
#5

Here you go :
pawn Code:
new tec9; // Definig the pickup.



tec9 = CreatePickup(372, 2, 1503.3359, 1432.3585, 10.1191, -1) // The pickup itself.

public OnPlayerPickUpPickup(playerid, pickupid)//When player picks a pickup.
{
    if(pickupid == tec9) GivePlayerWeapon(playerid,32,200); // Giving the player the teec9 when he picks the tec-9 with 200 ammo.
    return 1;
}
EDIT:
Too late :\.
Reply
#6

Thanks!
Reply
#7

No problem.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)