[Tutorial] How To Make Pickup Icons and Use Them
#1

Things You Will Need:

Pawno
Simple Knowledge
Simple Command Knowledge
SA:MP
and
A Motivation To Script.

Step 1

Go To The Top of Your Script, here you will see your includes
Code:
#include <a_samp>
and so on

under that Type
Code:
new deagle;
(you can change deagle to whatever you want)

Step 2

Make sure you have the x,y,z coordinates for your pickup next
under
Code:
public OnGameModeInit()
and after the {
type this

Code:
deagle = CreatePickup( 1239,1,-384.7508,2206.4153,42.4236 );
Createpickup: Modelid Type x y z

Code:
 Available Pickup Types
 0
The pickup does not display.

 1
Not pickupable, exists all the time.

 2
Pickupable, respawns after some time.

 3
Pickupable, but doesn't respawn.

 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, but doesn't respawn.

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

 22
Pickupable, but doesn't respawn.

 23
Pickupable, but doesn't disappear on pickup.
(im my case it will be called deagle use the name You wrote on (new) on top of your script)

Step 3

Are you catching up?

find
Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}
once found under the public Onplayerpickuppickup
and under the {
type
Code:
if(pickupid == Deagle)
{
return 1;
}
Now in between
Code:
{
return 1;
Type Your Command, You can find commands here,

https://sampwiki.blast.hk/wiki/Category:Scripting_Functions

So This what I would do for the Deagle

Code:
if(pickupid == Deagle)
{
GivePlayerWeapon(playerid, 24, 500); //Give playerid Deagle with 500 ammo
return 1;
}
Then in Game goto the pickup you created, where your X,y,z spot was supposed to be and goto the pickup and you will get a Deagle with 500 ammo.

Thats it simple and easy.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)