Specific ID pickup
#1

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 код:
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 код:
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!
Reply
#2

Just use the extra id of course.

Код:
#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);
Reply
#3

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Just use the extra id of course.

Код:
#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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)