GTA SA How to add pickups with effects

Status
Not open for further replies.

Adam

Member
May 24, 2010
37
1
Step 1:
Ok first we are going to add the pickup's name. At the top of your script add:
Code:
new pickup1

Step 2:
Now, we are going to create the pickup. We are going to script under
Code:
public OnGameModeInit()
{
     return 1;
}
So under there we will add this:
Code:
public OnGameModeInit()
{
     pickup1 = CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1);
     //CreatePickup(model id, pickup spawn type, X coordinate, Y coordinate, Z coordinate, virtual world)
     //Pickup spawn type is the type you want it to spawn. There are 23 types. The basic one is 2. 2 is where if you pick it up it will respawn in some time. Find a list at [url]http://wiki.sa-mp.com/wiki/PickupTypes[/url]
     return 1;
}

Step 3:
Now we are going to make the effects to where if you walk into the pickup something happens. We are going to work here
Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

Add this:
Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    SetplayerHealth(playerid, 100); //effect number 1.
    SendClientMessage(playerid, 0x00000F, "You have be healed");   
    return 1;
   
}
//If you want more then one pickup do this
//if(pickupid == pickup1)//At the start remember when we added "new pickup1". Well this is saying if the pickupid or pickupname = pickup1(the pickup we created) then there will be these effects below:
//{
//    SetplayerHealth(playerid, 100); //effect number 1.
//    SendClientMessage(playerid, 0x00000F, "You have be healed"); 
//    return 1;
//}
//else
//the pickup id and all the things we did up there

Step 4: Once you have added this to the gamemode compile it, and your done.
 
Status
Not open for further replies.

Users who are viewing this thread

Top