SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 13/06/2018, 02:37 AM   #1
EgyptForLife
Huge Clucker
 
EgyptForLife's Avatar
 
Join Date: Mar 2014
Posts: 283
Reputation: 9
Question Specific ID pickup

Hello SA:MP Forums,

I've been working on a quest system where you have to pickup 30 pickups with a specific model to gain a prize. I faced a problem which is setting the pickup model in the OnPlayerPickupDynamicPickUp function. What I need to know is how to make this specific pickup model have the function working just on it and not on every other dynamic pickup that's added to the server.

OnPlayerPickupDynamicPickUp code:
PHP Code:
public OnPlayerPickUpDynamicPickup(playeridpickupid)
{
if(
QuestEventState == 1)
    {
                new 
quest2[256];
                if(
PlayerInfo[playerid][pLastQuest] != sizeof(QuestPositions) && PlayerInfo[playerid][pLastQuest] != 999)
                {
                    if(
pickupid == QuestPickups[PlayerInfo[playerid][pLastQuest]])
                    {
                        
PlayerInfo[playerid][pLastQuest]++;
                        if(
PlayerInfo[playerid][pLastQuest] != sizeof(QuestPositions))
                        {
                            
format(quest2sizeof(str), "%d out of %d Pizzas found!"PlayerInfo[playerid][pLastQuest], sizeof(QuestPositions));
                            
GameTextForPlayer(playeridquest230003);
                            
Update(playeridpLastQuestx);
                        }
                        else
                        {
                            
format(quest2,sizeof(str), "All %s has been found!"QuestSingleName);
                            
GameTextForPlayer(playeridquest230003);
                            
GivePlayerMoney(playerid300000);
                            
PlayerInfo[playerid][pGoldPoints] += 300;
                            
PlayerInfo[playerid][pExp] += 30;
                            
PlayerInfo[playerid][pLastQuest] = 999;
                            
Update(playeridpCashx);
                            
Update(playeridpRP);
                            
Update(playeridpGoldPointsx);
                            
Update(playeridpLastQuestx);
                        }
                    }
                    else
                    {
                        
format(quest2,sizeof(str), "(%s) {FFFFFF}This is not your last Pizza. You need #%d."QuestNamePlayerInfo[playerid][pLastQuest] + 1);
                        
SCM(playeridCOLOR_LIGHTREDquest2);
                    }
                    }
            }
       return 
1;

The pickup model is: 1582 defined as:
PHP Code:
new QuestObject 1582
Note:indentation looks crappy in here, sorry for that.

Please notice that there isn't only 1 quest pickup, there's a minimum of 30 pickups.

Thanks for your help in advance!
__________________
If I helped you, just click on this :

I am Learning Scripting, i am not pro, i don't know how to script from SCRATCH , I just take a gamemode and edit it. I think this is how almost everyone started to learn too. So, When i ask a question I want to learn on how to fix it and how to do it in the next time, not just to copy paste.
EgyptForLife is offline   Reply With Quote
Old 13/06/2018, 12:47 PM   #2
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,424
Reputation: 1238
Default Re: Specific ID pickup

Just use the extra id of course.

Code:
#define			PICKUP_TYPE_PIZZA       1
#define			PICKUP_TYPE_DILDO       2

Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, PICKUP_TYPE_PIZZA);
type = Streamer_GetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID);
Pottus is offline   Reply With Quote
Old 13/06/2018, 10:48 PM   #3
EgyptForLife
Huge Clucker
 
EgyptForLife's Avatar
 
Join Date: Mar 2014
Posts: 283
Reputation: 9
Default Re: Specific ID pickup

Quote:
Originally Posted by Pottus View Post
Just use the extra id of course.

Code:
#define			PICKUP_TYPE_PIZZA       1
#define			PICKUP_TYPE_DILDO       2

Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, PICKUP_TYPE_PIZZA);
type = Streamer_GetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID);
Can you explain a little bit more please.

EDIT: PROBLEM SOLVED
__________________
If I helped you, just click on this :

I am Learning Scripting, i am not pro, i don't know how to script from SCRATCH , I just take a gamemode and edit it. I think this is how almost everyone started to learn too. So, When i ask a question I want to learn on how to fix it and how to do it in the next time, not just to copy paste.

Last edited by EgyptForLife; 13/06/2018 at 11:56 PM.
EgyptForLife is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If you want to enter a specific vehicle ID, you need a specific skin davelord Scripting Help 9 07/08/2012 01:09 AM
Specific teams get specific abilities, how? Andregood Help Archive 7 15/04/2011 04:08 PM
Pickup only for a specific team Face9000 Help Archive 9 18/12/2010 09:41 AM
How can i spawn a specific player in a specific vehicle ? AlbanianGuy Help Archive 8 16/01/2010 07:31 AM
Pickup does not appear (Amount < 400) - Create pickup for specific player? Programie Help Archive 4 19/08/2009 09:50 PM


All times are GMT. The time now is 02:58 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.