[Tutorial] Making Pickups [ Easy Guide ]
#1

So if you are wanting to make a pickup you are at the right place.

So lets get started
At the top of your script your going to want to add something like this.
Look for
Quote:

#include <a_samp>

and put this underneath it.

Quote:

new mypickup;

Okay, so when you have that find this is your script.

Quote:

public OnGameModeInit()

now you want to create the pickup.

Quote:

mypickup = CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld);

The Model and Type will be further down the page.

If you have done it right it should be looking a bit like this.
(I have added my own things to the pickup)
Quote:

public OnGameModeInit()
{
mypickup = CreatePickup(1239, 1, 1864.2164,-2513.4922,13.5469, -1); //Virtual World (-1) is all worlds
return 1;
}

Now you have created your pickup.

Model & Type here. [If you already know this skip down to the next step]

Here are some Model IDS.
Quote:

1210 - Briefcase
1212 - Money
1239 - Information
1240 - Heart
1241 - Adrenaline pill
1242 - Armor
1247 - Bribe
1248 - Gta 3 logo
1252 - Grey bomb
1253 - Photo Op
1254 - rampage (single skull)
1313 - two player rampage (skulls)
1272 - blue house
1273 - green house
1274 - dollar
1275 - blue t-shirt
1276 - tiki
1277 - save disk
1279 - drug bundle
1313 - 2 skulls icon
1314 - 2 player
1316 - Corona (textures missing)
1317 - Checkpoint (textures missing)
1318 - White arrow (pointing down)
1559 - Interior enter/exit diamond
1582 - Pizza Box
2894 - Madd Doggs rhyme book

Type is the pickup spawn type
Here are some pickup types

Quote:

0
The pickup does not display.

1
Not pickupable, exists all the time. (Suitable for completely scripted pickups using OnPlayerPickUpPickup)

2
Pickupable, respawns after some time.

3
Pickupable, respawns after death

4
Disappears shortly after created (perhaps for weapon drops?)

5
Disappears shortly after created (perhaps for weapon drops?)

8
Pickupable, but has no effect. Disappears automatically.

11
Blows up a few seconds after being created (bombs?)

12
Blows up a few seconds after being created.

13
Slowly decends to the ground.

14
Pickupable, but only when in a vehicle. Falls through objects made with CreateObject, etc.

15
Pickupable, respawns after death

19
Pickupable, but has no effect (information icons?)

22
Pickupable, respawns after death.

23
Pickupable, but doesn't disappear on pickup.

Training your Pickup

Make a new line and add this
Quote:

public OnPlayerPickUpPickup(playerid, pickupid)

Now under that add this
Quote:

if(pickupid == mypickup) GameTextForPlayer(playerid, "~B~Hello!!!", 5000,5);

Now when the player picks up the Pickup it will say hello
you can add what ever you want to it for eg you could change it to teleport the player when they get the pickup.

Hope this helped
Reply
#2

You could explained more.
But nice
Reply
#3

I can add more if you want What else could i add to it tho ?
Reply
#4

My pickups still spawn at position 0.0, 0.0, 0.0
Reply
#5

Example you could explain why do you have to add a variable before createpickup
pawn Код:
mypickup = CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld);
And not just
pawn Код:
CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld);
Reply
#6

This Guide Helped Me Alot I was making a GM and I Now use this to link Interior's Thank You Very Much

Your Reward





Reply
#7

Easy and useful. Pretty good.
Reply
#8

When I add that,appened eror: playerid is undefineded symbol :O
Can somebody tell me why?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)