Pickups always disappear -
Dudits - 06.09.2010
No matter what pickup type I choose, it always disappears.
I'm using 0.3b if that would help.
Any suggestions?
Re: Pickups always disappear -
Matej_ - 06.09.2010
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,);
Re: Pickups always disappear -
Ironboy500[TW] - 06.09.2010
Can we see part of script where you create pickup, and OnPlayerPickUpPickup();?
Re: Pickups always disappear -
Matej_ - 06.09.2010
When you are creating a pickup it needs to look like this:
Example:
On top of the script:
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;
}
Re: Pickups always disappear -
Dudits - 06.09.2010
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;
}
Re: Pickups always disappear -
Dudits - 06.09.2010
Bump .
Re: Pickups always disappear -
Dudits - 06.09.2010
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?
Re: Pickups always disappear -
Cameltoe - 06.09.2010
Try not destroying it..? and btw double posting is against this forums rules..
Re: Pickups always disappear -
Dudits - 06.09.2010
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.
Re: Pickups always disappear -
Dudits - 07.09.2010
Again it got burred down.
Still seeking an answer.