Pickups always disappear
#1

No matter what pickup type I choose, it always disappears.
I'm using 0.3b if that would help.

Any suggestions?
Reply
#2

Quote:
Originally Posted by Dudits
Посмотреть сообщение
No matter what pickup type I choose, it always disappears.
I'm using 0.3b if that would help.

Any suggestions?
Change pickup type to ID 23 !

Example:
pawn Код:
AddStaticPickup(1273, 23, X, Y, Z,);
Reply
#3

Can we see part of script where you create pickup, and OnPlayerPickUpPickup();?
Reply
#4

When you are creating a pickup it needs to look like this:

Example:

On top of the script:

pawn Код:
new MyPickup;
On OnGameModeInit:
Example:
pawn Код:
AddStaticPickup(1273, 23, X, Y, Z);
On OnPlayerPickUpPickup:
Example:
pawn Код:
if(pickupid == MyPickup)
{
Here put stuff you want that when player gets in the pickup ...
 return 1;
}
Reply
#5

Quote:
Originally Posted by Matej_
Посмотреть сообщение
Change pickup type to ID 23 !

Example:
pawn Код:
AddStaticPickup(1273, 23, X, Y, Z,);
Tried that, but I'm using CreatePickup not AddStaticPickup.


Quote:
Originally Posted by Ironboy500[TW]
Посмотреть сообщение
Can we see part of script where you create pickup, and OnPlayerPickUpPickup();?
pawn Код:
new BankPickup;

public OnGameModeInit()
{
    SetGameModeText("CDM v1.0");
    UsePlayerPedAnims();
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    // Pickups
    BankPickup = CreatePickup(1239, 23, -794.9199, 1557.0032, 27.1244);
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == BankPickup)
    {
        GameTextForPlayer(playerid, "~w~Bank Entrance~n~Press ~r~~k~~PED_DUCK~~w~ to enter", 5000, 5);
        return 1;
    }
    return 1;
}
Reply
#6

Bump .
Reply
#7

Sorry for bumping again, I found out that after commenting the following everything goes okay.

pawn Код:
if(pickupid == dPickup)
    {
        new Float:health;
        GetPlayerHealth(playerid, health);
        SetPlayerHealth(playerid, health +25);
        DestroyPickup(dPickup);
    }
I have it above the BankPickup if statement.
Any suggestions?
Reply
#8

Try not destroying it..? and btw double posting is against this forums rules..
Reply
#9

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
Try not destroying it..? and btw double posting is against this forums rules..
Yeah sorry it was burred down.

Sometimes the pickup doesn't destroy for players, therefore I have to set its type to 23 and destroy it manually.
Reply
#10

Again it got burred down.
Still seeking an answer.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)