Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Mötley on Mar 17, 2016, 02:15 PM

Title: Weapon Pickups not removing
Post by: Mötley on Mar 17, 2016, 02:15 PM
Server side I added weapon pickups

Pickups never remove. And there is a max limit on ammo when there is not.

//pickup
function iWeaponPickup(model, x, y, z) {
  local iWeapon = CreatePickup(model, Vector(x, y, z));
 
  return iWeapon;
}
//pickup

Uses
Example:

function onScriptLoad()
{
  iWeaponPickup(280, -292.019440, -552.465149, 10.335078);

how do i remove the pickup say 30secs,Then place it again as you would in liberty unleashed or story mode?

Also i can remove the pickup but ??? Place it again? maybe i am doing this wrong and it needs to be somewhere eles
Title: Re: Weapon Pickups not removing
Post by: MaTaDeToR on Mar 17, 2016, 02:19 PM
Quote from: Mr_Motley on Mar 17, 2016, 02:15 PMServer side I added weapon pickups

Pickups never remove. And there is a max limit on ammo when there is not.

//pickup
function iWeaponPickup(model, x, y, z) {
  local iWeapon = CreatePickup(model, Vector(x, y, z));
 
  return iWeapon;
}
//pickup

Uses
Example:

function onScriptLoad()
{
  iWeaponPickup(280, -292.019440, -552.465149, 10.335078);

how do i remove the pickup say 30secs,Then place it again as you would in liberty unleashed or story mode?
Use pickup.Timer = Time;
Title: Re: Weapon Pickups not removing
Post by: Mötley on Mar 17, 2016, 02:21 PM
Where would that go onPickupPickedUp
or in the iWeaponFuction

//pickup
function iWeapon(model, x, y, z, Time=300) {
  local iWeapon = CreatePickup(model, Vector(x, y, z));
  pickup.Timer = Time;

  return iWeapon;
}
//pickup

 :o
Title: Re: Weapon Pickups not removing
Post by: MaTaDeToR on Mar 17, 2016, 02:23 PM
Quote from: Mr_Motley on Mar 17, 2016, 02:21 PMWhere would that go onPickupPickedUp
or in the iWeaponFuction
If you want that to go in iWeaponFunction or etc... just Identify the Pickup, for Example it is usually used in onPickupPickedUp function onPickupPickedUp( player, pickup )
{
if ( pickup.Model == bla )
{
{
pickup.Timer = 200;
}
}
P.S : If their is a Limit between the Ammo why don't you make it according to yourself ?
player.Ammo
Title: Re: Weapon Pickups not removing
Post by: Mötley on Mar 17, 2016, 02:25 PM
I modified my post ^ also tested weapons dont remove, Trying Pickup.remove
Title: Re: Weapon Pickups not removing
Post by: MaTaDeToR on Mar 17, 2016, 02:28 PM
Quote from: Mr_Motley on Mar 17, 2016, 02:25 PMI modified my post ^ also tested weapons dont remove, Trying Pickup.remove
You seriously don't have to copy it as it is, you have to use pickup instead of Pickup .-. if you are having the parameter "pickup" however you could also use pickup.Remove(), but unfortunately it will remove the pickup, and it wouldn't be spawn again unless you make one again.
Edit : it's absolutely working fine; however, maybe you have committed a mistake, take a look over here
function onPickupPickedUp( player, pickup )
{
 if( pickup.Model == 280 )
{
pickup.Timer = 30000;
 }
}
I've just putted the IWeapon... function in the script load, and made this, it's working fine....
Title: Re: Weapon Pickups not removing
Post by: Mötley on Mar 17, 2016, 02:36 PM
function iWeaon(model, x, y, z, Time=3000) {
  local iWeapon = CreatePickup(model, Vector(x, y, z));
  iWeaon.Timer = Time;
 
  return iWeapon;
}
Works!!!!! But leaves a orange circle xD
Any ideas?
Title: Re: Weapon Pickups not removing
Post by: Mötley on Mar 17, 2016, 02:38 PM
Okay, I must of been doing this all wrong Thank YOU :D

:P Thanks
Title: Re: Weapon Pickups not removing
Post by: MaTaDeToR on Mar 17, 2016, 02:38 PM
Quote from: Mr_Motley on Mar 17, 2016, 02:36 PMfunction iWeaon(model, x, y, z, Time=3000) {
  local iWeapon = CreatePickup(model, Vector(x, y, z));
  iWeaon.Timer = Time;
 
  return iWeapon;
}
Works!!!!! But leaves a orange circle xD
Any ideas?
Sure, their isn't anyway according to my algorithm to remove it; however , it can't be actually remove, but you could set the alpha, but it would be starting of a long process then....
P.S : In VC-MP if you glimp on the other Servers, they can't also remove it....I'd like to tell you much about alpha, but only timer is coming in my mind which could cause lag.... :)
and you are welcome, it's my pleasure to help. :)
Title: Re: Weapon Pickups not removing
Post by: Mötley on Mar 17, 2016, 02:42 PM
I thought it was on my part as how I built this.

I will play with it before I set the alpha :D

I can remove it with pickup.Remove();
***now since respawn weapon the normal way does not work i will probable just use the server timer on script load to recreate these pickups there iWeapon function