Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: PsyChO_KiLLeR on Mar 03, 2015, 10:51 AM

Title: ReSpawn Time
Post by: PsyChO_KiLLeR on Mar 03, 2015, 10:51 AM
Well i create a pickup in my server but its respawn cant set when i pick a pickup it respawn after 0  sec again and again how to set respawn time
 
if ( pickup.Model == 408 )
                {
                pickup.RespawnTime = 60;
                 IncCash( player, 2000 );
                Message( "You have found 2000 cash in bank." );
}
Title: Re: ReSpawn Time
Post by: . on Mar 03, 2015, 11:18 AM
I'm guessing you should just make the pickup automatic `Pickup.Automatic` (boolean: true|false) And the pickup will re-spawn automatically after the time from `Pickup.Timer` alias `Pickup.RespawnTime` (integer: seconds). You can also force a pickup to re-spawn immediately with the `Pickup.Respawn()`function.
Title: Re: ReSpawn Time
Post by: PsyChO_KiLLeR on Mar 03, 2015, 12:22 PM
how to add it?
Title: Re: ReSpawn Time
Post by: . on Mar 03, 2015, 05:19 PM
Quote from: PsyChO_KiLLeR on Mar 03, 2015, 12:22 PMhow to add it?

I'm not sure what you mean by that :-\
Title: Re: ReSpawn Time
Post by: MacTavish on Mar 04, 2015, 05:48 AM
@S.L.C he wants you to make an pickup code for him
Title: Re: ReSpawn Time
Post by: PsyChO_KiLLeR on Mar 04, 2015, 06:53 AM
nope i already have pickup but i want that respawn line code
Title: Re: ReSpawn Time
Post by: . on Mar 04, 2015, 06:55 AM
Quote from: PsyChO_KiLLeR on Mar 04, 2015, 06:53 AMnope i already have pickup but i want that respawn line code

It's just a member function of the Pickup type like I already mentioned :-\
pickup.Respawn();
Title: Re: ReSpawn Time
Post by: MacTavish on Mar 04, 2015, 07:47 AM
I would say that he have to try this i am not sure it succeed or not because i've not tried it if ( pickup.Model == 408 )
                {
                pickup.RespawnTime = 6000;
                 IncCash( player, 2000 );
                Message( "You have found 2000 cash in bank." );
}

If the pickup respawn after 6secs then its working fine
Title: Re: ReSpawn Time
Post by: Kratos_ on Mar 04, 2015, 01:39 PM

Post us the code which creates your pickup during server startup . Are you receiving prize & reward messages more than usual ?  I'm guessing that you have created an infinite timer which is creating a cyclone of pickups at the same vector position & thus they are getting overlapped . But , its an assumption .
Anyway , post us that code which creates your pickup & also function onPickupPickedUp( player, pickup ) .
Title: Re: ReSpawn Time
Post by: PsyChO_KiLLeR on Mar 05, 2015, 04:14 AM
Worked in 0.4 it was 60= 1 sec so i set 60000 = 1minute
it works
thnx