Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Cool on Jun 25, 2016, 04:07 AM

Title: pickup remove
Post by: Cool on Jun 25, 2016, 04:07 AM
how to remove pickup of wepons after death which came i want to remove it after 30secs please will you guys help me please explain in detail i read old topic but didnt understand
Title: Re: pickup remove
Post by: Finch Real on Jun 25, 2016, 06:39 AM
Just create a pickup on playerdeath and add newtimer of 30sec ifnobody claims it use pickup.Remove();
Title: Re: pickup remove
Post by: KAKAN on Jun 25, 2016, 07:04 AM
Well, use a timer, find the pickup and then remove it.
off:
Quote from: Finch Real on Jun 25, 2016, 06:39 AMJust create a pickup on playerdeath and add newtimer of 30sec ifnobody claims it use pickup.Remove();
he will get a new error: The index 'pickup' doesn't exist.
Title: Re: pickup remove
Post by: Finch Real on Jun 25, 2016, 07:29 AM
Quote from: KAKAN on Jun 25, 2016, 07:04 AMWell, use a timer, find the pickup and then remove it.
off:
Quote from: Finch Real on Jun 25, 2016, 06:39 AMJust create a pickup on playerdeath and add newtimer of 30sec ifnobody claims it use pickup.Remove();
he will get a new error: The index 'pickup' doesn't exist.
I think no

Function remover( pickup )
Title: Re: pickup remove
Post by: KAKAN on Jun 25, 2016, 07:36 AM
Quote from: Finch Real on Jun 25, 2016, 07:29 AM
Quote from: KAKAN on Jun 25, 2016, 07:04 AMWell, use a timer, find the pickup and then remove it.
off:
Quote from: Finch Real on Jun 25, 2016, 06:39 AMJust create a pickup on playerdeath and add newtimer of 30sec ifnobody claims it use pickup.Remove();
he will get a new error: The index 'pickup' doesn't exist.
I think no

Function remover( pickup )
you know that you can't pass instances using timers?
:edit: Here's an example for you, @Hercules
local pickup = CreatePickup(...);
NewTimer("remove",1000,1,pickup.ID);
function remove( pID )
{
 local p = FindPickup( pID );
 if( p ) p.Remove(); //or whatever it is.
}
Title: Re: pickup remove
Post by: Xmair on Jun 25, 2016, 07:46 AM
@KAKAN , you did not define "pickup" as a variable.
Title: Re: pickup remove
Post by: KAKAN on Jun 25, 2016, 08:00 AM
Quote from: Xmair on Jun 25, 2016, 07:46 AM@KAKAN , you did not define "pickup" as a variable.
Thanks for telling. Edited.