Vice City: Multiplayer

VC:MP Discussion => Support => Bugs and Crashes => Topic started by: Dagger on Aug 20, 2019, 12:39 PM

Title: [Bug] OnPickupRespawn executing repeatedly
Post by: Dagger on Aug 20, 2019, 12:39 PM
Description:
The event OnPickupRespawn (https://wiki.vc-mp.org/wiki/OnPickupRespawn) being executing repeatedly forever when a pickup respawns.

(https://i.imgur.com/dKytHwr.png)

Here's my function:
function onPickupRespawn( pickup )
{
Message("Pickup ("+pickup.ID+") respawned!");
}

Reproducible:
Always

What you were doing when the bug happened:
Just testing out

What you think caused the bug:
Idk.
Title: Re: [Bug] OnPickupRespawn executing repeatedly
Post by: MatheuS on Aug 20, 2019, 02:17 PM
Maybe you have to set the timer of Pickup.

http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/Pickup.Timer
Title: Re: [Bug] OnPickupRespawn executing repeatedly
Post by: Dagger on Aug 21, 2019, 07:08 PM
I am setting the timer. It is somewhat like this:

local pick = CreatePickup(368, 1, 50, Vector(-1183.42, -587.861, 11.5399), 255, true);
pick.Timer= 3000;

help please.
Title: Re: [Bug] OnPickupRespawn executing repeatedly
Post by: AroliS^ on Aug 21, 2019, 07:22 PM
Quote from: Dagger on Aug 21, 2019, 07:08 PMI am setting the timer. It is somewhat like this:

local pick = CreatePickup(368, 1, 50, Vector(-1183.42, -587.861, 11.5399), 255, true);
pick.Timer= 3000;

help please.

instead it use
if ( pickup.Model == model )
{
   pickup.RespawnTime = 5000;
}

It needs to be inside of 'onPickupPickedUp' function
Title: Re: [Bug] OnPickupRespawn executing repeatedly
Post by: Dagger on Aug 25, 2019, 08:51 AM
Quote from: AroliS^ on Aug 21, 2019, 07:22 PMinstead it use
if ( pickup.Model == model )
{
   pickup.RespawnTime = 5000;
}

It needs to be inside of 'onPickupPickedUp' function
I did that but it doesn't solve and is not related to the original bug:
Quote from: Dagger on Aug 20, 2019, 12:39 PMDescription:
The event OnPickupRespawn (https://wiki.vc-mp.org/wiki/OnPickupRespawn) being executing repeatedly forever when a pickup respawns.

(https://i.imgur.com/dKytHwr.png)

Here's my function:
function onPickupRespawn( pickup )
{
Message("Pickup ("+pickup.ID+") respawned!");
}