[HELP] Pickup insane bug
#1

So...

I use many pickups. Every pickup is on virtual world 0 (no lag).
I use new pPickup[600]; variable so i have 600 pickups.

Now we have this pickups:

1.
Код:
pPickup[200] = CreatePickup(1279,1,x,y,z,0);
and

2.
Код:
pPickup[500] = CreatePickup(1272,1,x,y,z,0);
Pickup 1. give you money if you pick it up.

Pickup 2. show you dialog if you pick it up.

Problem is this:

If you pick up pickup 1. and then you pick up pickup 2.
Pickup 2. show you dialog AND give you money like pickup 1.

What the hell is this If you pick up pickup with weapon and then pick up pickup 2.,
pickup 2. show you dialog AND give you weapon...

HINT: Pickup 2.
Код:
pPickup[500] = CreatePickup(1272,1,x,y,z,0);
is called under OnDialogResponse so if player response
Код:
pPickup[500] = CreatePickup(1272,1,x,y,z,0);
Anyone can solve this problem without any code?

Reply
#2

Is it possible that the problem is becasue i CreatePickup under OnDialogResponse?
Reply
#3

Try using createdynamicpickup... I've had the same issue, thats how i solve mine
Reply
#4

Undefined Symbol "CreateDynamicPickup"
Reply
#5

You require this include and plugin sir:- https://sampforum.blast.hk/showthread.php?tid=102865
Reply
#6

Any other way anyone? I need to fix pickup ... If you pick pickup id 200 you get money but if you pick pickup 500 you get money too!
Reply
#7

Are you using OnPlayerPickupPickup?
Reply
#8

Yes

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
   	//...............some code before.............//		
        if(pickupid == pPickup[200]) 
        DestroyPickup(pPickup[200]),SendClientMessage(playerid, 0xFFFFFFFF, 
       "TEXT"),SetTimer("mytimer", 1800000, 1),GivePlayerMoney(playerid, 10000),PlayerInfo[playerid][pMoney]++;
       
	if(pickupid == pPickup[500])
       	{
        if(BLUE1 == false)

       		{
			ShowPlayerDialog(playerid, DIALOG_XXX, DIALOG_STYLE_MSGBOX, "text","text", "yes","no");

			BLUE1 = true;
			}
        }
        return 1;
        
}
Anyway i installed the plugine and dynamicpickup still does not work.
Reply
#9

Post your whole code of the pickup and the dialog; if it's too long, post it on pastebin and share the link.
Reply
#10

Код HTML:
new pPickup[600];
new bool:RED1 = false;
new bool:BLUE1 = false;
 
 
forward DestroyTimer1();
public DestroyTimer1()
{
DestroyPickup(pPickup[500]);
}
 
public OnGameModeInit()
{
//code before deleted//
pPickup[200] = CreatePickup(1212,19,-559.5560,-1480.1361,9.3424,0);
//same//
}
 
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
//code before deleted//
        case BROKENPICKUP:
        {
        if(response)
            {
            if(PlayerInfo[playerid][pSomething] >= 10)
                {
                PlayerInfo[playerid][pSomething] -= 10;
               
                DestroyPickup(pPickup[499]);//RED1
                RED1 = true;
                BLUE1 = false;
                pPickup[500] = CreatePickup(1272,1,2453.7996,-1713.3177,13.6317,0); //BLUE1
                SetTimer("DestroyTimer1", 10000*60, false); //timer for destroy pickup 500 in 10 minutes
               
                }
                else
                {
                SendClientMessage(playerid, 0xFFFFFFFF, "some text");
                }
 
            }
 
        }
 
 
public OnPlayerPickUpPickup(playerid, pickupid)
{
        if(pickupid == pPickup[200]) DestroyPickup(pPickup[24]),
        GivePlayerMoney(playerid, 10000),SendClientMessage(playerid, 0xFFFFFFFF,"text"),SetTimer("mytimer", 
        1800000, 1);
       
        if(pickupid == pPickup[500])
        {
        if(BLUE1 == false)
       
            {
            ShowPlayerDialog(playerid, BROKENPICKUP, DIALOG_STYLE_MSGBOX, "text","text", "yes","");
 
            BLUE1 = true;
            }
        }
        return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)